Data interpretation

P

Thread Starter

Peter Preininger

Hello,

I am developing some kind of SCADA application and have a problem with the interpretation of data. Let's assume we have a client which stores a double float, which has a length of 64 bit. The value is presented as 12345678 (each number refers to one byte number).

The client has got a lot of different ways to store and send it to the master (the following byte orders show the sent data words):

1. 12 34 56 78
2. 87 65 43 21
3. 78 56 34 12

Is it also possible that a client sends the following data words:

4. 34 12 78 56
5. 43 21 87 65
6. 21 34 56 87

I assume that 4, 5 and 6 are rather unlikely because this would mean a mix of big endian and little endian notation within one client. Is that correct?
Are any other combinations possible?

Of course this problem also occurs when operating strings.

Thank you for your help.
 
F

Fred Loveless

The byte order is very important in the way a Modbus Master and a Modbus Slave talk to each other. If you are writing a SCADA application that uses a communications package (OPC or DDE Server) to communicate with the Modbus device then that package where a master of a slave needs to be configurable so that it can be adjusted to handle the byte order of the device data.

That said in 12 years I do not recall any devices that do Modbus and mix the byte order. They are usually one way or the other.

Check out Kepware's Modbus Suite. It is highly configurable and works with nearly all of the Modbus enabled devices out there.

http://www.kepware.com/Products/products_OPCServers.html#AnchorM

Fred Loveless
Support Manager
Kepware Technologies
 
Honeywell's HC900 hybrid controller uses floats (exclusively?), so it offers all four options for the IEEE Floating Point Data Format:

mantissa x 2 ^(exponent -127)
(23 bit signed binary with 8 bit biased binary exponent)
where the order is byte 4 byte 3 byte 2 byte 1
where byte 4 starts with the mantissa's positive/negative sign bit

those 4 formats being:
Floating Point Big Endian Format: 4, 3, 2, 1
FP BB Floating Point Big Endian with byte-swapped: 3, 4, 1, 2
FP L Floating Point Little Endian Format: 1, 2, 3, 4
FP LB Floating Point Little Endian with byte-swapped: 2, 1, 4, 3

Their communication manual, 51-52-25-111, details the formats on pages 18-24 (pdf).
The document resides at
http://hpsweb.honeywell.com/NR/rdonlyres/01B126BB-D667-4C0B-8678-21C21DF10520/34880/515225111.pdf

Given the world of open standard Modbus and its huge variety of implementations, it would pay to cover your bases for a Modbus master in a SCADA system.

David
 
Top