Sunday, November 22, 2009

S7 200 STEP7-Micro/WIN32 programming software introduction


STEP7-Micro/WIN32 a Siemens for SIMATIC S7-200 series programmable logic controller developed by the programming software, which is Windows-based application software and powerful, can be used to develop user program, but also real-time monitoring user program the implementation of the state. The following describes the software installation, basic functions and how to use programming software, programming, commissioning and operation of monitoring and so on.
First, install the programming software STEP7-Micro/WIN32
1, system requirements
    
STEP7-Micro/WIN32 programming software to run the computer system requirements
    
CPU 80486 or above processor
    
8MB RAM or more
    
50MB or more hard drives
    
Operating system, Windows 95, Windows 98, Windows ME, Windows 2000
    
Computer IBMPC and compatible
    
2, the hardware connection
    
The use of a PC / PPI (Personal Computer / Point to Point Interface) cable can be established between the personal computer and PLC communications. This is a single master means of communication, without requiring additional hardware, such as modems and programming devices.
    
A typical single master station connected as shown in Figure A-1. The PC / PPI cable to PC client and the computer's RS-232 communication port (COM1 or COM2) to connect to PC / PPI cable PPI-side with the PLC's RS-485 communication port connection can be.

Figure A-1 PLC and the connection between computers
3, Software Installation

STEP7-Micro/WIN32 programming software from Siemens, the company's Web site downloads, CD-ROM can also be used to install, installation steps are as follows:
    
1) Double-click STEP7-Micro/WIN32 installer setup. exe, then the system will automatically enter the installation wizard.
    
2) to assist in the installation wizard to complete the software installation. You can use the default software installation path of the subdirectory, you can also use "browse" button on the pop-up dialog box, select or create a new one in any subdirectory.
    
3) In the installation process, if there is PG / PC Interface dialog box, click on the "Cancel" to next step.
    
4) In the end of the installation, there will be the following options:
    
Yes, I now want to restart the computer (default option);
    
No, I'll re-start the computer.
    
Recommend choosing the default item, click "Finish" button to end the install.
    
5) software installation is complete, it will appear two options:
    
Yes, I now visit the Remade files (default option);
    
Yes, I will now proceed to STEP7-Micro/WIN32
    
If you choose the default option, you can use German, English, French, Spanish and Italian to read Remade documents, visit the STEP7-Micro/WIN32 programming software.
    
2, STEP7-Micro/WIN32 main function of programming software
    
1, the basic functions
    
STEP7-Micro/WIN32 programming software's basic function is to help users complete the application software development, its main functions to achieve the following.
    
1) In the offline (offline) mode to create user programs, modify and edit the original user program. In the offline approach, the computer and the PLC disconnect at this time to complete most of the basic functions, such as programming, compiling, debugging, and system configuration and so on, but all the procedures and parameters are only stored on the computer's disk .
    
2) In-line (online) mode can establish communications with the computer directly to a variety of relations between the PLC operation, as above set out, download user program and configuration data.
    
3) In the editing process during the process of grammar checking to avoid some of the types of grammatical errors and data errors. The grammar checker, the error at the bottom ladder Automatic red wavy line, the error statement line before the table since the animated red *, and in the wrong, add the red wavy line.
    
4) user procedures document management, encryption processing.
    
5) Set PLC's working methods, parameters and operation monitoring.
    
2, the main interface function of the various parts of

STEP7-Micro/WIN32 programming software's main interface looks as shown in Figure A-2.

A-2 STEP7-Micro/WIN32 Fig programming software interface

Interface can generally be divided into several areas: the title bar, menu bar (including 8 single main course), toolbar (shortcut buttons), and guide section (shortcut operation window), command tree (fast operation window), the output window, the state articles, and user window (may be simultaneously or separately opening five user window).

In addition to the menu bar, users may determine the choice and style of other windows.
(1) The menu bar in the menu bar in a total of eight Main menu options, each individual function of the main course is as follows.
    
