A UTOMATION T ECHNICAL
S ERVICES
APPLICATION N N N O O O T TE T E ES S S
Topic: Run Time Meter
PREFACE
Application notes are intended to explain the use and/or configuration of subtle or complex functionality related to the Siemens Energy and Automation products manufactured in Johnson City, TN.
Typical functions described in application notes are either not covered, or are only superficially covered in currently available end user documentation.
The information in this document has been carefully checked and is believed to be entirely reliable.
However, no responsibility is assumed for inaccuracies. Furthermore, Siemens Energy and Automation, Inc. reserves the right to make changes to any products herein to improve reliability, function, or design.
Siemens Energy and Automation does not assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights or the rights of others.
Further information is available from the SE&A System Product Support Group in Johnson City (423-461-2522).
PCS and APT are registered trademarks of Siemens Energy & Automation, Inc. All other trademarks are the property of their respective owners.
CONTENTS
RUN-TIME METER 1
Range of Values 0 to 32767 hours. 1
SFC2 (SET_RTM) 1
SFC3 (CTRL_RTM) 2
SFC4 (READ_RTM) 2
Address 3
Name 3
Type 3
Initial Value 3
Comment 3
Block: OB1 4
Address 5
Name 5
Type 5
Initial Value 5
Comments 5
Run-Time Meter
The CPUs have a number of run-time meters (refer to the technical data of the CPUs). Using SFCs 2,3 and 4 you can set, start and read run-time meters.
Application
You can use the run-time meters for a variety of applications:
• Run rime of the CPU
Run rime of addressed resources Characteristics
When it is started, the run-time meter begins to count starting at the last recorded value. If you want it to start at a different initial value, you must set this value with SFC2. If the CPU changes to STOP mode, or you stop the run-time meter, the CPU records the current value of the run-time meter. When the CPU is started again, the run-time meter must be started again with SFC3.
Range of Values 0 to 32767 hours.
SFC2 (SET_RTM)
Description
with SFC2 “SET_RTM” (set run-time meter), you set a run-time meter of the CPU to a preset value. The number of rum- time meters you can set depends on the particular CPU you are using.
Parameters
Parameter Declaration Data Type Memory Area Description
NR INPUT BYTE I,Q,M,D,L,
constant
Specifies the number of the run-time meter (possible values: 0 to 7)
PV INPUT INT I,Q,M,D,L,
constant
Setting for the run-time meter (default)
RET_VAL OUTPUT INT I,Q,M,D,L, Return value of the SFC
Error Information
Error Code Explanation W#16#…
0000 No error
8080 Wrong number for the rum-time meter
8081 A negative value was transferred to the PV parameter
SFC3 (CTRL_RTM)
Description
With SFC3 “CTRL_RTM” (control run-time meter), you can start or stop a run-time meter of the CPU.
Parameters
Parameter Declaration Data Type Memory Area Description
NR INPUT BYTE I,Q,M,D,L,
constant
Specifies the number of the run-time meter (possible values: 0 to 7)
S INPUT BOOL I,Q,M,D,L,
constant
Signal to start or stop the run-time meter:
“0”:stop
“1”:start
RET_VAL OUTPUT INT I,Q,M,D,L, Return value of the SFC
Error Information
Error Code Explanation W#16#…
0000 No error
8080 Wrong number for the rum-time meter
SFC4 (READ_RTM)
Parameters
Parameter Declaration Data Type Memory Area Description
NR INPUT BYTE I,Q,M,D,L,
constant
Specifies the number of the run-time meter (possible values: 0 to 7)
RET_VAL OUTPUT INT I,Q,M,D,L, Return value of the SFC
CQ OUTPUT BOOL I,Q,M,D,L, Status of the run-time meter:
“0”:stopped
“1”:started
CV OUTPUT INT I,Q,M,D,L, Current value of the run-time meter
Error Information
Error Code Explanation W#16#…
0000 No error
8080 Wrong number for the rum-time meter 8081 Overflow of the run-time meter
OB1 - <Offline>
Name: Family:
Author: Version: 00.01
Time stamp Code: DT#1998-01-02-16:26:28:000 Interface: DT#1998-01-02-15:43:13:030 Length (Block / Mc7 Code / Data): 000238 00118 00024
Address Decl. Name Type Initial Value Comment
0.0 Temp OB1_EV_CLASS BYTE Bits 0-3 = 1 (Coning event), Bits 4-7 = 1
Event class 1)
1.0 Temp OB1_SCAN_1 BYTE 1 (Cold restart scan 1 of OB 1), 3 (Scan 2-n
of OB 1)
2.0 Temp OB1_PRIORITY BYTE 1 (Priority of 1 is lowest)
3.0 Temp OB1_OB_NUMBR BYTE 1 (Organization block 1, OB1)
4.0 Temp OB1_RESERVED_1 BYTE Reserved for system
5.0 Temp OB1_RESERVED_2 BYTE Reserved for system
6.0 Temp OB1_PREV_CYCLE INT Cycle time of previous OB1 scan
(milliseconds)
8.0 Temp OB1_MIN_CYCLE INT Minimum cycle time of OB1 (milliseconds)
10.0 Temp OB1_MAX_CYCLE INT Maximum cycle time of OB1 (milliseconds)
12.0 Temp OB1_DATE_TIME DATE Date and time OB1 started
Block: OB1
Network: 1
M0.0 = Must be toggles to move the PV of “ set_rtm into “read_rtm” of the CV if it is not toggled it is moves the number constantly.
MB10 = Loads a zero because due to a possibility of 8 groups. It associates SFC2 with SFC3 with SFC4. (“0-7”) for 400 CPUs only 1 for 300 CPUs.
M0.0 “SET_RTM”
EN ENO
MB10 - NR RET_VAL –MW2
0 - PV
Symbol Information
SFC2 SET_RTM Set Run-Time Meter
Network: 2
M0.1 = has to be set to start “READ_RTM” function and when it is not set “READ_RTM” stops timing
“CTRL_RTM”
EN ENO
MB10 - NR RET_VAL –MW4
M0.1 S
Symbol Information
SFC3 CTRL_RTM Start/Stop Run-Time Meter
Network: 3
CV is the Location for the Hour Time Value
CQ is the status of the run time meter. “0” :stop, “1” :started
` “READ_RTM”
EN ENO
MB10 - NR RET_VAL –MW6
CQ –M0.3 CV –MW8 Symbol Information
SFC4 READ_RTM Read Run-Time Meter
Name: Family:
Author: Version: 00.01
Time stamp Code: DT#1998-01-02-09:56:37:000 Interface: DT#1998-10-23-13:05:30:030 Length (Block / Mc7 Code / Data): 000360 00224 00022
Address Decl. Name Type Initial Value Comments
0.0 temp TEMP0 BYTE
1.0 temp TEMP BYTE
2.0 temp TEMP2 BYTE
3.0 temp TEMP3 BYTE
4.0 temp TEMP4 BYTE
5.0 temp TEMP5 BYTE
6.0 temp TEMP6 INT
8.0 temp TEMP7 INT
10.0 temp TEMP8 INT
12.0 temp TEMP9 DATE_AND_TIME
Block: OB1
Network: 8 real time meter
M0.0 “SET_RTM”
EN ENO
MB2 - NR RET_VAL –MW6
MW4 - PV
Network: 9
M0.1 “CTRL_RTM”
EN ENO
MB2 - NR RET_VAL –MW8
M0.2 S
Network: 10
“READ_RTM”
EN ENO
MB2 - NR RET_VAL –MW10
CQ –M0.4 CV –MW12
Address Symbol Monitor Format Monitor Value Modify Value
M 0.0 --- BIN 2#1 2#1
M 0.1 --- BIN 2#1 2#1
M 0.2 --- BIN 2#1 2#1
M 0.3 --- BIN 2#1 2#1
M 0.4 --- BIN 2#1
MB 2 --- HEX B#16#00 B#16#00
MW 4 --- HEX W#16#0012 W#16#0012
MW 12 --- HEX W#16#0012