IMDTouchKnowledge BaseShop main store

How-to

How to Swap Words on a C-More 32-Bit Modbus Tag

HMI and touchscreens Published 5 min read

Short answer

Yes. In the C-more programming software, open Panel Manager, select the Modbus protocol, and enable Word Swap in its Setup dialog — add Byte Swap if each register's bytes are also reversed. The setting applies to every tag on that protocol instance, reaches the panel only with a full project transfer, and should be verified against a known reference value such as 0x12345678 (305419896 decimal).

On this page
  1. What word swap fixes
  2. Enabling Word Swap in Panel Manager
  3. Worked example: a 32-bit tag reading 0x12345678 on registers 40001 and 40002
  4. The four readings one pair can produce
  5. One swap setting per protocol instance
  6. Questions asked

Yes, the C-more panel can swap the words. On any Modbus link, RTU or TCP, the C-more programming software exposes two checkboxes in the Modbus driver's Setup dialog inside Panel Manager: Word Swap exchanges the two 16-bit registers of a 32-bit value, and Byte Swap reverses the two bytes inside each register. Tick Word Swap, transfer the full project, and the display of a pair holding 0x12345678 must read 305419896 — if it reads 1450709556 the words were reversed and this is your fix. The setting belongs to the protocol instance, so it applies to every tag that instance serves rather than to one tag, and it reaches the panel only when you transfer the full project. Verify against a known reference value before trusting the display, because the wrong combination of the two swaps still produces a valid-looking number.

What word swap fixes #

A 32-bit integer or floating-point value on Modbus occupies two consecutive holding registers. The protocol fixes the byte order inside each register — high byte first on the wire — but it does not fix which of the two registers carries the high word, so slaves split into those that put the high word in the lower register and those that put it in the higher one. Four ways exist to join two registers into one 32-bit value.

When the panel joins the pair in the opposite order from the slave, every 32-bit value from that slave is wrong in a characteristic way: a small setpoint shows as a huge number whose magnitude jumps with the value. The failure is not C-more-specific; it is the same one behind scrambled readings when displaying a PLC real value over Modbus on an HMI, whatever panel polls the slave.

Word Swap and Byte Swap are independent: the first exchanges whole 16-bit registers within a two-register value, the second exchanges the two bytes inside each register. The checkboxes belong to the Modbus driver; on a link that is not Modbus, the order has to be corrected in the slave or a gateway instead.

Enabling Word Swap in Panel Manager #

  1. Open the project in the C-more programming software and confirm the link already communicates: correct baud, parity and unit ID for RTU, correct address and port for TCP. No swap setting repairs a link that is not exchanging data.
  2. Open Panel Manager in the project tree and select the Modbus protocol instance that talks to the slave in question.
  3. Open that protocol's Setup dialog. It lists Word Swap and Byte Swap, and each acts on every read and write the driver issues.
  4. Tick Word Swap. Leave Byte Swap off unless the reference test below shows the bytes inside each register are also reversed.
  5. Confirm the dialog to save the protocol configuration into the project.
  6. Transfer the complete project to the panel. The swap is driver configuration carried in the project, the same place where C-more panel IP settings are saved in the project, so a screen-only update will not deliver it.
  7. Open the screen that displays the 32-bit tag and read the reference value, with the machine held in a state where a wrong number cannot trigger an action.

Worked example: a 32-bit tag reading 0x12345678 on registers 40001 and 40002 #

Inputs:

  • The slave's register map shows a 32-bit value stored across two consecutive holding registers with the high word in the lower register; 40001 and 40002 are the example pair.
  • From your commissioning PC you write 0x1234 into 40001 and 0x5678 into 40002, so the pair holds 0x12345678 — a pattern with eight distinct hex digits, so every mis-assembly is recognizable.
  • The C-more tag is a 32-bit integer tag addressed to that pair and shown on a numeric object.
  • Before the change, the panel reads 1450709556.

Rule in words: the panel assembles the pair into one 32-bit value as one register multiplied by 65536 plus the other; the swap setting decides which register is the multiplier.

Arithmetic, correct order with the high word in 40001, using 0x1234 = 4660 and 0x5678 = 22136 in decimal:

4660 × 65536 + 22136 = 305397760 + 22136 = 305419896

