Subtracting clock data
TSUB(P)
These instructions subtract the time data stored in the device numbers starting from (s2) from the clock data stored in the
device numbers starting from (s1), and store the result to the device numbers starting from (d).
Ladder diagram
(s1)
FBD/LD
EN
ENO
s1
d
s2
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s1)
Head device number where the clock data that is subtracted is stored
(s2)
Head device number where the subtracting time value (or clock data
value) is stored
(d)
Head device number where the resultant clock data (or time value) is
stored
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s1)
(s2)
(d)
Processing details
• These instructions subtract the time data stored in the device numbers starting from (s2) from the clock data stored in the
device numbers starting from (s1), and store the result to the device numbers starting from (d).
(s1)
hour
(0 to 23)
(s1)+1
minute
(0 to 59)
(s1)+2
second
(0 to 59)
8 APPLICATION INSTRUCTION
692
8.24 Clock Instruction
(s2)
(d)
Word
T, ST, C, D, W,
SD, SW, R
(s2)
hour
(s2)+1
minute
-
(s2)+2
second
Structured text
ENO:=TSUB(EN, s1, s2,d);
ENO:=TSUBP(EN, s1, s2,d);
Range
Double word Indirect
U\G
Z
LC
(0 to 23)
(d)
(0 to 59)
(d)+1
(0 to 59)
(d)+2
Data type
16-bit signed binary
16-bit signed binary
16-bit signed binary
Bit
Bit
Constant
specification
LZ
K, H
hour
(0 to 23)
minute
(0 to 59)
second
(0 to 59)
Data type (label)
ANY16_ARRAY
(Number of elements: 3)
ANY16_ARRAY
(Number of elements: 3)
ANY16_ARRAY
(Number of elements: 3)
BOOL
BOOL
Others
E
$