1) File (File) menu items to be completed as a new, open, close, save the file, import and export, upload and download programs, files, page setup, print preview and print set up such an operation.
    
2) Editing (Edit) menu items to provide various tools used for editing programs, such as selection, cut, copy, paste, block or data block of the operation, as well as find, replace, insert, delete and fast cursor positioning functions.
    
3) the view (View) menu item you can set the programming software development environments, such as opening and closing other auxiliary windows (such as window guidance, instruction tree window toolbar button area), to guide the implementation of all operations of the project window, select a different language The programmer (LAD, STL or FBD), set up three kinds program editor's style (such as fonts, instruction boxes size etc.).
    
4) Programmable Logic Controller (PLC) menu item used to implement the time-line and PLC operations, such as changing the PLC's work, on-line compilation, remove programs and data, view information on PLC, and PLC-type selection and communication settings .
    
5) Debugging (Debug) menu item is used on-line debugging.
    
6) Tools (Tools) menu item can call the complex instructions (such as PID instruction, NETR / NETW instructions and directives HSC), installation of the text display TD200, change the user interface styles (such as the Settings button and button styles, add the menu items), with " Options "sub-menu you can set the style editor of three programs (eg, language patterns, colors, etc.).
    
7) window (Windows) menu item's function is to open one or more windows, and make the switch between windows. You can set the window of emissions (such as horizontal, vertical, or stack).
    
8) Help (Help) menu items can easily retrieve a variety of help, it also provides online search functions. But also in the software during operation, they can always press F1 key to display online help.
    
(2) The tool bar will STEP7-Micro/WIN32 programming software for the most commonly used form of action to the button set into the toolbar, providing simple mouse operations. Can use a "View" menu in the "Tools" option to show or hide the 3 buttons: the standard, debugging and directives.
    
(3) to guide the course of the programming guide provides the window of fast-switching capabilities, available "View" menu "guide section" option to choose whether to open the boot section. There are seven kinds of guide bar components.
    
1) block (Program Block) from the executable program code and comments form. Program code from the main program (OB1), optional subroutine (SBR0) and the interrupt program (INT0) component.
    
2) The Symbol Table (Symbol Table) are used to create custom symbols and the corresponding relationship between the direct address, and can attach notes, allows users to use meaningful symbols as a programming element to increase the readability of programs. For example, the stop button on the system input address is I0.0, you can address I0.0 symbol table will be defined as the stop, so all addresses I0.0 ladder programming components replaced by the stop.
When compiled, the program downloaded to the PLC when, all of the symbols addresses will be converted into an absolute address.
    
3) The state diagram (Status Chart) for on-line debugging monitor the status of each variable and the current value. Only need to write the address bar of variable addresses, data formats in the column indicating the type of a variable, you can watch these variables at run-time status and current value.
    
4) data block (Data Block) can register a variable V initial assignment or modification of data, and can add the necessary annotations.
    
5) System Block (System Block) is mainly used for system configuration. System configuration includes setting digital or analog input filter, set the pulse capture, configure the output table, to keep the scope of the definition of memory, set passwords and communication parameters. In this appendix on the system configuration settings without detail.
    
6) Index (Cross Reference) can provide the index information and the use of bytes and bits usage information, making use of resources at a glance PLC. Only in the editing process is completed, to see cross-reference table of contents. In the cross-reference table, the number of double-click an operator, you can display containing the operands of that part of the program.
    
7) Communications (Communications) can be used to establish communication between the computer and PLC connection and communication parameters settings and modification.
    
In the lead article, click "Communication" icon will appear a "Communication" dialog box, double-click one of the "PC / PPI" cable icon will appear "PG / PC" interface dialog box, this time to install or remove communications interfaces, check all parameter settings are correct, in which the default value is 9600 baud rate.
    
Set up parameters, we can establish communication links with the PLC. Double-click "Communication" dialog box "Refresh" icon, STEP7-Micro/WIN32 will check all connections of the CPU of the S7-200 station and a station for each icon in the establishment of a CPU.
    
