Skip to content

Modbus

The controller exposes a Modbus ‘Master’ at the specified TCP interface on port 502.

There are dedicated registers for the VFD, PIDs and internal values.

NameComponent IDAddressRWFunction CodeValueRegister Description
System19-W0x61Print Modbus Queue
System19-W0x62Print Component Modbus Registers
System1100-W0x61Reset Controller
System119-W0x61Print PID controller states

Remarks

  • Implementation for these calls : short ModbusBridge::loop() ./ModbusBridge.cpp
  • It requires a USB cable connected, with 19200 bauds, 8 bits, no parity and 1 stop bit. You can use Arduino’s ‘Serial Monitor’ to see the output.

The VFD (Omron - MX2) is being polled and controlled via RS485 at a defined Modbus slave address (Default 1). See more about the setup here.

NameComponent IDAddressRWFunction CodeValueRegister Description
VFD2005-W0x61Set VFD in RUN mode
VFD2005-W0x62Set VFD in STOP mode
VFD2005-W0x63Set VFD in RETRACT mode (stop and retract)
VFD2006-W0x60-100VFD Target Frequency
VFD2002-R0x60-100VFD Current Monitor
VFD2003-R0x6-VFD Status
OMRON_STATUS_STOPPED=2
OMRON_STATUS_RUNNING=0
VFD2004-R0x6-VFD State
OMRON_STATE_ACCELERATING=4
OMRON_STATE_DECELERATING=2
OMRON_STATE_RUNNING=3
OMRON_STATE_STOPPED=1
OMRON_STATE_ERROR=8

The PID controllers (Omron - EDC5) are being polled and controlled via RS485 at a defined Modbus slave address, starting by default from 4.

NameComponent IDAddressRWFunction CodeValueRegister Description
PID10020R-0x60-Maximum Temperature (PV)PID-0 Temperature
PID10021R-0x60-Maximum Temperature / Set PointPID-0 Set Point (SP)
PID10022R-0x6StatusPID-0-Status / Default State : ‘Is Heating’
PID10023R-0x60-Maximum Temperature (PV)PID-1 Temperature
PID10024R-0x60-Maximum Temperature / Set PointPID-1 Set Point (SP)
PID10025R-0x6StatusPID-1-Status / Default State : ‘Is Heating’
NameIDAddressRWFunction CodeNumber AddressesRegister Description
OmronPID10020R-0x66
MB_Relay30041RW11
MB_Relay30142RW11
POT40051R-31
POT40152R-31
Pos3Analog50161R-31- Read Position : Address=61(3D) -> [Up:1 Middle:0 Down:2]
Pos3Analog50262R-31- Read Position : Address=62(3E) -> [Up:1 Middle:0 Down:2]
VFD200531
Stepper60170RW-14
MotorLoad2102R-31
Status - LED70184RW31
Status - LED70285RW31
NameIDAddressRWFunction CodeValueRegister Description
Stepper-060170RW0x60-5000Stepper-Speed
Stepper-060171RW0x60-1Stepper-Direction
Stepper-060172R-0x6-Stepper-Status
Stepper-0601720x6-Stepper-User
NameIDAddressRWFunction CodeValueRegister Description
Feed - VFD - Ratio60116-W0x60-100Stepper-Speed

The servo is turned on automatically as soon the VFD starts running.

To monitor and control the system, please open printhead-poll.mbp with MbPoll_v9.4.0.exe

Example Google Sheet

  • Please use MbSlave_v7.3.0.exe to start a Modbus-RTU master on TCP. You can use the ModbusPoll app to verify your code.