15.5 Testing the user program
15.5.3 Testing with program status
The program status shows the program execution during runtime. You can monitor the current signal status of the binary tags and the current values of digital tags.
Caution! Functional disturbances may occur as a result of program modifications when testing the user program during ongoing operation on the process. Make sure with each testing step that no serious damage to property or injury to persons can occur!
You can execute the program status in process mode (small influencing of cycle time) or in test mode (no limitation in test functions).
Switching the program status on and off
To switch on the program status, open the block to be monitored, move on to the program position you wish to test, and click on the Monitoring on/off icon in the tool- bar of the working window.
If an online connection to the CPU has not yet been established, STEP 7 searches for accessible devices. If necessary, set the LAN adapter used in the programming de- vice in the dialog window Go online, select the PLC station found, and click on the Go online button.
To switch off the program status, click again on the Monitoring on/off icon in the toolbar. You will be asked whether the online connection which was created when switching on the program status is to be canceled. If you click on the No button, the program status will be exited but the online connection remains established.
Display format with digital tags
The display format of digital tags is set as standard to Automatic, but you can change it by selecting the digital tag and then Modify > Display format > … from the shortcut menu. … > Decimal, … > Hexadecimal, and … > Floating-point are possible.
In the case of LAD and FBD you set the display format for the complete network if you click with the right mouse button on a free space in the network and then select Modify > Display format for network > … from the shortcut menu.
Controlling operands in the program status
In the program status you can use the programming device to define the signal states of binary tags and the values of digital tags. This is usually only meaningful if these tags cannot be controlled from another position, for example as is the case with inputs which receive their signal state from the peripheral input channel during the automatic updating of the process image.
Select the tag and then the Modify > Modify to 0 command from the shortcut menu if the binary tag is to be set to signal state “0” or Modify > Modify to 1 if the binary tag is to be set to signal state “1”. In the case of digital tags, select the Modify > Mod- ify operand… command from the shortcut menu and specify the desired value.
Block calls in the program status (LAD, FBD)
If the tested network contains a block call, the call box is represented by green con- tinuous lines if the EN input is “1”. The box has blue dashed lines if the EN input is “0”.
You can move on to the called block and continue the program status there: Select the block call and then the Open and monitor command from the shortcut menu.
The program status then changes to the called block.
Program status in LAD representation
In the LAD program status, green continuous lines are used to identify contacts, coils, and the connections between the program elements which have signal state “1”. Program elements with signal state “0” are identified by blue dashed lines (Fig. 15.7).
Program elements with unknown status or those which are not processed are iden- tified by continuous gray lines. Tags shown in black mean that the displayed value is from the current monitoring cycle, those in gray display a value from a previous- ly processed cycle.
You can determine at which position the program status is to be executed: Select the program element or tag and then the Modify > Monitor from here command from the shortcut menu. The Modify > Monitor selection command from the short- cut menu means that only the selected program element is monitored.
Program status in FBD representation
In the FBD program status, green continuous lines are used to identify the boxes of the binary program elements and the connections if they have signal state “1” and blue dashed lines if they have signal state “0” (Fig. 15.8). In addition to the colored identification, the signal status (TRUE or FALSE) is displayed for the binary inputs.
Program elements with unknown status or those which are not processed are iden- tified by continuous gray lines. Tags shown in black mean that the displayed value is from the current monitoring cycle, those in gray display a value from a previous- ly processed cycle.
You can determine at which position the program status is to be executed: Select the program element or tag and then the Modify > Monitor from here command from the shortcut menu. The Modify > Monitor selection command from the short- cut menu means that only the selected program element is monitored.
Fig. 15.7 Program status in LAD representation
Program status in STL representation
The program status is shown in tabular form next to the statements so that the tag value can be read for each statement line. The RLO column shows the result of logic operation: “0” has a purple background and “1” has a green background. The Value column shows the current status or the current value of the operand. The Extra col- umn shows additional information, for example the assignment of the overflow bits with arithmetic operations (Fig. 15.9).
You can use the Absolute/symbolic operands icon to select the displayed type of addressing.
Fig. 15.8 Program status in FBD representation
Fig. 15.9 Program status in STL representation
Program status in SCL representation
The program status is shown in tabular form next to the statements. The line in the table contains the name and value of the (first) tag in the statement line. If the state- ment line contains several tags, a table with all tags is displayed when you position the cursor in the statement line.
If the line contains one of the IF, WHILE, or REPEAT statements, the result of the con- dition (TRUE, FALSE) is shown in the line.
You can use the Absolute/symbolic operands icon to select the displayed type of addressing. If the tag name is shown in gray, the corresponding program is not pro- cessed.
If no value can be shown for a tag or event, the table contains three question marks on a yellow background in the Value column. In this case, activate the Create extend- ed status information attribute in the block properties and load the block again into the CPU (Fig. 15.10).