FL2REGH

Extracts the top 16 bit values of a 32 bit floating-point number. FL2REGH enables sending float numbers over Modbus as a pair of 16-bit word values. The Modbus protocol does not support floats.
fl2regh_block
Parameter values for the FL2REGH function:
Parameter
Data Type
Description
Val
REAL
32-bit floating-point REAL value.
Q
DINT
Integer value representing the top 16-bits of the 32-bit floating point number.
TIP: FL2REGH does not convert floats to integers. Numbers remain in floating point format. To convert the input value to an integer, use the ANA operator.
Function Block Diagram Example
fl2regh_fbdexample
Structured Text Example
Output := Fl2RegH(floating_value) ;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal