Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 696

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Data Control Instructions
Flags
Precautions
Examples
0.00
D0
D100
P1
R
Name
Error Flag
Equals Flag
Negative Flag
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.
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.
Contents of R (CIO 2011, signed binary)
010
X (0200)
Label
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.
=
ON if the result is 0.
OFF in all other cases.
N
ON when the MSB of the R (the result) is 1.
OFF in all other cases.
P1:
P1+1:
P1+2:
P1+3:
P1+4:
Y (0FA0 Hex)
Contents of S (D0, signed BCD)
Section 3-17
Operation
D100
Offset
D101
X
D102
Y
Max. conversion
D103
D104
Min. conversion
663

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents