101BExtended instructions
8.1 Date and time-of-day
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
237
8.1.3
Run-time meter instruction
Table 8- 12 RTM instruction
LAD / FBD
SCL
Description
RTM(NR:=_uint_in_,
MODE:=_byte_in_,
PV:=_dint_in_,
CQ=>_bool_out_,
CV=>_dint_out_);
The RTM (Run Time Meter) instruction can set, start, stop, and read the
run-time hour meters in the CPU.
Table 8- 13 Data types for the parameters
Parameter and type
Data type
Description
NR
IN
UInt
Run-time meter number: (possible values: 0..9)
MODE
IN
Byte
RTM Execution mode number:
0 = Fetch values (the status is then written to CQ and the
current value to CV)
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
7 = Save all RTM values in the CPU to the MC (Memory
Card)
PV
IN
DInt
Preset hours value for the specified run-time meter
RET_VAL
OUT
Int
Function result / error message
CQ
OUT
Bool
Run-time meter status (1 = running)
CV
OUT
DInt
Current run-time hours value for the specified meter
The CPU operates up to 10 run-time hour meters to track the run-time hours of critical
control subsystems. You must start the individual hour meters with one RTM execution for
each timer. All run-time hour meters are stopped when the CPU makes a run-to-stop
transition. You can also stop individual timers with RTM execution mode 2.
When a CPU makes a stop-to-run transition, you must restart the hour timers with one RTM
execution for each timer that is started. After a run-time meter value is greater than
2147483647 hours, counting stops and the "Overflow" error is sent. You must execute the
RTM instruction once for each timer to reset or modify the timer.
A CPU power failure or power cycle causes a power-down process that saves the current
run-time meter values in retentive memory. Upon CPU power-up, the stored run-time meter
values are reloaded to the timers and the previous run-time hour totals are not lost. The run-
time meters must be restarted to accumulate additional run-time.