Modbus Byte Swap

Hi, I am attempting to add a register that will only display properly with ModbusPoll as a 32-bit Integer with Little-endian byte swap. This is an ABB Ekip breaker Current. Is there any way to do a byte swap in Ignition? Any other suggestions? Here is a screenshot: [image]

James, youll probably want to start a new topic.

Edit: Thanks Phil

2 Likes

Theres probably better ways, but you could create your own UDT and do the swapping with expressions within the UDT.

1 Like

Have you already tried the "swap words" setting on Ignition's Modbus device?

1 Like

Here's the byte order so you know what you need to swap:

How is byte swapping done in the UDT? I am trying to write an expression to do this, but I do not see any examples. Can do little-endian, swapping two registers to create a derived point, then use that point to swap the two bytes within a register? (({[.]CurrentAA} & 0xFF) << 8) | (({[.]CurrentAA} >> 8) & 0xFF) ??

What is the swapping expression for the UDT? I am editing the "write expression" or UDT in text.

Where is the "swap words" setting?

In your example, I need to write an expression to derive that "Mid-Little Endian" CDAB. How did you get that?

It's an advanced setting on the Modbus device you set up in the Ignition Gateway.