The establishment of computer and PLC communication links, you can set the PLC's communication parameters. Click the guide bar "system block" icon will appear "system block" dialog box, click the "communication port (Port)" option, inspect and modify the various parameters, confirmed that is correct, click "Confirm (OK)" button. Finally click the toolbar the "download (Download)" button to confirm the parameters downloaded to the PLC after the host.
    
Tree with the command window or view (View) menu option also allows the programming window switch.
    
(4) instruction tree the tree to provide programming instructions used by all commands and command a fast operation of PLC. Can use the view (View) menu "command tree" option to determine whether they open.
    
(5) The output window of the window used to display program to compile the results of the information. If each block of information, compile the results for errors and the error code and location.
    
(6) status bar status bar also called the task bar, used to display the software implementation, editor displayed when the cursor is on a network number, line number and column number, run the program displays the status of operation, communication baud rate, remote address and other information.
    
(7) The program editor can use Ladder Diagram, Statement List, or Function Chart program editor to write and modify user program.
    
(8) local variable table for each block corresponds to a local variable table, with the parameters in the subroutine call, the parameters passed on the adoption of local variables table of the.
    
3, STEP7-Micro/WIN32 the use of programming software
    
1, generate program file
    
A program file from three sources: create a new file, open an existing program files and upload files from the PLC.
    
(1) new program files can use the "File (File)" menu "New (New)" item or tool bar of the "New (New)" button to create a new file. Figure A-3 shows a new program file instructions trees.


Figure A-3 structure of the new program file

In the new program file the initial set up, the file to "Project1 (CPU221)" name, CPU221 the system default PLC-CPU model. Command tree can be seen in a file that contains seven related blocks (block, symbol tables, state diagram, the data block, the system blocks, cross-indexing and communications), which block includes a main program (MAIN), an optional The subroutine (SBR 0), and an interrupt service routine (INT 0).
    
Users can program the need to modify according to the actual program files for initial setup.
    
1) to determine PLC-CPU model. Right-click the "Project1 (CPU221)" icon, click the button at the pop-up "type (Type)", can be selected in the dialog box type the actual PLC. Can also be used "PLC" menu "type (Type)" key to select the PLC model.
    
2) program was renamed. If you change the program's file name, click on "file (File)" menu "Save As (Save as)" item, in the pop-up dialog box, type the new file name.
Block in the main program the name of the general use the default name "MAIN", any program is only one main program file.
    
Subroutine and interrupt procedures for name change may need to order the tree window, right-click the renamed subroutine or interrupt the program name, the select button in the pop-up, click "Rename (Rename)", and then type the new name.
    
3) Add a subroutine or interrupt program.
    
Method 1: In the command window, right-click on the tree "program block (Program Block)" icon, the select button in the pop-up, click "Insert subroutine (Insert Subroutine)" or "Insert interrupt program (Insert Interrupt)" item.
    
Method 2: Use the "Edit (Edit)" menu "Insert (Insert)" under "subroutine (Subroutine)" or "interrupt program (Interrupt)" to achieve.
    
Method 3: Right-click the Edit window, the pop-up option select "Insert (Insert)" under the "subroutine (Subroutine)" or "interrupt program (Interrupt)" command.
    
The new generation subroutine or interrupt the program subroutine or interrupt in accordance with established procedures for the number of auto-increment number, users can be renamed.
    
(2) Open the program file to open the disk in an existing program files, can be used "file (File)" menu "Open (Open)" command, or click the toolbar in the "Open (Open)" button.
    
(3) to upload files to establish communications with the PLC cases, can be stored in the PLC of the program and data transmitted to the computer. Available "document (File)" menu "Upload (Upload)" command, or click the toolbar the "upload (Upload)" button to complete the file uploaded.
    
2, edit the program files
    
STEP7-Micro/WIN32 programming software programs using an editor and modify the commonly used ladder diagram editor, the following describes some of the basic ladder diagram editor editing. Statement table and Function Chart Editor-operation can be carried out is similar.
    
(1) input device programming Ladder programming components have contact, coil, instruction boxes, labels and connecting lines, can be entered in two ways.
    
