You are on page 1of 18

12.

3 APPLYING SIEMENS PLC PROGRAMMING SOFTWARE


Installing STEP7-Micro/win programming software.
- Description of STEP7-Micro/win programming software
- Importance of STEP7-Micro/win programming software
- Apply installation steps of STEP7-Micro/win programming Software
12.3.1. Description of STEP7-Micro/win programming software
STEP7-Micro/WIN V4.0 SP6
Installation and use of programming software
With the continuous progress of PLC application technology, the functions of Siemens
S7-200 series PLC programming software are also constantly improving.
This chapter takes the 2007 version of the S7-200 series PLC programming software as
an example to introduce the installation, function and use of the programming software,
and introduces the input, editing, debugging and monitoring operation methods of user
programs in combination with application examples.
STEP7-Micro/WIN V4.0 SP6 programming software
SIMATIC S7-200 programming software refers to the collection of industrial
programming software compiled by Siemens for the S7-200 series PLC. Among them,
the STEP7-Micro/WIN V4.0 SP9 software is a Windows-based application software,
which is an upgraded version of the new version of the programming software STEP7-
Micro/WIN V4.0, which is suitable for S7-200 series PLC system settings (CPU
configuration), USER program development and real-time monitoring operation. The
upgraded version of Micro/win V4.0 SP9 expands the functions of V4.0, and the
Toolbox provides user instructions and configuration software for the touch screen
TP070
12.3.1.1 Installation of programming software
The programming software STEP7-Micro/WIN V4.0 SP6 can be installed on a PC
(personal computer) and SIMATIC programming device PG70. The conditions and
methods for installation on the PC are as follows. Installation conditions - The PC uses
Microsoft Windows 2000 Service Pack 3 (or later) or Windows XP/Vista operating
system.
 Installation method - Close all applications, including the MS-Office toolbar.)
Insert the STEP 7-Micro/WIN CD disk into the optical drive.
 If the auto-run option is not disabled, the installer will run automatically. You can
also double-click Setup on the disc. exe file, run the installer manually.
 Follow the instructions displayed on the screen to complete the installation.
or
 Put the CD-ROM that stores the software into the optical drive or plug the pen
drive containing the installation files to the computer
 Locate and double-click the installer SETUP on the CD. EXE, select the English
language, and enter the installation wizard
 Follow the installation wizard to complete the installation of the software
 The software is installed.
Communications Options
Siemens provides two programming options for connecting your computer to your S7-
200:
i. a direct connection with a PPI Multi-Master cable,
ii. a Communications Processor (CP) card with an MPI cable.
The PPI Multi-Master programming cable is the most common and economical method
of connecting your computer to the S7-200. This cable connects the communications
port of the S7-200 to the serial communications of your computer. The PPI Multi-Master
programming cable can also be used to connect other communications devices to the
S7-200.The PLC is connected to realize the communication between the master and
slave equipment. The following only discusses examples of network configuration using
S7-200 devices.
(1) Single master PPI network
 For a simple single-master network, the programming station can communicate
with the S7-200 CPU through a PPI multi-master cable or a communication
processor (CP) card on the programming station.
 In the network example shown in Figure 1(a), the programming station (STEP7-
Micro/WIN) is the master station of the network. In the network example of Figure
1-1(b), the human-machine interface (HMI) device (e.g., TD200, TP, or OP) is the
master station of the network. In both networks, the S7-200 CPU is a slave
station, responding to requests from the master station.

Figure 1 single master PPI network


(2) Multi-master PPI network
An example of a multi-master network with a slave station is given in Figure 2(a). The
programming station (STEP7-Micro/WIN) can choose CP card or PPI multi-master
cable. STEP 7-Micro/WIN and HMI share the network. STEP 7- Micro/WIN and HMI
devices are the master stations of the network, and they must have different network
addresses. If a PPI multi-master cable is used, then the cable will be used as the
master station and use the network address provided to it by STEP7-Micro/WIN
address, S7-200 CPU will be used as a slave.
Figure 2(b) shows an example of a PPI network where multiple masters and multiple
slaves communicate. In the example, STEP 7-Micro/WIN and HMI can read and write
data to any S7-200 CPU slave. STEP7-Micro/WIN and HMI sharing network. All devices
(master and slave) have different network addresses. If you use a PPI multi-master
cable, then the cable will act as the master and use the network address provided to it
by STEP7-Micro/WIN. The S7-200 CPU will act as a slave.

