Chapter 4. Ladder Diagram (LD) Programming
126
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
Example: BCD4 to UINT
Tip:
One use of BCD4_TO_UINT is to convert BCD data from the I/O structure into integer data
and store it in memory. This can provide an interface to BCD thumbwheels or external BCD
electronics, such as high-speed counters and position encoders.
In the example at right, whenever input %I0002 is
set, the BCD4 value in PARTS is converted to an
unsigned single-precision integer (UINT) and
passed to the ADD_UINT function, where it is
added to the UINT value represented by the
reference RUNNING. The sum is output by
ADD_UINT to the reference TOTAL.
Example: INT to UINT
Whenever input %I0002 is set, the INT value in
%L00050 is converted to an unsigned single-
precision integer (UINT) and passed to the
ADD_UINT function, where it is added to the UINT
value in %R08833. The sum is output by
ADD_UINT to the reference TOTAL.
Example: DINT to UINT
Whenever input %I00002 is set and no errors
exist, the double precision signed integer (DINT)
at input location %R00007 is converted to an
unsigned integer (UINT) and passed to the SUB
function, where the constant value 145 is
subtracted from it. The result of the subtraction
is stored in the output reference location
%Q00033.
Example: REAL to UINT
Whenever input %I00045 is set, the REAL value in
%L00045 is converted to an unsigned single-
precision integer (UINT) and passed to the
ADD_UINT function, where it is added to the UINT
value in %R00045. The sum is output by
ADD_UINT to the reference TOTAL.
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...