×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ, Entry ID: 109745539, Entry date: 04/11/2017
(1)
Rate

How do you evaluate the status of system blocks in STEP 7 (TIA Portal)?

  • Entry
  • Associated product(s)
Save the error information and block status from the "STATUS" parameter in a data block and use the information from the manual for diagnostics.

Description
Depending on the application, the information at the "STATUS" parameter is only available for the duration of one cycle. Since the CPUs work in the millisecond range, the information cannot always be noticed by the user. The "DONE" parameter indicates that the data record for this system block has been transferred, but the last block "STATUS" has already been overwritten.

There are multiple options for evaluating the block status.

Option 1: Evaluation with MOVE
Using the "MOVE" instruction you can temporarily store the information at the "STATUS" parameter in a data block, for example. In this way, this information is still available even after the cycle.

Fig. 1 shows an example of the status evaluation for the "WRREC" instruction (write data record). The data from the "DB.wrrecStatus" tag is transferred to the "DB.error" tag if the "DB.wrrecError" tag has the True signal.
 


Fig. 1

You can also program the status evaluation shown in Fig. 1 in the programming languages STL, FBD and SCL.

Option 2: Evaluation with the "SaveStatus" FB
The library attached to this entry includes the "SaveStatus" FB which you can use to store the status values one after the other in a data block. This means that the status values remain available until they are deleted by a reset. Parameterize the "status" output parameter with a tag of the data type "Array[1..10] of DWord". You can also extend this sample program with other array elements. The status values read are then stored one after the other in the array elements.

  • Before reading the status values you have to reset the array elements to zero with the "reset" parameter.
  • A value can only be stored in an array element when the value of the array element is zero.
  • For each new status value a query is run in the "SaveStatus" FB to determine the next available free array element.
  • If an array element is already occupied with a value (apart from zero), the new value is entered in the next array element.
  • If all the array elements are occupied by a value, the last array element is overwritten with each additional status value.
  • To be able to store new values in the other array elements you have to do a reset.

The "SaveStatus" FB has been created in the SCL programming language and includes German and English comments. The table below describes the block parameters.
 

ParameterData type

Description

Input parameter
resetBoolTag reset
readStatusDWordReading in of the status values
Output parameter
statusArray[1..10] of DWordStatus values stored one after the other

Evaluation of the status information

  • Via the Online Help:
    Select the system block and press the "F1" key. The STEP 7 (TIA Portal) Online Help gives you detailed information about the instruction and the "STATUS" parameter.
  • Via the manual:
    Further status information is available in the manual of STEP 7 (TIA Portal) under Parameter STATUS (S7-1200, S7-1500).

Download
The download includes the STEP 7 (TIA Portal) library with the block described above for the S7-1200 and for the S7-1500. Unpack one of the two Zip files for your version of STEP 7 (TIA Portal) in a separate directory on your hard disk. Then you can open and edit the library with STEP 7 (TIA Portal).

You can only open and edit the library in STEP 7 (TIA Portal). Further information about opening libraries is available in Entry ID: 37364723.

Creation Environment
The screen and download in this FAQ response were created with STEP 7 (TIA Portal) V14.

Security information
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.