Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 471

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

Conversion Instructions
Flags
Example
00000
7-20-10 HOURS-TO-SECONDS – SEC(––)
Limitations
Description
Flags
ER:
Incorrect digit designator, or data area for destination exceeded.
The source words do not contain ASCII data that can be converted to
hexadecimal, i.e., values ranging from 0 to 9 or A to F.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
In the following example, the 2
verted to hexadecimal values and those values are written to the first and se-
cond bytes of IR 200.
@HEX(––)
LR 10
HR 10
200
HR 10
0 1 1 0
LR 12
3 5 3 4
Ladder Symbols
SEC(––)
@SEC(––)
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 in the proper hours/min-
utes/seconds format.
DM 6144 to DM 6655 cannot be used for R.
SEC(––) is used to convert time notation in hours/minutes/seconds to an equiv-
alent in just seconds.
For the source data, the seconds are designated in bits 00 through 07 and the
minutes are designated in bits 08 through 15 of S. The hours are designated in
S+1. The maximum is thus 9,999 hours, 59 minutes, and 59 seconds.
The result is output to R and R+1. The maximum obtainable value is 35,999,999
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.
nd
byte of LR 10 and the 1
Address Instruction
00000
LD
00001
@HEX(––)
LR 11
4 2 3 2
LR 10
200
0 0 2 1
S: Beginning source word (BCD)
IR, SR, AR, DM, HR, TC, LR
S
R: Beginning result word (BCD)
R
IR, SR, AR, DM, HR, TC, LR
000
Section
7-20
st
byte of LR 11 are con-
Operands
00000
LR
10
HR
10
200
3 1 3 0
Conversion to
hexadecimal
Operand Data Areas
000: No function
000
453

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents