Conversion Instructions
Example
00000
HR 12
3
HR 13
2
DM 0100
5
DM 0101
1
7-20-11 SECONDS-TO-HOURS – HMS(––)
Limitations
Description
Flags
454
Number of seconds and/or minutes exceeds 59.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is zero.
When 00000 is OFF (i.e., when the execution condition is ON), the following
instruction would convert the hours, minutes, and seconds given in HR 12 and
HR 13 to seconds and store the results in DM 0100 and DM 0101 as shown.
2
0
7
2,815 hrs, 32 min,
07 s
8
1
5
9
2
7
10,135,927 s
0
1
3
Ladder Symbols
HMS(––)
S
R
000
This instruction is available in the CPM2A/CPM2C only.
S and S+1 must be within the same data area. R and R+1 must be within the
same data area. S and S+1 must be BCD and must be between 0 and
35,999,999 seconds.
DM 6144 to DM 6655 cannot be used for R.
HMS(––) is used to convert time notation in seconds to an equivalent 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 is
9,999 hours, 59 minutes, and 59 seconds.
ER:
S and S+1 or R and R+1 are not in the same data area.
S and/or S+1 do not contain BCD or exceed 36,000,000 seconds.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is zero.
Address Instruction
SEC(––)
00000
HR 12
00001
DM 0100
000
@HMS(––)
S
R
000
Section
Operands
LD NOT
00000
SEC(––)
HR
DM
Operand Data Areas
S: Beginning source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: Beginning result word (BCD)
IR, SR, AR, DM, HR, TC, LR
000: No function
000
7-20
12
0100
000
Need help?
Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?