REAL_TO_DINT(a)
Converts a to a DINT by rounding to the nearest integer.
Parameters
a(REAL)
The value to convert to a DINT.
Return Value
Returns a DINT.
Remarks
0.5 rounds up to 1.
Rounding -0.5 differs between the RMCs:
The RMC75E and RMC150E will round -0.5 to -1.
The RMC75S and RMC75P will round -0.5 to 0.
Examples
REAL_TO_DINT(0.5) returns 1
REAL_TO_DINT(-7.89) returns -8
See Also
TRUNC Function | DINT_TO_REAL Function | DINT_TO_DWORD Function | DWORD_TO_DINT Function | Standard Functions
Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion