How to setup the Q.station controller as a Modbus slave

Steps to set up a controller as a Modbus TCP/IP or Modbus RTU slave

To set up the controller as a Modbus RTU slave a USB-to-RS485 or ModbusTCP-to-RTU gateway is required. Please take a look at this page for compatible devices.

Due to the limitation of having only one data port available, running Modbus TCP/IP in parallel with ASCII TCP/IP is not feasible.

Configuration using GI.bench

  1. Open an existing GI.bench project or read your online controller configuration.
  2. Double-click on the controller to open the Controller Settings.
    1. Navigate to the Dataport section. Change the protocol to Modbus TCPIP class 0 or Modbus TCPIP class 0 (word swapped). The default port for Modbus TCP/IP is 10000. 

    2. To set up Modbus RTU go to the USB Devices settings and change the Device count to 1. Select the USB port and change the Type to ModbusRTU slave. Enter the corresponding Address and Baudrate.

  3. It is on by default, but to check or change protocol permissions, right-click the controller and select Edit data access rights.

  4. Make sure the desired channels are selected for READ or WRITE permission.

  5. Write the updated configuration to the controller.
  6. In the toolbar select Export > Export variable info to save the variable info in a CSV file.

  7. Open the CSV file to see the Modbus register for each configured variable. The register offset for the first channel is 999 (hex 3E7).

  8. Use the Q.station's IP address, port number, and channel registers to read signals with a Modbus master.

Configuration using test.commander

  1. Read controller into project window (right-click > Add Online Controller)
  2. Double-click the controller to view Controller Settings
  3. Modbus TCP/IP or RTU
    1. TCP/IP: Go to Host interface > Dataport. Set Protocol to Modbus TCP/IP class 0 and enter the desired port number. Click OK.

    2. RTU: Go to USB Devices, and change Count to 1. Select the USB port to use and select Modbus for the protocol (USB-to-RS485 converter needed). Set Operates as Master to No. Enter the corresponding Address and Baudrate. Click OK when complete.

  4. Configure controller and modules as needed. Write Updates (File > Write Project).
  5. To find channel registers, go to File > Calculate Statistics. Please scroll through the variables to find their respective Modbus register. The register offset for the first channel is 999 (hex 3E7).

  6. Use the controller IP address, data port, and Modbus register to read the variables from the controller with a Modbus master device.