Technical data

Table Of Contents
SFCs for Handling Run-Time Meters
System Software for S7-300/400 System and Standard Functions - Volume 1/2
6-2
A5E00709327-01
6.2 Handling Runtime meters with SFC 101 "RTM"
Description
Call SFC 101 "RTM" (runtime meter) to set, start, stop and read a 32-bit runtime
meter of your CPU.
To fetch the values of all 32-bit runtime meters of your CPU, call SFC 51
"RDSYSST" with SZL_ID=W#16#0132 and INDEX=W#16#000B (for runtime
meters 0 … 7) or INDEX=W#16#000C (for runtime meters 8 … 15). (See also Data
Record of the Partial List Extract with SSL-ID W#16#0132 Index W#16#000B.
Parameter Declaration Data type Memory area Description
NR INPUT BYTE I, Q, M, D, L,
constant
Number of the runtime meter (possible
values: 0 … 15)
MODE INPUT BYTE I, Q, M, D, L,
constant
Job ID:
0: fetch (the status is then written to
CQ and the current value to CV).
After the runtime meter has reached
(2E31) -1 hours, it stops at the
highest value that can be displayed
and outputs an "Overflow" error
message.
1: start (at the last counter value)
2: stop
4: set (to the value specified in PV)
5: set (to the value specified in PV)
and then start
6: set (to the value specified in PV)
and then stop
PV INPUT DINT I, Q, M, D, L,
constant
New value for the runtime meter
RET_VAL OUTPUT INT I, Q, M, D, L The return value will contain an error
code if an error occurs while the function
is being processed.
CQ OUTPUT BOOL I, Q, M, D, L Status of the runtime meter (1: running)
CV OUTPUT DINT I, Q, M, D, L Current value of the runtime meter
Compatibility to programs developed for a CPU with 16-bit runtime meters
You can also operate your 32-bit runtime meters with the SFCs 2 "SET_RTM", 3
"CTRL_RTM" and 4 "READ_RTM". In this case however, the 32-bit runtime meters
operate in the same way as 16-bit meters (Range of values: 0 to 32767 hours).
The partial list extract with SSL ID W#16#0132 and index W#16#0008 displays the
32-bit runtime meters 0 to 7 in 16-bit mode. This means that you can continue to
use programs developed for a CPU with 16-bit runtime meters that use partial list
extract with SSL ID W#16#0132 and index W#16#0008.