GE 90-30/20/Micro Universal Remote User Manual


 
GFK-0467K Chapter 4 Series 90-30/20/Micro Instructions Set 4-105
4
TRUN (INT, DINT)
The Truncate function is used to round the real number toward zero. The original data is not
changed by this function.
Note
The 350 and 360 series CPUs (Release 9 or later and all releases of CPU352) are the only
Series 90-30 CPUs with floating point capability; therefore, the TRUN function has no
applicability for other 90-30 CPUs.
When the function receives power flow, it performs the conversion, making the result available via
output Q. The function passes power flow when power is received, unless the specified conversion
would result in a value that is out of range or unless IN is NaN (Not a Number).
_____
| |
(enable) —|REAL
_
|— (ok)
| |
|TRUN_|
| |
| INT |
(value to be converted) —|IN Q|— (output parameter Q)
|_____|
Parameters:
Parameter Description
enable When the function is enabled, the conversion is performed.
IN IN contains a reference for the real value to be truncated.
ok The ok output is energized when the function is performed without error, unless the value is
out of range or IN is NaN.
Q Q contains the truncated INT or DINT value of the original value in IN.
Note
It is possible for a loss of precision to occur when converting from REAL to
DINT since the REAL has 24 significant bits.