R_UINT_WORD: Type conversion (REAL -> UINT -> WORD) (R_UINT_WORD: Type conversion (REAL -> UINT -> WORD))
Original instructions
Function description
This function converts an input value with data type REAL to data type UINT and then data type WORD.
As opposed to the conversion module REAL_TO_WORD (standard library) the R_UINT_WORD module performs a conversion to a UINT value before output of a WORD value (value range 0 - 65535). This results in that the input value -1.0 causes an error message, the outputENO is set, and the output value remains unchanged. (Not as with the REAL_TO_WORD module, for which the output value 0 is set without error message in this case).
As additional parameters, EN and ENO are projected.
Representation in FBD
Representation:
Representation in LD
Appearance:
Representation in IL
Appearance:
LD RealValue 
R_UINT_WORD 
ST WordValue
Representation in ST
Appearance:
WordValue := R_UINT_WORD (RealValue);
Parameter description
Description of input parameters:
Parameter
Data type
Description
INP
Input value
Description of output parameters:
Parameter
Data type
Description
OUTP
Output value
Runtime error
The system bit %S18 and system words %SW17 (error status) and %SW125 (16#DE87: Caldulation errors in a floating point value calculation) are set when