Method 1: Use a set of programming button on the toolbar, as shown Figure A-4. Click the contact (Contact), coil (Coil) or instructions box (Box) buttons, from the pop-up window, select the type of instructions, click the can.


Figure A-4 Edit button

Toolbar button in the program has nine, down line, up line, left-and right line input connectors for line-line button, line, form a complex ladder; contacts, coil and instructions box button is used to enter the program components; into the network and remove the network button is for editing programs.
    
Method 2: According to the instruction to enter the category, double-click commands in the category tree icon, select the appropriate instructions, click the can.

Figure A-5 instruction tree bit logical instructions

Enter programming component steps:

 
1) The order of input programming element. In a network, if only programming components in series connection, the input and output are non-branching, you can start from the network followed by the various programming input devices, each enter a program component, the cursor automatically shifted to the right one, as Figure A-6 Suo show.
      
Figure A-6 sequence of input programming element
    
2) input operands. Enter the programming component, it will appear "??.?" or "????", expressed here should be input operands. Click "??.?" or "????", can type operands.
    
3) to add any program components. If you want to add a program in any location component, simply click the location of the cursor to move here, then enter the program components.
    
(2) The complex structure of inputs if you want to edit the map A-7 of the ladder, you can click Figure A-6 in the network a first line of the bottom, and then displayed at the cursor, type contacts, generate a new line. Input is completed, to move the cursor back just entered contact Department, the click in the toolbar "uplink (Line Up)" button.

Figure A-7 complex structure of input

If you want to down the line after the branch of a component, you can move the cursor at the component, click the "down-line (Line Down)" button.
    
(3) The insertion and deletion editing process, we often have to be inserted or deleted row, a column, a network, a word program or an interrupt program operation, to achieve these operations in two ways.
    
Method 1: Right-click the program editor area to conduct insert (or delete) the location of the pop-up menu, select "Insert (Insert)" or "Remove (Delete)", continues the pop-up sub-menu, click to insert a (or delete) options, such as the row (Row), Column (Column), down to the branch (Vertical), network (Network), interrupt program (Interrupt) and subroutines (Subroutine).

Figure A-8 insert or delete operation

Method 2: Move the cursor to operate the location, use the "Edit (Edit)" menu "Insert (Insert)" or "Remove (Delete)" command to finish.
    
(4) The block operation block operation, including block selection, block cutting, block erase, block copy and paste blocks can facilitate the achievement of the program's move, copy and delete operations.
    
(5) Editing symbol table click the guide bar "symbol table (Symbol Table)" icon, or use "view (View)" menu, the "symbol table (Symbol Table)" command, enter the symbol table window, shown in Figure A -9 shown. Click the cell can be symbolic names directly addresses, comment input. Figure A-7 in the direct address number is written after the symbol table, can be formed by compiling the results shown in Figure A-10.
       
Figure A-9 "symbol table" window

Figure A-10 program with the symbol table

To appear in the ladder symbol, to select the "view (View)" menu "symbol address (Symbolic Addressing)" item. On the contrary, it is necessary to display the ladder directly addresses, then abolish the "symbolic addressing (Symbolic Addressing)" item.
    
(6) The use of local variables, local variables table definition of table is used to limit the scope of local variables, local variables can only create an effective unit of its programs, while global variables are valid in each program unit that can be used definition of global variable symbol table .
Open the local variables table method is to program editing cursor to the edge of the area, and then drag it down, then automatically appear on local variable table. As shown in Figure A-11. In the local variable table, you can set the variable name of the (Name), the variable type (Var Type), data type (Data Type) and comments (Comment), the system will automatically allocate local variables are stored.


           
Figure A-11 Local variable table

Local variable table, the variable types of input (IN), outputs (OUT), Input - Output (IN-OUT), and temporary (TEMP) 4 kinds, depending on the parameter type select the corresponding data types, such as bit ( BOOL), byte (BYTE), word (WORD), integer (INT), a real number (REAL) and so on.
    
