Gateways and Energy Servers
Schneider Electric support forum to share knowledge about product selection, installation and troubleshooting for EcoStruxure Panel Server, PowerTag, Com'X, Link150…
User | Count |
---|---|
81 | |
46 | |
28 | |
28 |
Link copied. Please paste this link to share this article on your social media post.
What if you have a custom device which use swapped bytes in the registers?
I have an example of a meter with a 32 bit integer register value:
First reg. has the value: BF F1 (hex)
Second reg. has the value: 13 00 (hex)
The correct reading of the meter value is: 00 13 F1 BF (hex) = 1307071 (decimal).
The Com'X200 can only read the first byte as MSB but this give a wrong result.
In some other Modbus SW you can choose swapped bytes, but is there a way to read the correct value in the Com'X200?
Link copied. Please paste this link to share this article on your social media post.
In the ComX 510 we had to read published register -1 and start the block read on register before that to get our values to post correctly. This is odd since they showed up correctly on the diagnostic read page. If you start your block read on the value you want it will not report correctly. OH-MY-ODD-Jbus or something!!!
Link copied. Please paste this link to share this article on your social media post.
It has always been a bit confusing about modbus registers.
Some use register numbers starting with number 1 and other use register addresses starting with number 0.
The best way is to test 1 reading before setting up a large number of modbus registers.
Link copied. Please paste this link to share this article on your social media post.
Ivan:
In future rev we should have the option to swap the registers for numbers that span several. Some manufactures put big numbers one way and other the same as most Schneider devices in question.
It may confuse some people and help other.
Michael
Link copied. Please paste this link to share this article on your social media post.
Throw JBus into the mix for more confusion.
Link copied. Please paste this link to share this article on your social media post.
Unfortunately modbus can be documented in two main ways:
1) JBus
2) Modbus
--> One is zero indexed and the other is 1-indexed. Remember that the binary bytes you see on the wire is always zero indexed though. ie. requesting register 40000 (or 40001 depending if it is JBus or Modbus) will request register zero (binary "on-the-wire" request you will see if you packet sniff the request)
The next major factor is that the modbus protocol does not define the behavior for any values that are larger than 16-bits. Modbus is inherently an array of unsigned 16-bit registers (officially always in big endian format but some device manufacturers forget this fact). If you want to encode a 32 bit value (or larger) then the options are to encode as big endian (most significant byte first) or little endian (least significant byte first). Typically the bytes within a single 16 bit Modbus register will still be big endian (but not guaranteed either!).
Thus for a 32 bit value it can be encoded as follows (byte 4 most significant, byte 1 least):
4321 (pure big endian, the "proper" way to do it according to Modbus convention)
3412 (big endian across registers, little endian within registers, not that common)
2143 (little endian across registers, big endian within registers, slightly more common)
1234 (pure little endian, completely the wrong way to encode values but actually fairly common)
where the first pair of values are in the lower Modbus register and the second pair are in the higher number Modbus register.
And yes I have seen all four combinations with real devices. 🙂
Once you start looking at larger values (48 and 64 bits long) the number of combinations get even more complex.
This is why the modbus device drivers for Power Monitor Expert allow for about 50+ different formats. It has to in order to properly decode all the possible combinations used in practice.
Link copied. Please paste this link to share this article on your social media post.
Been there done that read the book.
Link copied. Please paste this link to share this article on your social media post.
Yes I had seen the different options in PME and also in SBO.
Unfurtunately ComX200 can only use your example 1 and 3 (4321 and 2143).
In my situation i have to use example 4 (1234), but this is not possible with ComX200 and I can't find a simple work arround
If the development team behind ComX200 would make this option in future firmware it will be appreciated.
Link copied. Please paste this link to share this article on your social media post.
Adding the swap would MSR and LSR would be nice. Some companies do it backwards...
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.