
798
Data Control Instructions
Section 3-18
Flags
Precautions
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.
Examples
In the following example, it is assume that an analog signal from 1 to 5 V is
converted and input to D00000 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 D00000 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.
Negative Values
An Analog Input Unit actually inputs values from FF38 to 1068 hexadecimal
for 0.8 to 5.2 V. SCL(194), however, can handle only unsigned binary values
between 0000 and FFFF hexadecimal, making it impossible to use SCL(194)
directly to handle signed binary values below 1 V (0000 hexadecimal), i.e.,
FF38 to FFFF hexadecimal. In an actual application, it is thus necessary to
add 00C8 hexadecimal to all values so that FF38 hexadecimal is represented
as 0000 hexadecimal before using SCL(194), as shown in the following exam-
ple.
Name
Label
Operation
Error Flag
ER
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.
Equals Flag
=
ON if the result is 0.
OFF in all other cases.
(BCD)
(BIN)
(BCD)
(BIN)
P1: D00100
P1+1: D00101
P1+2: D00102
P1+3: D00103
P1
R
D00000
Contents of D00200 (R)
Contents of D00000 (S)
Point B
Point A
Summary of Contents for SYSMAC CS Series
Page 2: ......
Page 4: ...iv ...
Page 30: ...xxx ...
Page 186: ...146 List of Instructions by Function Code Section 2 4 ...
Page 1320: ...1280 Model Conversion Instructions Unit Ver 3 0 or Later Section 3 35 ...
Page 1390: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...
Page 1391: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits ...
Page 1392: ...1352 ASCII Code Table Appendix A ...
Page 1404: ...1364 Revision History ...