GX Works3 - iQ-F - Function for converting LREAL to REAL numbers

GX Works3 - iQ-F - Function for converting LREAL to REAL numbers

This article contains GX Works3 function for iQ-F CPU that converts LREAL numbers to REAL numbers.

This function converts a value from LREAL data type to REAL data type on iQ-F CPU.

 

Input/Output

Data Type

Description

LREAL_IN

Word [Signed](0..3)

LREAR number in 4 element array of registers

output

Word [Signed](0..1)

REAL number in 2 element array of registers


FBD/LD:



Structured text:

?INT(0..1)_REAL? := LREAL_TO_REAL(  ?INT(0..3)_LREAL_IN?  );

To input LREAR number to this function, you need to create 4-element array of Word [Signed] data type to which you assign devices that hold LREAL value. Converted REAL value also will be held in the same way.