If you want the local variable table, insert or delete a local variable can right-click the variable type of zone, in the pop-up menu, select "Insert" or "delete", and then select "Line (Row)" or "line under the (Row Below ) can be.
    
(7) Add Comment Ladder Editor Network n that each network is also the title bar can be added for each network in this title or explanatory notes. Double click Network n region, the pop-up dialog box shown in Figure A-12, in the "Title (Title)" text box, type the title, in the "Notes (Comment)" text box, type the comment.

Figure A-12 "title and Notes for the" Window

(8) to switch programming languages STEP7-Micro/WIN32 programming software can easily be carried out three types of programming language statement, table, ladder and function to switch between the table map. Approach is to "view (View)" menu, click "STL", "LAD", or "FBD", enter the corresponding programming environment.
    
(9) compiler program file editing is complete, can be "PLC" menu "Compile (Compile)" command, or tool bar, "compiled (Compile)" button to off-line compilation. Compiled after the end of the output window to display the results compiled.
    
(10) download programs only if the compiler is correct in order to download to your computer. Before downloading, PLC must be in the "STOP" state. If you do not STOP state, you can click the toolbar "Stop (STOP)" button, or select "PLC" menu "Stop (STOP)" command can also be CPU mode selector switch on the module pull directly to the "Stop (STOP) "position.
    
In order to download the correct implementation of the procedures can be downloaded before the PLC should be stored in the original program removal. Click "PLC" menu item in the "Clear (Clear)" command, the dialog box appears, select "Clear All (Clear All)" can be.
    
3, the print program files click "File (File)" menu "Print (Print)" option, as shown in Figure A-13 in the dialog box you can choose to print the contents, such as the ladder (Ladder), symbol Table (Symbol Table), state diagram (Status Chart), data block (Data Block), Cross-Index (Cross Reference) and the elements of the use of (Element Usage). Ladder can also choose to print the range, as all (All), the main program (MAIN), subroutines (SBR) and the interrupt program (INT).

Figure A-13 "printed output" window

Click the lower left corner of Figure A-13 of the "option (Options)" button will appear as shown in Figure A-14 of the dialog box, choose the number of rows per page (Number of Columns to Print), attributes ( Properties), local variable table (Local Variable Table) and Network Notes (Network Comments).

Figure A-14 "Print Options" window
4, program debugging and monitoring

STEP7-Micro/WIN32 programming software allows the user environment in the software debugger and monitor directly running the program.
    
1, select the scanning frequency
    
Monitor user program execution, choose single or multiple scans. PLC's work should be first set to "STOP", use "Debug (Debug)" menu "repeatedly scan (Multiple Scans)" or "initial scan (Fist Scans)" command. In selecting multiple scan, scan to specify the number of times.
    
2, with the state diagram monitoring program
    
STEP7-Micro/WIN32 programming software state diagram can be used to monitor the user program implementation, and can operate on a mandatory program components.
    
(1) The use of state diagrams in the boot of the window, click the "state diagram (Status Chart)" icon, or use "Debug (Debug)" menu, the "state diagram (Status Chart)" command can open a state diagram window, as shown in Figure A-15. In the state diagram "address (Address)" column, type the programming components to be monitored directly address (or symbol table in the symbol name), in the "format (Format)" column shows the data type of program components, in the " the current value (Current Value) "column read out the status of program components, the current value.

Figure A-15 "state diagram" window

Toolbar state diagram editing tools sequential order (Sort Ascending), reverse sort (Sort Descending), a single read (Single Read), everything is written (Write All), force (Force), the lifting force (Unfore), the disarmament of all forces (Unfore All), as well as read all the mandatory (Read All Forced) and so on.
    
(2) Mandatory enforcement action refers to the state diagram operation is the variable mandatory assignment. S7-200 to allow for all the I / O bits, as well as analog I / O (AI / AQ) mandatory assignment, but also forced to change up to 16 V or M of data, the variable type can be byte, word or double word .
    