Figure 2 multiple Master PPI network

 For networks with multiple masters and one or more slaves, you need to
configure STEP 7-Micro/WIN to use the PPI protocol.
 If possible, you should also use a multi-master network and select the PPI
advanced option.
 If the cable used is a PPI multi-master cable, then so many advanced
options for the main network and PPI can be ignored.
(3) Communication parameter setting
The content of the communication parameter settings includes settings such as S7-200
CPU address, PC software address, and INTERFACE (PORT).
 Figure 3 shows a dialog box for setting communication parameters. Open the
"View" menu, move the cursor to component (C), the submenu appears, click
"Communication (M)" in it, and the communication parameters appear.
 The default value of the local address of the system programmer is 0.
 The selection of the remote address is set according to the address of the
PLC on the actual PC/PPI cable.
 When you need to modify other communication parameters, double-click the
"PC/PPI Cable" icon to reset the communication parameters. The remote
communication address can be obtained by automatic search.

1. Status information of the main menu and subdirectory


(1) File - File operations include creating, opening, closing, saving, saving as, setting
password, importing, exporting, uploading, downloading, creating a new library,
adding/deleting a library, inventory storage area, page setting, printing and
previewing, etc.
(2) Edit - The edit menu provides the undo, cut, copy, paste, select all, insert, delete,
find, replace, and go to subdirectory of the program for program modification
operations.
(3) View - There are 6 functions for viewing the menu:
 it can be used to choose to display different program editors in the program data
display window area, such as Statement table (STL), ladder diagram (LAD) and
function block diagram (FBD);
 You can set the data block and symbol table;
 set the system block configuration, cross-reference and communication
parameters;
 the toolbar area can select the browsing bar, command tree and output window -
Whether it is displayed or not;
 the zoom image item can set the percentage of the program area displayed and
other content;
 The attributes of the program block can be adjusted
(4) PLC - The PLC menu is used to establish related operations when the PLC is
online, such as using software to change the working mode of the PLC, Edit the
program, clear the PLC program and power start reset, display PLC information
and PLC type settings, etc.
(5) Debug - The debugging menu is used for dynamic debugging in online form, with
options such as first scan, multiple scans, and program status. The options
submenu is consistent with the zoom function of the "View" menu.
(6) Tools - The tool menu provides complex instruction wizards (PID, NETR/NETW,
HSC instructions), TD200 setup wizards, and TP070 (touch screen) settings.
 Tools can be added in the customer customization options (submenu).
(7) Window - The window menu can select the display content and display form of
the window area cascade, horizontal, vertical
(8) Help - The help menu can provide all the information of the S7-200 command
system and programming software, and provide online help and online inquiry,
access, download and other functions.

2. Toolbars, browsing bars, and command trees


 STEP7-Micro/WIN provides a two-line shortcut button toolbar, which can also be
customized through the tool’s menu.
(1) Standard Toolbar shortcut buttons - The standard toolbar is shown in Figure
3. The functions of the shortcut buttons are from left to right: open a new project,
open an existing project, save the current project, print, print preview, cut the
selection and copy it to the clipboard, copy the selection to the clipboard, and
Paste the contents of the clipboard to the current location, undo the most recent
input, compile the program block or data block (in the activation window), compile
all (program block, data block and system block), upload the project from PLC to
STEP7-Micro/WIN, from STEP7-Micro/WIN
 Download items from the PLC, sort them in ascending order (the name column of
the symbol table is sorted by A~Z), sort them in descending order (the name
column of the symbol table is sorted by Z~A), and options

Figure 3 standard toolbar

