Products

Converting 16 bit unsigned integers to a Floating Point Number For Allen-Bradley SLC500 PLC's


The purpose of this document is to provide RS Logix programming code for SLC-500 PLC’s to purposefully understand an analogue input variable, that using a 105U, 105S-1, 2 or a 905U, 905S-1, 2 analogue input, radio linked to a 105U-G- (DF1) or 905U-G-(DF1) then to serial connection to SLC-500 using the DF1 protocol.

All references in this document to the 905U & 905S also apply to the 105U & 105S.

Since the SLC-500 logic platform only stores integers in the 2's complement binary data type, the highest order bit in the data word is reserved to determine the sign of the integer, limiting the maximum read number to 32,767. If data values greater than 32767 are desired a floating point format must be used. Any number with a value between 32768 and 65535 are negative numbers. When they are converted to floating point format they convert as negative numbers. The following
rung of logic will convert a 16 Bit value between 32768 and 65535 to a float.

Click here to download product brochure