How-to
Adding a Modbus RTU Driver and External Variables in Vijeo Designer
Short answer
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.
On this page
- Where do I add the Modbus equipment driver in Vijeo Designer?
- What serial settings must all devices share?
- How do I add the driver and each device in the I/O Manager?
- How do I turn the manual's register number into a driver address?
- How do I create an external variable for each value?
- Why do reads time out after adding a second device?
- In what order should I commission the bus?
- Questions asked
One Modbus equipment driver on the HMI serial port carries the whole RTU bus: configure it once with the baud rate, parity and stop bits every device uses, add one device entry per slave with a unique address from 1 to 247, then create one external variable per value pointing at that device and its documented register. In Vijeo Designer the driver lives in the I/O Manager, and variables live in the project variable list. The failures that follow this setup — timeouts, wrong values, a dead second device — trace to a duplicate address, a mismatched serial format, or a register entered in the wrong numbering form. This walkthrough sets up two devices, a power meter and a drive, end to end.
Where do I add the Modbus equipment driver in Vijeo Designer? #
In the I/O Manager, where driver selection and driver changes are made: add one Modbus equipment driver and bind it to the serial port wired to the RTU bus — one driver per port, not one per device.
On this bus the HMI is the requester (client, master) and every connected device answers (server, slave). The driver variant you pick has to match the role of the far end: for a bus of Modbus RTU slaves, the HMI-side driver polls them. Device entries created under the driver are what external variables reference later, so get the driver and its port assignment right before building any screens. Dialog labels and available fields vary with the software release and target, so read the driver properties shown in the installed project rather than assuming a menu path from another version.
What serial settings must all devices share? #
All of them: on one RTU segment every slave must use the same baud rate, data bits, parity and stop bits, and each must hold a unique slave address from 1 to 247 — address 0 is broadcast, and a duplicate address corrupts replies.
The classic RTU character is 11 bits: 8 data bits plus even parity and 1 stop bit. When a device is set to no parity, the format trades the parity bit for a second stop bit, though many devices also run 8N1 in practice — see why 1 stop bit works with parity none for that case. Whatever the choice, the whole segment runs one format; a port cannot serve two formats at once.
Before touching the software, record for each device: its slave address, baud rate, data bits, parity, stop bits, and the register map with data types, access rights and scaling. Then compare the serial settings across devices. If the overlap is empty — one device offers only 8E1 and another only 8N2, say — that pair cannot share a port: reconfigure one device or put them on separate links. That check takes five minutes on paper and saves a day of timeout hunting.
How do I add the driver and each device in the I/O Manager? #
Add the Modbus equipment driver to the project, assign it the serial port wired to the bus, enter the shared serial format, then create a device entry per slave holding its address — in this example a power meter at address 3 and a drive at address 5.
- Open the project for the target HMI and confirm which serial port is physically wired to the RTU bus.
- In the I/O Manager, add the Modbus equipment driver and attach it to that port; this is also where you change a driver later.
- Enter the one serial format every device shares — in this example 19200 baud, 8 data bits, even parity, 1 stop bit — and compare each field against the recorded settings before continuing.
- Add one device entry per slave and set its address exactly as configured in the device itself: 3 for the power meter, 5 for the drive. Verify each address against the device's own display or configuration tool, never against an assumed default.
- Check the physical segment: A/B polarity consistent at every drop, shield grounded at one end, and termination (typically 120 Ω) at the two segment ends only.
How do I turn the manual's register number into a driver address? #
Subtract the base of the documented block: a manual entry of 40125 in a 4xxxx holding-register map is offset 124, because 40125 − 40001 = 124, and the leading 4 only names the table — 40001 itself is the first register, offset zero.
The convention appears in almost every device map: the leading digit picks the table, and the number is one-based within it. Larger maps extend the block with a sixth digit, but the rule stays base-plus-offset.
| Leading digit | Table | Read | Write |
|---|---|---|---|
| 0 | Coils | 01 | 05, 16 |
| 1 | Discrete inputs | 02 | — |
| 3 | Input registers | 04 | — |
| 4 | Holding registers | 03 | 06, 16 |
The trap is the address field itself: some drivers expect the 4xxxx form, others the plain zero-based offset, and the two differ by one at the same register. Decide the form once by proving it against a register whose value you already know — a serial number, a firmware version, a communications counter — then use that form for every variable on the driver.
Worked example with illustrative manual rows. The power meter lists: "Active power total — 40125 — INT16 — 0.1 kW — read". Leading 4 makes it a holding register read with function 03, and the offset is 40125 − 40001 = 124. The drive lists: "Frequency reference — 41002 — UINT16 — 0.1 Hz — read/write". Its offset is 41002 − 40001 = 1001. For a 32-bit value spanning two registers, word order is part of the mapping; the common failure patterns are covered in displaying a PLC real value over Modbus on an HMI.
How do I create an external variable for each value? #
One external variable per value: create it, point it at the device entry, enter the register in the form the driver expects, set the data type and scaling from the manual row, then bind it to the display or input object.
- Create a new external variable and select the device entry it reads — the meter at address 3 for the power value.
- Enter the register in the form you proved in the previous section: offset 124, or 40125 in the 4xxxx form.
- Set the data type exactly as the manual states — INT16 for the signed power word. Signed and unsigned 16-bit decode differently: a raw 40000 reads as 40000 unsigned but as 40000 − 65536 = −25536 signed.
- Set the scaling: gain 0.1 with offset 0 turns a raw 743 into 743 × 0.1 kW = 74.3 kW on the screen.
- For the drive's frequency reference, enable write access and bound the operator entry to the drive's documented range — 0.0 to 60.0 Hz in this example.
- Bind each variable to its object. One variable serves any number of objects but only ever one device and one register.
For drive parameters specifically, the typical register set is mapped out in connecting an HMI directly to a VFD over Modbus RTU.
Why do reads time out after adding a second device? #
Almost always a duplicate slave address: two devices answering one request drive the bus at the same time, the replies collide, and the master records timeouts or CRC errors instead of data.
Check in this order and stop at the first hit:
- The new device's address against every existing one — a device still on its factory default collides with the first one if that also defaulted.
- Its serial format against the format entered in the driver.
- Wiring polarity and termination at the new drop.
- The register form, only after the first three pass.
Use the symptom to pick the fault class. A timeout means nobody answered: address, format or wiring. A value that responds but looks wrong means the bus is fine and the mapping is not: wrong register, wrong data type, swapped word order, or missing scaling. If the first device dies the moment the second joins, the newcomer's address or format is the fault — leave the variables alone. When nothing answers at all, work the full physical and protocol sequence in fixing HMI Modbus device no response over RS-485 before changing any mapping.
In what order should I commission the bus? #
One device, one known register, then grow: commission the meter alone against its live display, add the drive, prove both, and leave writes for last, tested on one approved setpoint before any operator object gets write access.
- With only the meter on the bus, read its known-value register and compare the HMI reading with the meter's own display.
- Confirm scaling: the HMI shows 74.3 kW when the raw word is 743 at 0.1 kW per count, and the meter front panel agrees.
- Add the drive at address 5 and repeat the known-value read against its keypad before mapping more variables.
- Test one write: commanding 50.0 Hz sends 50.0 ÷ 0.1 = 500 as the raw word to the frequency reference, and the readback and keypad both show 50.0 Hz.
- Only then release write objects to operators, each bounded to the device's documented range.
Writes to a running drive move the machine: do the write test with the drive output disabled or the machine in a documented safe state, and enable operator writes only after that test passes.
Questions asked
How many Modbus slaves can one serial port drive?
The address space allows 1 to 247, but the electrical limit usually arrives first: a plain RS-485 segment is sized for 32 unit loads, and each device consumes one full load or a fraction of one. Add the unit-load figures from the device manuals and stay under 32 per segment; beyond that, split the bus with a repeater. On a fast-polling bus, scan time rather than addressing is the limit you hit first.
Why does a 32-bit value display as a huge or impossible number?
Word order. A 32-bit value occupies two consecutive registers: two registers holding 1 and 100 should decode as 1 × 65536 + 100 = 65,636, but with the halves swapped the same pair decodes as 100 × 65536 + 1 = 6,553,601. A huge or absurd reading from a device that is clearly responding means the words are reversed — fix it with the variable's word-order setting, not by moving the register address.
Can I write to a 3xxxx input register?
No. The leading 3 marks an input register, which is read-only by function code 04. Writable points live in 4xxxx holding registers and are written with function 06 for a single register or 16 for a block. If a value you want to command appears in the 3xxxx section of a map, that entry is a measurement the device publishes, not a setpoint — look for the command in the holding-register section.
Does every register need its own external variable?
Yes, one variable per value, and each variable carries exactly one device selection and one address. A 32-bit value spread over two consecutive registers is still one variable — the length and word order belong to its data type, not to a second address. Two display objects can share one variable, but one variable can never span two devices on the bus.