9/2/2013 12:23 PM | |
Joined: 1/17/2007 Last visit: 12/5/2024 Posts: 1548 Rating: (538) |
When interfacing with external systems, the real (floating point) data may be incompatible with the S7 system, due to endian issues (the byte / word ordering). This is a common issue when interfacing systems of differing manufacturers. Floating point numbers are encodeded in the IEEE754 format, which is 32-bits in size, and is therefore transmitted over the modbus interface as 2 16-bit registers. Now it is entirely possible that the data in these registers will require either the word order, byte order or possibly both swapping so that it is compatible with the S7 system. So say that the data comes into the S7 system as two register values AB CD. There are 4 possible permutations of swapping required:- AB CD (take data as supplied) CD AB (word swap only - this is the most likely) BA DC (byte swap only - not very common) DC BA (byte and word swap - not very common). So you will either need to get the remote device to swap the words over internally before it sends it over the modbus interface, or alternatively, read the data as 2 words and then swap it over in the S7 and then convert it to a real value. This thread contains details. Regards, Smiffy. |
Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots. |
|
This contribution was helpful to2 thankful Users |
7/23/2020 7:51 AM | |
Joined: 6/1/2020 Last visit: 3/16/2022 Posts: 1 Rating: (0) |
Hi! all: Now i using the TIA Portal V15.1 already had the "CONV" instruction to transfer Dword or Dint to Real. |
Follow us on