cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Endian change at Modbus TCP App

Endian change at Modbus TCP App

AlexS
New Poster

Hi,

I want to read data via ModbusTCP App, but the endianess does not match.

the Server provides the words in little-endian. But the Modbus TCP App seems to expect a big-endian wordorder.
Is there any hidden possibility to change the wordorder?
Or will it be possible to change the endianess in a next version?

6 REPLIES 6

nickH
Community Moderator
Community Moderator

Thanks for the question. I forwarded the question to the dev team. I will come back to you here if I got an update. 

cc2go
Occasional Contributor

You mean Byte swap within a Word or something else.

We like to understand your use case, why it's important to you that you can specify how it will be swapped? Normally when device is as per standard, no swap should happen.

 

The Bytes within a word are transmitted as expected. That means, 16 bit values are received correctly by the Modbus TCP App.
But when I want to receive a DWORD or FLOAT the words have to be swapped.

Example: server has a DWORD 0xDEADBEEF which is at address 0x3000 then the LowWord (0xBEEF) will be at address 0x3000 and the HighWord (0xDEAD) will be at address 3001. If I tell the client at Modbus TCP App it has to read an UINT32 from address 3000, I get a value of 0xBEEFDEAD.

My communication partner has a fix little-endian wordorder when used as a server. By using it as a client everything (bytes, words, ...) can be swapped as needed to adapt to different systems. To my knowledge there are many systems who use different byte-/wordorders to transmit their data.

cc2go
Occasional Contributor

Thanks for sharing details. We're checking on the efforts. Are there any death line for you, till you expect this improvement

We are actually working on a proof of concept. This is one solution but does not need to be the preferred/best solution. There are also other ways to get the data. E.g. get some arrays of 16bit register values with this Modbus TCP App and then write an own snap app which converts the data and stores it into the datalayer...
Generally, this would be an useful improvement for the Modbus TCP App. It would be nice to know if this will be done in the future and when it will be done circa.

cc2go
Occasional Contributor

the word swap might be a small and quick improvement soon, consider the byte swap too (I mean both, user can choose byte and/or word swap),  is a higher effort and will take longer.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist