How to read the S7-1500 CPU running time

Read S7-1500 CPU running time There are many ways, are described below in several ways.

1 reads out the running time by the startup parameters OB1 OB1 start in non-optimized run-time information with the OB1

The startup information passed to the global variable parameters can be read out of the CPU the last scan, minimum, maximum scan time, programming is very convenient.

2 Call RD_SINFO function reads the running time
If you are using an optimized OB1, simplified startup information without running the information shown in Figure 2, you must call the function reads

For example in OB1 RD_SINFO function reads the run time, the program shown in Figure 3. TOP_SI parameters for the current OB1 start information,
Data type SI_classic, need to manually type, ZI1 for the last scan time, ZI2_3 contains the minimum, maximum scan time, low-word minimum scan time,
The high word is the maximum scan time, the examples are transferred to MW10 and MW12. START_UP_SI start to warm start information of the OB,
Example, no reference.

3 Call RT_INFO function reads the running time
By function RT_INFO to be read out of the CPU running time

1,2,3 pattern can be read out by the CPU last scan, minimum, maximum scan time, in these three modes, the data type of the parameter INFO LTIME, can be read directly. You can also read out the percentage of uptime through other modes.

4 Call RUNTIME instruction read operation time
RUNTIME can be read out by CPU instructions directly from the parameter RET_Val running time, in seconds, MEM to save the program to run intermediate memory, two parameters are the type LREAL, in addition you can also read out a program run time

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *