![Omron CJ1G-CPUxx Instructions Manual Download Page 732](http://html1.mh-extra.com/html/omron/cj1g-cpuxx/cj1g-cpuxx_instructions-manual_742491732.webp)
711
Data Control Instructions
Section 3-18
Flags
Precautions
An error will occur and the Error Flag will turn ON if the value for
∆
X (C+1) is
0000 or if the value for
∆
Y (C+2) is not BCD.
The Equals Flag will turn ON when the contents of the result word D is 0000.
The Carry Flag will turn ON if the value placed in the result word is negative.
Examples
Scaling 1 to 5-V Analog Input to 0 to 300
In the following example, it is assumed that an analog signal from 1 to 5 V is
converted and input to CIO 0205 as 0000 to 0FA0 hexadecimal. SCL2(486) is
used to convert (scale) the value in CIO 0205 to a value between 0000 and
0300 BCD.
When CIO 000000 is ON, the contents of CIO 0205 is scaled using the linear
function defined by
∆
X (0FA0),
∆
Y (0300), and the offset (0). These values are
contained in D00100 to D00102, and the result is output to D00200.
Scaling 1 to 5-V Analog Input to –200 to 200
In the following example, it is assume that an analog signal from 1 to 5 V is
converted and input to CIO 2005 as 0000 to 0FA0 hexadecimal. SCL2(486) is
used to convert (scale) the value in CIO 2005 to a value between –0200 and
0200 BCD.
Name
Label
Operation
Error Flag
ER
ON if the contents of C+1 (
∆
X) is 0000.
ON if the contents of C+2 (
∆
Y) is not BCD.
OFF in all other cases.
Equals Flag
=
ON if the result is 0.
OFF in all other cases.
Carry Flag
CY
ON if the result is negative.
OFF if the result is zero or positive.
∆
X
∆
Y
(
∆
X)
P1:
P1+1:
P1+2:
Contents of R (D00200)
Contents of S (CIO 0205)
Offset
1068Hex
P1
R
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...