Chapter 4. Ladder Diagram (LD) Programming
GFK-2950C February 2018 127
4.6.6 Convert BCD8, UINT, INT, REAL or LREAL to DINT
BCD8, UINT, and INT
When this function receives power flow, it converts the data into the equivalent signed double-
precision integer (DINT) value, which it outputs to Q. The conversion to DINT does not change the
original data.
The output data can be used directly as input for another program function. The function passes
power flow when power is received, unless the data is out of range.
REAL and LREAL
When REAL_TO_DINT or LREAL_TO_DINT receives power flow, it rounds the input data to the nearest
double-precision signed integer (DINT) value, which it outputs to Q. These functions do not change
the original REAL or LREAL data.
The output data can be used directly as input for another program function. The function passes
power flow when power is received, unless the conversion would result in an out-of-range DINT
value.
Warning
Converting from LREAL or REAL to DINT may result in
Overflow. For example, REAL 5.7E20, which equals 5.7 ×
10
20
, converts to DINT OVERFLOW.
Tip: To truncate a REAL value and express the result as a DINT, i.e., to remove the fractional part
of the REAL number and express the remaining integer value as a DINT, use TRUNC_DINT.
Operands
The value to convert to DINT.
All except S, SA, SB, and SC
The DINT equivalent value of the original input value in IN.
All except S, SA, SB, and SC