350
5-26-2 SECONDS TO HOURS: HMS(144)
(144)
HMS S R
R: 1
st
result word CIO, G, A, DM
S: 1
st
source word CIO, G, A, T, C, #, DM
Operand Data AreasLadder Symbol
Variations
j HMS(144)
Description When the execution condition is OFF, HMS(144) is not executed. When the ex-
ecution condition is ON, HMS(144) converts time notation in seconds to an
equivalent time in hours/minutes/seconds.
The number of seconds designated in S and S+1 is converted to hours/minutes/
seconds and placed in R and R+1.
For the results, the seconds are placed in bits 00 through 07 and the minutes are
placed in bits 08 through 15 of R. The hours are placed in R+1. The maximum will
be 9,999 hours, 59 minutes, and 59 seconds.
Precautions S+1 and S must be BCD and less than or equal to 3599 9999.
Note Refer to page 115 for general precautions on operand data areas.
Flags ER (A50003): S and/or S+1 do not contain BCD or exceed 35,999,999 s.
Content of *DM word is not BCD when set for BCD.
EQ (A50006): ON when the result is 0.
Example When CIO 000000 is OFF in the following example, the following instruction
would convert the seconds given in D00000 and D00001 to hours, minutes, and
seconds and store the results in D00100 and D00101 as shown.
(144)
HMS D00000 D00100
D00000 5 9 2 7
D00001 1 0 1 3
D00100 3 2 0 7
D00101 2 8 1 5
10,135,927 s
2,815 hrs, 32 min, 07 s
00000 LD NOT 000000
00001 HMS(144)
D00000
D00100
0000
00
Address Instruction Operands
5-26-3 CALENDAR ADD: CADD(145)
Variations
j CADD(145)
(145)
CADD C T R
T: 1
st
time word CIO, G, A, T, C, #, DM
R: 1
st
result word CIO, G, A, DM
C: 1
st
calendar word CIO, G, A, T, C, DM
Operand Data AreasLadder Symbol
Description When the execution condition is OFF, CADD(145) is not executed. When the ex-
ecution condition is ON, CADD(145) adds the time in words T and T+1 to the
calendar data in words C, C+1, and C+2, and outputs the result to words R, R+1,
and R+2.
CADD(145) (and the Calendar/Clock Area (G001 to G004)) corrects for leap
year.
Time Instructions Section 5-26