Omron SYSMAC CJ - REFERENCE MANUAL 08-2008 Reference Manual page 837

Programmable controllers
Hide thumbs Also See for SYSMAC CJ - REFERENCE MANUAL 08-2008:
Table of Contents

Advertisement

Data Control Instructions
Description
Area
Index Registers
Indirect addressing
using Index Registers
SCL(194) is used to convert the unsigned binary data contained in the source
word S into unsigned BCD data and place the result in the result word R
according to the linear function defined by points (As, Ad) and (Bs, Bd). The
address of the first word containing the coordinates of points (As, Ar) and (Bs,
Br) is specified for the first parameter word P1. These points define by 2 val-
ues (As and Bs) before scaling and 2 values (Ar and Br) after scaling.
The following equations are used for the conversion.
(Bd – Ad)
R = Bd
BCD conversion of (Bs – As)
The slope of the line is as follows:
(Bd – Ad)
R = Bd
BCD conversion of (Bs – As)
Points A and B can define a line with either a positive or negative slope. Using
a negative slope enables reverse scaling.
The result will be rounded to the nearest integer. If the result is less than
0000, 0000 will be output as the result. If the result is greater than 9999, 9999
will be output.
R (unsigned BCD)
Point B
Point A
SCL(194) can be used to scale the results of analog signal conversion values
from Analog Input Units according to user-defined scale parameters. For
example, if a 1 to 5-V input to an Analog Input Unit is input to memory as 0000
to 0FA0 hexadecimal, the value in memory can be scaled to 50 to 200 C
using SCL(194).
SCL(194) converts unsigned binary to unsigned BCD. To convert a negative
value, it will be necessary to first add the maximum negative value in the pro-
gram before using SCL(194) (see example).
SCL(194) cannot output a negative value to the result word, R. If the result is
a negative value, 0000 will be output to R.
S
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
×
BCD conversion of (Bs – S)
Scaling is performed according
to the linear function defined by
points A and B.
P
(BCD)
P1+1
(BIN)
(BCD)
P1+2
P1+3
(BIN)
S (unsigned binary)
Section 3-18
P1
R
Converted value
Converted value
797

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cs seriesSysmac one nsj seriesSysmac cj series

Table of Contents