3. Instructions
1012
CS/CJ/NSJ Series Instructions Reference Manual (W474)
z Operand Specifications
Flags
Function
HMS(066) converts the 8-digit BCD seconds-only data in S and S+1
to 8-digit BCD hours/minutes/seconds data and outputs the result to
D and D+1.
The maximum value for the source data is 35,999,999 seconds
(9,999 hours, 59 minutes, and 59 seconds).
Example Programming
When CIO 0.00 turns ON in the following example, the seconds data in D100 and D101 (123,456
seconds) is converted to hours/minutes/seconds data and the result is output to D200 and D201.
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
S
OK OK OK OK OK OK OK OK OK OK
OK
--- --- OK --- --- --- ---
D ---
Name Label Operation
Error Flag ER • ON if the seconds data in S and S+1 is not BCD and in the range 0 to 35,999,999.
• OFF in all other cases.
Equal Flag = • ON if the content of D is 0000 after the operation.
• OFF in all other cases.
Seconds
Hours
Minutes Seconds
123,456 seconds
Hours/minutes/secondsSeconds
17 minutes, 36 seconds
34 hours
→
0.00
D100
D200
D200
D201
D:
D100
D101
S: