How do I control a VFD over Modbus RTU: registers, frames and wiring explained
Modbus RTU over RS-485 lets a PLC start, stop and set speed on a drive. Covers serial settings, function codes, CRC, a worked 50 Hz write, and common wiring faults.
Updated 2026-11-28
The short answer
Modbus RTU runs over a two-wire RS-485 bus at a fixed serial speed, such as 9600 or 19200 baud, with 8 data bits, a parity setting and 1 stop bit. Each drive has a unique slave address. The master (a PLC or HMI) reads and writes numbered registers: control words for run, stop and reset, reference registers for frequency, and status registers for actual speed, current and faults. The register map is specific to each drive model, so take addresses from the drive's communication manual.
Physical layer and drive settings
- Connect A to A and B to B (often labelled + and -). Swapping them is the most common cause of no response.
- Use shielded twisted pair. Put a 120 ohm termination resistor only at the two ends of the bus, not on every drive.
- On each drive set the slave address (unique on the bus), baud rate, parity and stop bits to match the master exactly.
- Set the drive's run and frequency command source to communication, and set a communication-loss action such as a fault or a controlled stop.
Frame structure and function codes
- Each frame has: slave address (1 byte), function code (1 byte), data (variable), then CRC-16 (2 bytes, low byte first).
- 03: read holding registers. 04: read input registers. 06: write one register. 16 (hex 10): write several registers.
- If the drive rejects a request, the reply uses the function code plus 80 hex, followed by an exception code. Code 02 means illegal address, 03 means illegal data value.
- CRC-16 uses the polynomial 0xA001 (reflected form) with initial value 0xFFFF. Most PLC Modbus blocks calculate it for you; compute it yourself only when debugging a raw serial link.
Worked example: set 50.00 Hz
Many drives store frequency in units of 0.01 Hz, so 50.00 Hz is 5000 decimal, which is 0x1388 hex. Assume, for this example only, that the frequency reference register is at address 0x0001 and the drive is at slave address 1. The write request is 01 06 00 01 13 88, followed by the two CRC bytes. Reading the actual frequency returns a value you convert back the same way: 5000 x 0.01 = 50.00 Hz. Check the scaling in your drive manual, because some drives use 0.1 Hz or 0.01 percent units.
Timing and polling
- Each serial character is about 10 bits with start, data, parity and stop bits. At 9600 baud an 8-byte frame takes about 8 ms on the wire.
- Poll only the registers you need: status and actual frequency each cycle, and fault or parameter registers less often. Polling dozens of registers on every scan slows the bus and the PLC.
- Use a watchdog counter in the PLC. If replies stop, raise an alarm and make the machine go to a safe state.
Common mistakes
- Two drives with the same address, or a master address that clashes with a drive. Addresses must be unique.
- Missing termination on a long bus, or termination on every node, causes corrupted frames and intermittent faults.
- Writing to a read-only register, or writing a run command while the drive is set to terminal control. The write may succeed but nothing happens.
- Wrong scaling, such as sending 50 instead of 5000 for 50 Hz, which gives 0.5 Hz.
- Byte order and register width mismatch between the PLC and the drive. Check whether the drive expects 16-bit or 32-bit values.
Synchronous speed, slip and VFD speed
nₛ = 120·f / p · s = (nₛ − n) / nₛ
V/f control keeps slip in rpm roughly constant at the same torque, so speed = 120·f/p − rated slip. At light load the motor runs closer to synchronous speed. Above base frequency torque falls (field weakening).
Sourcing a motor or production equipment from China? We can find and contact the right factories for you in Chinese. Ask on WhatsApp →