Omron CS1G/H-CPUxxH Instructions Manual page 727

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxxH:
Table of Contents

Advertisement

Data Control Instructions
Flags
Precautions
Examples
706
R (unsigned BCD)
Point A
SCL(194) can be used to scale the results of analog signal conversion values
from Analog Input Units according to user-defined scale parameters. For
example, if a 1 to 5-V input to an Analog Input Unit is input to memory as 0000
to 0FA0 hexadecimal, the value in memory can be scaled to 50 to 200 ° C
using SCL(194).
SCL(194) converts unsigned binary to unsigned BCD. To convert a negative
value, it will be necessary to first add the maximum negative value in the pro-
gram before using SCL(194) (see example).
SCL(194) cannot output a negative value to the result word, R. If the result is
a negative value, 0000 will be output to R.
Name
Label
Error Flag
ER
Equals Flag
=
An error will occur and the Error Flag will turn ON if the values for Ar (C) and
Br (C+2) are not in BCD, or if the values for As (C+1) and Bs (C+3) are equal.
The Equals Flag will turn ON when the contents of the result word D is 0000.
In the following example, it is assume that an analog signal from 1 to 5 V is
converted and input to CIO 0200 as 0000 to 0FA0 hexadecimal. SCL(194) is
used to convert (scale) the value in CIO 0200 to a value between 0000 and
0300 BCD.
When CIO 000000 is ON, the contents of CIO 0200 is scaled using the linear
function defined by point A (0000, 0000) and point B (0FA0, 0300). The coor-
dinates of these points are contained in D00100 to D00103, and the result is
output to D00200.
Scaling is performed according
to the linear function defined
by points A and B.
P
(BCD)
Point B
P1+1
(BIN)
(BCD)
P1+2
P1+3
(BIN)
S (unsigned binary)
Operation
ON if the contents of C (Ar) or C+1 (Br) is not BCD.
ON if the contents of C+1 (As) and C+3 (Bs) are equal.
OFF in all other cases.
ON if the result is 0.
OFF in all other cases.
Section 3-18
Converted value
Converted value

Advertisement

Table of Contents
loading

Table of Contents