Data Control Instructions - Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual

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

Advertisement

Data Control Instructions

Digit Designator
Flags
7-18 Data Control Instructions
7-18-1 SCALING – SCL(66)
SCL(66)
S
P1
R
Limitations
Description
The following show examples of the data movements for various values of Di.
Di: 0010
S
0
1
2
3
Di: 0031
S
0
1
2
3
ER:
At least one of the rightmost three digits of Di is not between 0 and 3.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
Ladder Symbols
@SCL(66)
S
P1
R
This instruction is available in the CPM2A/CPM2C/SRM1(-V2) only.
S must be BCD.
P1 through P1+3 must be in the same data area.
DM 6144 to DM 6655 cannot be used for P1 through P1+3 or R.
SCL(66) is used to linearly convert a 4-digit hexadecimal value to a 4-digit BCD
value. Unlike BCD(24), which converts a 4-digit hexadecimal value to its 4-digit
BCD equivalent (S
cording to a specified linear relationship. The conversion line is defined by two
points specified in the parameter words P1 to P1+3.
When the execution condition is OFF, SCL(66) is not executed. When the execu-
tion condition is ON, SCL(66) converts the 4-digit hexadecimal value in S to the
4-digit BCD value on the line defined by points (P1, P1+1) and (P1+2, P1+3) and
places the results in R. The results is rounded off to the nearest integer. If the
results is less than 0000, then 0000 is written to R, and if the result is greater than
9999, then 9999 is written to R.
D
0
1
2
3
D
0
1
2
3
IR, SR, AR, DM, HR, TC, LR, #
IR, SR, AR, DM, HR, TC, LR
S
), SCL(66) can convert the hexadecimal value ac-
hex
BCD
Section
Di: 0030
S
D
0
0
1
1
2
2
3
3
Di: 0023
S
D
0
0
1
1
2
2
3
3
Operand Data Areas
S: Source word
P1: First parameter word
R: Result word
IR, SR, AR, DM, HR, LR
7-18
421

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents