Omron SYSMAC CS Series Instruction & Reference Manual page 625

Hide thumbs Also See for SYSMAC CS Series:
Table of Contents

Advertisement

Example Programming
In the following example, it is assume that an analog signal from 1 to 5 V is converted and input to D0
as 0000 to 0FA0 hexadecimal. SCL(194) is used to convert (scale) the value in CIO 200 to a value
between 0 and 300 BCD.
When CIO 0.00 is ON, the contents of D0 is scaled using the linear function defined by point A (0000,
0000) and point B (0FA0, 0300). The coordinates of these points are contained in D100 to D103, and
the result is output to D200.
0.00
P1
R
Contents of D200 (R)
Point A
Reference:
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 example.
+
Contents of D 200 (R)
Point A
CS/CJ/NSJ Series Instructions Reference Manual (W474)
D0
D100
D200
P1:
P1+1: D101
Point B
P1+2: D102
P1+3: D103
Contents of D0 (S)
200
D0
D0
The value in CIO
0200 plus 00C8
D100
hexadecimal
D200
Point A (00C8 Hex → 0000 (BCD))
Point B (1068 Hex → 0300 (BCD))
P1:
P1+1: D101
Point B
P1+2: D102
P1+3: D103
Contents of D0 (S)
(BCD)
D100
(BIN)
(BCD)
(BIN)
+00C8 Hex
(BCD)
D100
(BIN)
(BCD)
(BIN)
3. Instructions
3
591

Advertisement

Table of Contents
loading

Table of Contents