• The instruction toolbar - -toolbar provides programming-related buttons. There


are mainly programming components, shortcut buttons and networks, Network
insertion, deletion, etc. The content of the command toolbar is different for
different program editors. The instruction toolbar of the LAD (ladder diagram)
editor is shown in Figure 4. The functions of the shortcut buttons in the instruction
toolbar are from left to right: insert down the line, insert up the line, insert left the
line, insert right the line, insert the contact, insert the coil, and insert the
command box.

Figure 4 instruction toolbar


• The common toolbar is shown in Figure 5. Its functions are: insert network,
delete network, switch POU comments, switch network comments, switch symbol
information table, bookmark management, etc.

Figure 5 common toolbar


 The debugging toolbar is shown in Figure 6. The functions of the shortcut
buttons are from left to right: set the PLC to operating mode, set the PLC to stop
mode, program status monitoring, pause program status monitoring, chart status,
trend view. Chart, pause the trend view, single read, write all, force PLC data
(status chart, ladder chart editing or function Block diagram editing), unforce the
mandatory PLC data (state diagram, ladder diagram editing or function block
diagram editing), unforced all the mandatory (state diagram, ladder diagram
editing or function block diagram editing), read all the mandatory values (state
diagram ladder diagram editing or function block diagram editing)

Figure 6 debug toolbar


(2) Browse bar
 The browsing bar is set with control buttons to control the characteristics of the
program, including program block display, symbol table, status chart, data block,
system block, cross-reference and communication.
(3) Instruction tree
Provide all project objects and all instructions of the current programmer in a tree
structure. Double-click the instruction character in the instruction tree to automatically
insert the selected ladder diagram instruction at the cursor position in the ladder
diagram display area (in the statement table program, the instruction tree is only used
as a test)
3. Program editor window
• The program editor window contains the local variable table, symbol table, status
chart, data block, cross-reference, program view (ladder diagram, function block
diagram, or statement table) and tab characters of the editor used in the project.
• The tab character is at the bottom of the window, which can be used in the
system
• Click on the symbol to move the program in the programmer display area
between the subroutine, interrupt, and main program.
(1) Cross-reference
 The cross-reference window is used to provide PLC resource information used
by the user program.
 After the program is compiled, click the "Cross-reference" button in the browse
bar to open the "cross-reference" window of the program to understand where
the program uses what symbols and memory assignments.
(2) Data block
The data block allows the initial data assignment of V (variable memory). The operation
form is divided into bytes, words, or double words.
(3) Status chart.
 After downloading the program from the PLC, one or more status charts can be
established for monitoring the value and status of each variable during online
debugging.
 In the PLC operation mode, you can open the "Status chart" window, and
continuously and automatically update the value of the status chart when the
program scan is executed.
 The status diagram is opened for program inspection, but the program cannot be
edited. The editing of the program needs to be carried out with the state diagram
closed.
(4) Symbol table/global variable table
 When programming, in order to increase the readability of the program, the direct
address of the component cannot be used as the operand, but a custom symbol
name with practical meaning can be used as the operand of the programming
element. At this time, you need to use the symbol table to create a custom
symbol name and straight he correspondence between the ground address
numbers.
 The difference between a symbol table and a global variable table is the data
type column. The symbol table is a SIMATIC programming mode with no data
type;
 The global variable table is an IEC programming mode with data type columns.
Using the symbol table or the global variable table, the global symbols in the
three program organization units (POU) can be assigned values, and the symbol
values can be used in any POU (the three program organization units of S7-200
are the main program, subroutine, and interrupt program). The main program,
subroutine, and interrupt program).
(5) Local variable table
• Local variables include all assignments of local variables in POU, and the
address of the variable in the table (temporary storage area) are processed by
the system.
• There are two advantages to using local variables: when creating portable
subroutines, you cannot reference absolute addresses or global symbols.;(2)
When using local variables as temporary variables (local variables are defined as
TEMP type) for calculations, PLC memory can be released.
4. encryption
• All S7-200 CPUs provide password system protection to limit the use of certain
pending CPU functions.
• The restrictions on the access function of the S7-200 CPU are divided into 4
levels, which can be selected according to needs.
(1) How to set the password
 Use STEP7-Micro/WIN to create a password for the CPU. Click "View" →