1) Mandatory. To force a new value, the state diagram could be the "new value (New Value)" column enter the new value, and then click the toolbar in the "mandatory (Force)" button. If you want to force an already existing value, you can click the state diagram "Current Value (Current Value)" column, and then click on "mandatory (Force)" button.
    
2) read all mandatory. Open the state diagram, click the toolbar in the "Reading all mandatory (Read All Forced)" button, then the state diagram has been compulsory for all cells display the mandatory symbols.
    
3) the lifting force. In the current value of column Click to cancel mandatory operands, and then click the toolbar of the "lifting force (Unfore)" button.
    
4) the disarmament of all forces. Open the state diagram, click the toolbar the "disarm all forces (Unfore All)" button.
    
3, operation mode, the editor
    
In the run mode, you can make minor modifications to the user program, the revised program once the download will immediately affect system operation. This operation can be PLC with CPU224 and CPU226 two kinds. Operation is as follows.
    
1) In the run mode, select "Debug (Debug)" menu "in running state editing program (Program Edit in RUN)" command. Run mode the host of the program can only be edited, when the host program and programming software, the program is not at the same time, the system will prompt the user for archiving.
    
2) screen pop-up warning message, click "Continue (Continue)" button, PLC host of the program will be uploaded to the programming window, this time may be running mode, editing process.
    
3) The program compiled successfully, can be "document (File)" menu "Download (Download)" command, or click the toolbar in the "Download (Download)" button, the program downloaded to the PLC host.
    
4) Quit operation mode editing. Use "Debug (Debug)" menu "in running editing program (Program Edit in RUN)" the command, and then choose "Options (Checkmark)" in the content.
    
4, the program monitors
    
STEP7-Micro/WIN32 provides three kinds of program editor (Ladder Diagram, Statement List, and Function Chart) are running in the PLC to monitor the status of the various programming components, and various operand values. Introduced here only in the ladder editor of surveillance programs running, as shown in Figure A-15, Ladder Diagram Editor window, the components that were lit in a connected state.
    
Procedures for monitoring implementation, available "tool (Tools)" menu "option to (Options)" command to open the Options dialog box, select the "LAD state (LAD status)" item, then select a ladder style, in the Open the ladder window, click the Tools section of "program status (Program status)" button.
    
Ladder display there are three kinds of styles: directive addresses the internal display and external display data values; instruction address of the external display also show that both the data value; only display data values.
    
5, S7-200 error code
    
The use of "PLC" menu "Information (Information)" command, you can view the program error message. S7-200 error mainly in the following three kinds.
    
1, fatal error
    
Fatal error will lead to CPU can not perform a certain function or all functions to stop implementation of the user program. When a fatal error occurs, PLC automatically enter the STOP mode, lit "System Error" and "STOP" indicator light, close the output. Elimination of a fatal error, you must restart the CPU.
In the CPU can read about the fatal error codes and their descriptions as shown in Table A-2.
    
A-2 Table fatal error code and description
Code error code error description description
0000 non-fatal error 000B memory card, the user program to check the error
0001 user program compile error 000C memory card configuration parameter checking errors
0002 compiled ladder to check for errors 000D memory card mandatory data to check for errors
0003 Scan watchdog timeout error 000E memory card the default value of the output table to check for errors
0004 Internal EEROM error 000F memory card user data, DB1 to check for errors
0005 user program the internal EEPROM to check for errors internal software error 0010
0006 Internal EEPROM configuration parameter to check for errors 0011 errors indirect addressing more contacts
0007 data within the EEPROM to check for errors 0012 forced more illegal value error 0008 contact default output table values within the EEPROM to check for errors 0013 memory card space or CPU does not recognize the card
0009 Internal EEPROM user data, DB1 interface to the scope of comparison to check for errors 0014 errors
000A Memory Card malfunction
    
2, the program run error
    
Normal operation the program, you may produce non-fatal errors (such as addressing error), this time non-fatal CPU generated an error code and description as shown in Table A-3.
     
Table A-3 program is running error code and description of
Error Code Error Description
0000 error-free


No comments:

Post a Comment

 

yasmin lawyer