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

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

Advertisement

Data Control Instructions
Description
Flags
SCL3(––) is used to linearly convert a 4-digit 4-digit BCD value to 4-digit signed
hexadecimal. SCL3(––) converts the BCD value according to a specified linear
relationship. The conversion line is defined by the y-intercept and the slope of
the line specified in the parameter words P1 to P1+2.
When the execution condition is OFF, SCL3(––) is not executed. When the
execution condition is ON, SCL3(––) converts the 4-digit BCD value in S to the
4-digit signed hexadecimal value on the line defined by the y-intercept (0, P1)
and the slope (P1+2 P1+1) and places the result in R. The result is rounded off
to the nearest integer.
The content of S can be 0000 to 9999, but S will be treated as a negative value if
CY=1, so the effective range of S is actually –9999 to 9999. Be sure to set the
desired sign in CY using STC(40) or CLC(41).
Parameter words P1+3 and P1+4 define upper and lower limits for the result. If
the result is greater than the upper limit in P1+3, then the upper limit is written to
R. If the result is less than the lower limit in P1+4, then the lower limit is written to
R.
Note The upper and lower limits for a 12-bit Analog Input Unit would be 07FF and
F800.
The following table shows the functions and ranges of the parameter words:
Parameter
P1
x-intercept (signed hex.)
P1+1
X (BCD)
P1+2
Y (signed hex.)
P1+3
Upper limit (signed hex.)
P1+4
Lower limit (signed hex.)
The following diagram shows the source word, S, converted to R according to
the line defined by the point (0, P1) and slope Y/ X.
Value after conversion
(Signed hexadecimal)
Upper limit
Y-intercept
Lower limit
The result can be calculated by first converting all BCD values to signed binary
and then using the following formula.
ER:
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
The content of S is not BCD.
CY:
CY is not changed by SCL3(––). (CY shows the sign of S before execu-
tion.)
EQ:
ON when the result, R, is 0000.
Function
8000 to 7FFF (–32,768 to 32,767)
0001 to 9999
8000 to 7FFF (–32,768 to 32,767)
8000 to 7FFF (–32,768 to 32,767)
8000 to 7FFF (–32,768 to 32,767)
X
R
S
R + DY
S ) P1
DX
Section
Range
Y
Value before conversion
(BCD)
7-18
425

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents