mellis
Member
I think a picture is worth a thousand words here.
On the right is the poll of the modicon starting at 40500. That is put into the compactlogix starting at 4xxx[0] So 4xxx[0] = 40501 on the left
On the left - 40504,40505 make up a float in the Modicon. (slight difference due to time, its pressure)
On the right - 4xxx[4],4xxx[5] is what gets put into the INT array. CANNOT CHANGE THE DATATYPE.
The data in the INT is still correct, it is just displaying as a signed number. the bit pattern of 1011 0010 0011 1111 is -19905 signed or 46031 unsigned. Bits is bits, it doesn't matter how it displays. COP the two INTS into a REAL in the right order and your floating point number is there intact.