omron — $LNGB string function

$LNGB string function $LNGB string function Syntax $LNGB (value) Function Return a 4-byte string containing the binary representation of a 32-bit integer. Usage Considerations Real values are rounded and any fractional part is lost. Values must be in the range ^H7FFFFFFF to -^H80000000 Parameter value Real value, variable, or expression whose value is to be converted to its binary representation. Details The integer part of a real value is converted into its binary representation; the low 32-bits of that binary representation are packed into a string as four 8-bit characters. Bits 25 to 32 are packed into the first byte, followed by bits 17 to 24 in the second byte, and so forth.

The main use of this function is to convert integer values to binary representation within an output record of a data file. The operation performed by this function is equivalent to the following expression: $CHR(INT(value/^H1000000) BAND ^HFF) + $CHR(INT(value/^H10000) BAND ^HFF) + $CHR(INT(value/^H100) BAND ^HFF) + $CHR(INT(value) BAND ^HFF) Example Returns the value $INTB(67)+$INTB(12345). $LNGB(67*65536+12345) Related Keywords $CHR string function $FLTB string function $INTB string function eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 328