2
« on: April 28, 2015, 07:19:06 AM »
Archie,
I did some testing over the weekend of the latest release (V398f) using Modbus RTU. I’m still having problems with getting the right output values using ‘Basic label’.
The results are below.
Device used for testing is a Modbus RTU Energy Meter using RS485.
Value being read from the device is a Float of 4 bytes which should display 60.02
Using standard Modbus software the raw output when reading address 400XX is:
RX: 0x01 0x04 0x04 0x42 0x70 0x14 0x7B 0xAA 0xBB
When this value is read using Advanced HMI the following value is displayed:
SwapBytes = False
2.990863E+30
SwapBytes = True
7.819442E-25
Digging deeper to see why I was getting the values above, I setup a Modbus RTU simulator software to see if I could make Advanced HMI output the values above.
To get the values listed below to be displayed using a ‘Basic label’ in Advanced HMI required the following raw string to be sent to it:
Display = 60.02
TX: 0x01 0x03 0x04 0x14 0x7B 0x42 0x70 0xAA 0xBB
Display = 2.990863E+30
TX: 0x01 0x03 0x04 0x00 0x01 0x72 0x17 0xAA 0xBB
Display = 7.819442E-25
TX: 0x01 0x03 0x04 0x00 0x01 0x17 0x72 0xAA 0xBB
In analyzing the results it seems that advanced HMI is doing the following:
1. It takes the raw bytes received from device and does a word swap: 42 70 14 7B => 14 7B 42 70
2. It then converts it to 6002
3. Next it converts the 6002 => 17 72
4. Depending on if SwapBytes is True or False it swaps the bytes and outputs that as the value to display.
After all that my question is, can I get Advanced HMI to not do the 2nd conversion to 17 72 and just output the 6002 value?
Also to read some of the other addresses for this device is it possible to have a SwapWord property?
Thanks in advance, your software and support is awesome.
Stewart