"Components" → "System Blocks" → “password", the dialog box shown in Figure
7 appears, select the encryption level (that is, permission), then enter the
password and confirm.
 Full permissions (Level 1): All PLC functions can be used without restrictions.
 Partial permissions (Level 2): Read-only permissions. Users can read and write
PLC data, as well as upload programs. Users must have a password to
download programs, force data, or program memory cards.
 Minimum authority (Level 3): Minimum authority. The user can read and write
PLC data. Users must have a password to upload and download programs, force
data, or program memory cards. Uploading is prohibited
 (Level 4): Uploading is not allowed. This level of password protection function
can prevent any program from uploading (even if there is a correct password).
This option also does not allow program execution status monitoring, operation
mode editing, and project comparison. Other PLC functions are in the same
protection state as the third-level password.

Figure 7 password settings


(2) resetting password
If you forget your password, you must clear the program in the CPU memory and load a
new program. When entering the PLC program for upload and download operations, the
"Please enter password" dialog box pops up. After entering clearplc, confirm that the
PLC password is cleared, and the program in the PLC is cleared at the same time.
3. creating project (user program)
(1) Open an existing project file
There are two common ways to open existing project files.
i. Open from the "File" menu, navigate to the existing project and open the file.
ii. Opened by the file name, the file name of the most recent work project is listed under
the "File" menu, which can be selected directly without having to open the dialog box.
In addition, you can also use Windows Explorer to find the appropriate directory, the
project file is in the file with the .mwp extension.
(2) Create a new project (file)
There are 3 ways to create a new project (file).
i. Click the "New" button.
ii. Open the "File" menu and click the "New" button to create a new file.
iii. Click the "Program Block" icon in the browse bar to create a new STEP7-Micro/WIN
project.
(3) Determine the PLC type
- Open a project and select the type of PLC before starting to write the program.
There are two ways to determine the PLC type.
i. Click item 1 (CPU) in the instruction tree, and click "Type (T)" in the pop-up dialog
box. . . ", the "PLC Type" dialog box pops up, after selecting the PLC model used,
click the "OK" button.
ii. Use the PLC menu to select "Type (T)." . . "Item, the "PLC Type" dialog box pops
up, and then select the correct PLC type and click “OK”.
4. the ladder diagram editor
(1) How ladder elements work
- The contact represents the switch through which the current can pass
- the coil represents the relay or output charged by the current
- the command box represents the current to execute the function of the
instruction box when this box is true
(2) Ladder layout rules
- The network must start from the contact and end with a coil or a command box
without an ENO end.
- When the instruction box has an ENO terminal, the current extends beyond the
instruction box, and instructions can be placed behind the instruction box.
- For each user program, a coil or instruction box can only be used once, and
multiple coils are not allowed to be used in series.
(3) Enter instructions (programming elements) in the ladder diagram
i. Enter the Ladder diagram (LAD) editor
ii. Open the "View" menu and click the "Ladder (L)" option to enter the ladder editing
state. The program editing window displays the ladder editing icon.
iii. Input method of programming components
- Programming components include coils, contacts, command boxes, etc.
Programs are generally entered sequentially, that is, from top to bottom, from left
to right, the programming element (input command) is placed where the cursor is
located, and the cursor can also be moved to enter the programming element at
any position.
- The cursor of a programming element automatically moves forward to the next
column; when wrapping a line, click the position of the next line to move the
cursor. As shown in Figure 1-10, the box in the figure is the cursor. The figure is
the beginning of a ladder diagram, "indicating that you can continue to enter
programming components.
- There are several methods for the input of programming components, such as
double-clicking, drag-and-drop, and clicking toolbar buttons or operation
shortcuts in the command tree.
- On the ladder in the graph editor, click the toolbar button or press the F4 key
(contact), F6 key (coil), F9 key (command box), and double-click in the command
tree to select the input programming components.

