Extended instructions
9.1 Date, time-of-day, and clock functions
S7-1200 Programmable controller
344 System Manual, V4.2, 09/2016, A5E02486680-AK
Table 9- 13 RTM instruction
MODE:=_byte_in_,
PV:=_dint_in_,
CQ=>_bool_out_,
CV=>_dint_out_);
The RTM (Runtime Meters) instruction can set, start, stop, and
read the runtime hour meters in the CPU.
Table 9- 14 Data types for the parameters
Runtime 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)
Preset hours value for the specified runtime meter
Function result / error message
Runtime meter status (1 = running)
Current runtime hours value for the specified meter
The CPU operates up to 10 runtime hour meters to track the runtime hours of critical control
subsystems. You must start the individual hour meters with one RTM execution for each
timer. All runtime 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 runtime 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
runtime meter values in retentive memory. Upon CPU power-up, the stored runtime meter
values are reloaded to the timers and the previous runtime hour totals are not lost. The
runtime meters must be restarted to accumulate additional runtime.