Why aren't any values returned when using the internal run-time
meter of an S7-300 CPU?
- If a run-time meter with an identifier greater than
"B#16#0" is specified when parameterizing the system
functions SFC2, SFC3 and SFC4 for the CPUs 312IFM to 316-2DP, then
an error occurs and the desired function is not available. In this
case, the identifier "8080h" is output at the "RETVAL" output of
There is only one run-time meter available for these CPUs.
Therefore you should only use the identifier "B#16#0".
- The system function SFC2 "SET_RTM" must not be called in
a cyclic block (OB1, OB35), but only in a restart (OB100). You can
also start the block via an external trigger. Otherwise the block
would always reset the run-time meter and counting would never be
A run-time meter counts the time that a connected device is
switched on or the operating time of the CPU as a sum of the
In the "STOP" mode of the CPU the run-time meter is stopped. Its
value is retained even after an overall reset. After a restart
(warm start) the run-time meter has to be started again by the user
program. Once restarted it automatically counts on if it has been
started previously. Using the system function SFC2 "SET_RTM" you
can set the run-time meter to a start value. You can start or stop
the run-time meter using the system function SFC3 "CTRL_RTM". You
can use the system function SFC4 "READ_RTM" to read out the current
number of operating hours and the state of the run-time meter
("stopped" or "counting").
The S7 318 CPU and all S7 400 CPUs have 8 run-time meters.
Numbering starts at 0.
Operating time, Timing, Timer