Figure 8
The toolbar (see Figure 1-6) has 7 programming buttons, the first 4 are connecting
wires, and the last 3 are contacts, coils, and command boxes. The input of the
programming element is first to move the cursor to the position where the element
needs to be placed in the program editing window, and then enter the programming
element. There are two ways to input programming components.
a. enter a programming element, such as an input contact element, move the
cursor to the programming area, and click the "Contact" button in the toolbar
to open the drop-down menu, as shown in Figure 1-11(a). Select the
programming element, press Enter, enter the programming element graphic,
and then click above the programming element symbol. ???, Enter the
address.
b. Use function keys (F4, F6, F9, etc.), shift keys, and Enter keys to place
programming components. For example, to place the output contact, press
the F6 key to pop up the drop-down menu shown in Figure 1-11(b). After
selecting the programming element in the drop-down menu (you can use the
shift key to find the required programming element), press the Enter key, the
programming element appears at the cursor, press the Enter key again, and
the light mark selects the one above the symbol of the element. ??? , After
entering the operand, press enter to confirm, then use the shift key to move
the cursor to the next line and enter a new program. When the input address,
symbol is out of range, or does not match the instruction type, a red wavy
line appears below the value. after a line of program input is over, click the
programming area below the line in the figure, and enter the contacts to
generate a new line.

Figure 9
(4) Operation of the upper and lower wires
Move the cursor to the contact you want to merge and click the up or down line
button.
(5) Input of ladder diagram function instructions
Using the command tree double-click method, you can enter the function
command at the cursor, as shown in Figure

Figure 10 input of function instructions


5. Program editing and parameter setting
The editing of the program includes cutting, copying, pasting, inserting and deleting,
string replacement and lookup of the program.
(1) Insert and delete
The options for program insertion and deletion are rows, columns, vertical and
network(s), interrupts or subroutines, etc. There are two ways to insert and delete.
1) Right-click in the program editing area to pop up the drop-down menu shown in
Figure, click Insert or delete item, and click the Insert or delete option in the pop-
up submenu to edit the program.
2) Use the edit menu to select the insert or delete item. After the submenu pops up,
click the insert or delete option to edit the program.

Figure 11 inserting and deleting


(2) Copy and paste the program
- For copying and pasting the program, you can select copy and paste from the
edit menu. Paste items can also be copied and pasted by the copy and paste
shortcut buttons in the toolbar. You can also right-click after selecting the copied
content with the cursor, select copy in the pop-up shortcut menu, and then paste.
- Program replication is divided into two types: single component replication and
network replication. A single component copy is to click the copy item when the
cursor contains a programming component. Network replication can be done by
dragging the cursor in the replication area or using the SHIFT and up and down
shift keys to select a single or multiple adjacent networks. The network turns
black and is copied after being selected. After the cursor is moved to the paste
place, you can click the paste button that has been valid to paste.
(3) Symbol table
The method of using symbols to assign values to symbols in POU is: Click the symbol
table button in the browse bar to display the symbols in the program window. Enter the
parameters in the number table and establish a symbol table. The symbol table is
shown in Figure 12

Figure 12 symbol table


There are two ways to use the symbol table.
a) Use the symbol name when programming, and fill in the symbol name and the
corresponding direct address in the symbol table.
b) Use the direct address when programming, fill in the symbol name and the
corresponding direct address in the symbol table, and after compilation, the
software directly assigns a value.
After compilation using the above two methods, after the symbol addressing item is
selected from the view menu, the direct address will be converted into the
corresponding symbol name in the symbol table. Select the symbol information table
item from the view menu, and the symbol table appears below the ladder diagram.
The format is shown in Figure 1-15.
Figure 13 ladder diagram with a symbol table
(4) Local variable table
You can drag the split bar to expand the local variable table and overwrite the program
view. At this time, the local variable table can be set. The format of the local variable
table is shown in Figure 1-16. There are 4 definition types of local variables: IN (input),
OUT (output), IN_OUT (input _ output), TEMP (temporary). Local variables of IN and
OUT types, input parameters are provided by calling POU (3 kinds of programs) or
output parameters returned by calling POU.
IN_OUT type, the value is provided as a parameter by the calling POU, and the POU is
returned after modification by the subroutine. TEMP type, a variable temporarily stored
in the local data stack area. Once the POU execution is completed, the data of the
temporary variable will no longer be valid.

