Skip to content

Modbus RTU

logiccloud Control Runtimes on your Edge devices can be connected to your I/Os or other devices via Modbus RTU over a serial line (RS-232 / RS-485). To do this, a new Modbus RTU connection must be created and parameterized in the connection settings of the respective runtime. The mapping model is identical to Modbus TCP — the difference is the transport: instead of an IP address and port, an RTU connection is configured with serial-line parameters.

Select Add Modbus RTU connection and enter all the necessary information such as the name, the serial device address and the serial-line parameters. You can also adjust the poll period and make further settings.

Connection settings:

  • Name: Name of the connection
  • Description: Description, optional
  • Address: address (slave/unit ID) of the Modbus RTU device on the serial bus
  • Poll period: interval (ms) at which the runtime polls the device for data
  • Baud rate: serial link speed in bps (e.g. 9600, 19200, 38400, 57600, 115200; the full range from 50 up to 921600 is supported)
  • Data bits: number of bits per serial character — 7 or 8
  • Parity: serial parity mode — None, Even or Odd
  • Stop bits: number of serial stop bits — 1 or 2
  • Connect timeout: timeout (ms) when establishing the connection
  • Request timeout: timeout (ms) for an individual request
  • Wait between calls: minimum wait time (ms) inserted between consecutive requests on the bus

To reduce the number of transactions on the bus, consecutive registers can be read or written in a single multi-register request:

  • Use read multiple: read several registers per request instead of one at a time
  • Read chunk size: maximum number of registers read in one multi-read request
  • Use write multiple: write several registers per request instead of one at a time
  • Write chunk size: maximum number of registers written in one multi-write request
  • Enable flow control: enable RS-485 RTS line control (default off). When enabled, the driver toggles the RTS line around each transmission so the RS-485 transceiver switches between transmit and receive. Leave it off for RS-232 or for adapters that handle direction switching automatically.

A unit can be created after the Modbus RTU connection. To do this, right-click on the connection and select Add Modbus unit. Here you can specify the name, the address and the byte order.

You can map the process variables with Modbus registers. To do this, select the relevant register type, for example Input Registers, and create a new register mapping using the green + icon. You can then define the address, the process variable and the data type.

  • Variable name: variable from your program
  • Data type: data type of the variable — Boolean, Int16, Int32, Int64, UInt16, UInt32, UInt64, Float or Double
  • Address: register address
  • Register type: DiscreteInput (read-only boolean), Coil (read/write boolean), InputRegister (read-only numeric) or HoldingRegister (read/write numeric)
  • Byte order: byte order of the unit — BigEndian or LittleEndian; the unit also offers word-swap, byte-swap and reverse-registers options for matching the device’s representation of multi-register values