GE PACSystems RX7i Cpu Programmer's Reference Manual page 141

Hide thumbs Also See for PACSystems RX7i:
Table of Contents

Advertisement

Chapter 4. Ladder Diagram (LD) Programming
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.
126
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pacsystems rx3iPacsystems rsti-ep

Table of Contents