I am using rslogix 5000 V20 and converting 2 INT to a real. The data from the real I am reading is lower than what is should be and not sure if the data from the module is giving it this way or if I am not doing my conversion correctly. If you look at this attachment, the AEG:I.Data[2] is in data format INT and wanting to copy [2] and [3] into a real. The main question I have is the Length correct? In the Rockwell literature is confusing because one says:
EXAMPLE
[/FONT][/FONT]
[/FONT][/FONT]
[/FONT][/FONT]
EXAMPLE
Convert INTs to a DINT
[FONT=Garamond,Bold][FONT=Garamond,Bold]•
[/FONT][/FONT]
Elements 3 of INT_array is the lower 16 bits of the amount of free I/O
memory. Element 4 is the upper 16 bits.
[FONT=Garamond,Bold][FONT=Garamond,Bold]•
[/FONT][/FONT]
Memory_IO_Free is a DINT tag (32 bits) in which to store the value for
the amount of free I/O memory.
[FONT=Garamond,Bold][FONT=Garamond,Bold]•
[/FONT][/FONT]
To copy all 32 bits, specify a Length of 1. This tells the instruction to copy 1 times the size of
but another states:
The number of bytes copied is:
Byte Count = Length * (number of bytes in the Destination data type)
If the byte count is greater than the length of the Source, unpredictable data is copied for the remaining elements.
What should the length be or is there another way I need to be converting the 2 INT to a real?
the Destination (32 bits). This copies both element 3 (16 bits) and element 4 (16 bits) and
places the 32-bit result in Memory_IO_Free.but another states:
The number of bytes copied is:
Byte Count = Length * (number of bytes in the Destination data type)
If the byte count is greater than the length of the Source, unpredictable data is copied for the remaining elements.
What should the length be or is there another way I need to be converting the 2 INT to a real?