Arithmetic, words reversed, which is what the panel did before the fix:

22136 × 65536 + 4660 = 1450704896 + 4660 = 1450709556

The panel multiplied the wrong register by 65536. Tick Word Swap in the Setup dialog, transfer the project, and read the object again.

Decision: the display must read exactly 305419896. At that value the swap is right for this slave and the tag can carry real data. Any other reading is one of the three mis-assemblies in the table below — toggle the swap it names and transfer once more.

The four readings one pair can produce #

With 0x12345678 in the two registers, only four assemblies of the four bytes exist, and each reading names its own fix:

Panel displays Bytes joined as Fault Fix
305419896 0x12345678 None, order correct Leave the swaps as set
1450709556 0x56781234 Words reversed Toggle Word Swap
873625686 0x34127856 Bytes reversed inside each register Toggle Byte Swap
2018915346 0x78563412 Words and bytes reversed Toggle both

Because the checkboxes flip the assembly, the fix is to change the state of the named swap or swaps — never to add a second setting somewhere else.

One swap setting per protocol instance #

The swap belongs to the Modbus protocol instance, not to the tag, and the driver offers no per-tag override: every tag the instance serves is assembled identically. When one panel must read slaves with different word orders, give the odd slave its own protocol instance in Panel Manager with its own swap setting — the same arrangement as choosing the RS-485 protocol for one HMI and multiple PLCs — or pre-swap that slave's data in the slave itself or in a gateway, so a single order serves the whole panel.

Questions asked

Does Word Swap apply to one tag or to the whole driver?

To the whole driver. The checkbox sits on the Modbus protocol instance in Panel Manager, so every tag it serves is assembled with the same word order. If one slave needs a different order, give it its own protocol instance — for example a second Modbus TCP client or a second Modbus RTU master — and set that instance's swap independently.

My small setpoint displays as 1450709556. Is that word order?

Almost certainly. When a pair holding 0x12345678 is joined with the words reversed, the display reads 1450709556 instead of 305419896. Write the reference pattern into the two registers, tick Word Swap in the driver Setup dialog, transfer the full project, and confirm the numeric object reads exactly 305419896 before it carries real data.

Do I ever need Byte Swap together with Word Swap?

Only when the slave also reverses the two bytes inside each 16-bit register. The reference test separates the cases: with 0x12345678 in the pair, 873625686 means only the bytes are reversed, and 2018915346 means words and bytes both are. Toggle exactly the swaps the reading implicates, transfer the project, and read again.

Does Word Swap change how 16-bit tags read?

No. A 16-bit tag occupies a single register, and Word Swap only changes how two-register values are assembled, so one-register tags are indifferent to it. Byte Swap is different: it reverses bytes within each register, so it does affect single-register values. Leave it off unless the reference test calls for it.

Can the swap be changed on the panel, without the software?

No. The swap is driver configuration stored in the project, so you edit it in the C-more programming software and deliver it with a full project transfer. The panel offers no runtime swap control, which is why the reference reading is repeated after every transfer.

Keep reading

  • Troubleshooting

    Displaying a PLC Real Value Over Modbus on an HMI

    An INTEGER display that reads the register proves the link, station and address, so a blank REAL display is a 32-bit mapping fault. Declare the HMI variable as a 32-bit float on the register pair (40064/40065), set the device double-word order to Low Word First to match the PLC, and give the numeric field six integer digits for 628402.0.

    HMI and touchscreens

  • How-to

    Adding a Modbus RTU Driver and External Variables in Vijeo Designer

    Add one Modbus RTU equipment driver on the HMI serial port, set the baud, parity and stop bits every slave shares, and give each device a unique slave address. Then create one external variable per value, pointing it at that device and its documented register with the matching data type. Mismatched serial settings or duplicate addresses show up as read timeouts, so commission one device at a time.

    HMI and touchscreens

  • Troubleshooting

    Why HMI Indicators Stay Off Over Modbus RTU Polling

    Indicators on internal tags animate from HMI memory with no serial traffic; an indicator bound to a PLC tag needs a completed Modbus RTU read of the right address in the right data area. Confirm the PLC bit changes, then read the request and response, then fix the address at one known point.

    HMI and touchscreens