EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 696

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
663
Data Control Instructions Section 3-17
Flags
Precautions An error will occur and the Error Flag will turn ON if the contents of S is not
BCD or if the value for
X (C+1) is not between 0001 and 9999 BCD.
The Equals Flag will turn ON when the contents of the result word D is 0000.
The Negative Flag will turn ON if the MSB of the result in R is 1, i.e., if the
result is negative.
Examples When a value from 0 to 200 is scaled to an analog signal (1 to 5 V, for exam-
ple), a signed BCD value of 0000 to 0200 is converted (scaled) to signed
binary value of 0000 to 0FA0 for an Analog Output Unit.
When CIO 0.00 turns ON in the following example, the contents of D0 is
scaled using the linear function defined by
X (0200), Y (0FA0), and the off-
set (0). These values are contained in D100 to D102. The sign of the BCD
value in D0 is indicated by the Carry Flag. The result is output to CIO 2011.
Name Label Operation
Error Flag ER ON if the contents of S is not BCD.
ON if the contents of C+1 (X) is not between 0001 and
9999 BCD.
OFF in all other cases.
Equals Flag = ON if the result is 0.
OFF in all other cases.
Negative Flag N ON when the MSB of the R (the result) is 1.
OFF in all other cases.
X (0200)
Y
X
P1:
P1+1:
P1+2:
P1+3:
P1+4:
P1
R
0.00
D0
D100
D100
D101
D102
D103
D104
Offset
Contents of R (CIO 2011, signed binary)
Y (0FA0 Hex)
Contents of S (D0, signed BCD)
Max. conversion
Min. conversion
010

Table of Contents

Related product manuals