Figure 14 local variable table


6. Compilation, upload and download of programs
(1) Compile
After the user program is edited, use the CPU's drop-down menu or the "Compile"
button in the toolbar to compile the program. After compilation, the compilation result is
displayed in the output window under the display, and the wrong network segment can
be clearly pointed out. You can modify the program according to the error prompt, and
then compile again until the compilation is correct.
(2) Download
After the user program is successfully compiled, click the "Download" button in the
standard toolbar or open the "File" menu, select the "Download" item, and the program
download information shown in Figure 15 will pop up. After selecting the downloaded
content such as program blocks, data blocks, and system blocks, press the "Confirm"
button to download the selected content to the PLC's storage.

Figure 15 downloading the program


(3) Load (upload)
The function of uploading instructions is to send unencrypted programs or data in the
PLC up to the programmer (PC). The upload method is to click the "Upload" shortcut
key in the standard toolbar or select the "Upload" item in the "File" menu, and the
"Upload" dialog box pops up. After selecting the uploaded content such as program
blocks, data blocks, and system blocks, you can upload PLC internal programs and
data in the program display window.
7. Program monitoring, operation, debugging and other
(1) Operation of the program
When the PLC working mode switch is in the TERM or RUN position, the operation of
the menu command or shortcut button of STEP7-Micro/WIN can set the software of the
CPU working mode.
(2) Program monitoring
All three program editors can monitor the process of program execution and the status
and data of each component while the PLC is running. Here is a key introduction to the
method of ladder diagram editor monitoring operation.
- Ladder diagram monitoring function: Open the "Debugging" menu and select the
program status. At this time, the internal color of the closed contacts and the
energized coil turns blue (shaded state). In the operating state of the PLC, with
the change of input conditions, timing and counting process, the output
processing stage of each scanning cycle will change the state of each device.
- State refresh, you can dynamically display the current values of each timer and
counter,
- And use shadows to indicate the energized status of the contacts and coils for
online dynamics
- Observe the operation of the program, as shown in Figure 1-18.

Figure 16 real time monitoring


(3) Dynamic debugging
Combined with the dynamic display of the program monitoring operation, analyze the
results of the program operation and the factors affecting the operation of the program,
then exit the program operation and monitoring state, modify and edit the program in the
STOP state, recompile, download and monitor the operation, and so on repeatedly
modify and debug until the correct operation result is obtained.
(4) Programming language selection
The selection method of SIMATIC instruction and IEC 1131-3 instruction is: open the
"Tools" menu, click "Options", and the dialog box shown in Figure will pop up. You can
select the instruction in the dialog box. For example, for the SIMATIC instruction, select
"International" for "Mnemonic set" and "SIMATIC" for "Programming mode", that is,
select the SIMATIC instruction. In addition, the STEP7-Micro/WIN V4.0 SP6
programming software is engineering software with a multi-language interface.
Figure 17
(5) Other functions
STEP7-Micro/WIN programming software is provided with
The wizard functions of PID (closed-loop control), HSC (high-speed counting),
NETR/NETW (network communication) and man-machine interface TD (text display).
The instruction wizard options under the tool menu can quickly and easily set complex
options for PID, NETR/NEIW, and HSC instructions. After the options are completed,
the instruction wizard will generate program code for the selected settings. The text of
the tool menu displays the wizard option, which is the TD setup wizard, which is used to
help set up TD information. As shown in the dialog box shown in Figure 18, different
types of text displays such as TD200, TD200C or TD400C can be selected in this
interface. After the setup is complete, the wizard will generate a data block code that
supports TD.

Figure 18 text display wizard

You might also like