Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Reading of swapped bytes from modbus via Com'X200

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…

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Power & Grid
  • Gateways and Energy Servers
  • Reading of swapped bytes from modbus via Com'X200
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
Romain_Polette
Spock Romain_Polette Spock
96
Randi_Dolan
Commander Randi_Dolan Commander
46
Guillaume_Evrard
Commander Guillaume_Evrard Commander
41
Thierry_Baudard
Commander Thierry_Baudard Commander
30
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to Gateways and Energy Servers
sesa113942_brid
Crewman sesa113942_brid Crewman
Crewman

Posted: ‎2016-06-28 04:36 AM

1 Like
8
967
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-06-28 04:36 AM

Reading of swapped bytes from modbus via Com'X200

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?

Reply
  • All forum topics
  • Previous Topic
  • Next Topic
Replies 8
michael_franz
Admiral michael_franz
Admiral

Posted: ‎2016-06-28 12:58 PM

0 Likes
2
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-06-28 12:58 PM

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!!!


Reply
sesa113942_brid
Crewman sesa113942_brid Crewman
Crewman

Posted: ‎2016-06-30 12:33 AM

1 Like
1
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-06-30 12:33 AM

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.

Reply
michael_franz
Admiral michael_franz
Admiral

Posted: ‎2016-06-30 05:55 AM

0 Likes
4
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-06-30 05:55 AM

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

Reply
michael_franz
Admiral michael_franz
Admiral

Posted: ‎2016-06-30 09:24 AM

0 Likes
0
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-06-30 09:24 AM

Throw JBus into the mix for more confusion.

Reply
Hal_Etheridge
Janeway Hal_Etheridge Janeway
Janeway

Posted: ‎2016-06-30 12:22 PM

2 Likes
3
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-06-30 12:22 PM

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.

Reply
michael_franz
Admiral michael_franz
Admiral

Posted: ‎2016-06-30 12:29 PM

0 Likes
0
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-06-30 12:29 PM

Been there done that read the book.

Reply
sesa113942_brid
Crewman sesa113942_brid Crewman
Crewman

Posted: ‎2016-07-07 09:27 AM

0 Likes
1
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-07-07 09:27 AM

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.

Reply
michael_franz
Admiral michael_franz
Admiral

Posted: ‎2016-07-07 09:37 AM

0 Likes
0
907
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2016-07-07 09:37 AM

Adding the swap would MSR and LSR would be nice.  Some companies do it backwards...

Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of