

A OSR pulse then swaps the bytes within N!10:0-N10:1 and in the same rung a CPW instruction in parallel with the swap (but placed lower!) moves them to their destination at F8:0, with a length of 2 words.

MOVE N10:11 TO N10:0 AND then N10:11 TO N10:0, IN A LOWER RUNG or in the next scan cycle. if you were to move the register pair 40001-40002 to F8:0, map the message instruction to have them delivered at say N10:0 &n10:11 respectively. But by taking care to move the higher register first, it works. It is easily resolved by first swapping the registers, and then swapping the bytes within each register. A Big Thanks to Eddie, Praveen and especially to ContrConn and all others who expressed their views here, I've managed to solve this issue. If you can post the actual values in your Integer data file, and what values those are expected to represent, that will help. If it's not, you need to swap the bytes or swap the words. For example, if you have three 32-bit IEEE 754 single-precision floating point values stored in the MicroLogix 1100 in Integer data elements N10:0-5 (six 16-bit registers), you use the COP instruction as follows: COP Src: N10:0 Dst: F8:0 Len: 3 If the data in the Modbus registers you've read into the Integer registers is in the appropriate byte order, you'll see the values you expect. You can then read that Floating-Point data file with your display system.

For your application, if the data is coming over the Modbus RTU connection encoded as IEEE 754 single-precision floating point values but being stored in A-B integer data files, you need to use the COP instruction to copy the data bit-by-bit into an A-B Floating Point data file. Since your HMI application wants to read A-B datatypes, you're going to have to give it what it wants. And even if it is, there's no reason for byte order to be the same inside an A-B controller as it is inside a Modicon controller. Datatype is not explicit in Modbus function codes. Folks who implement Modbus in embedded systems take all kinds of liberties in bit significance and byte order. Raj, I certainly agree that Modbus should be implementation-independent.
