Skip to main content

Modbus Server

Purpose

This target exposes variables from a forwarding group to an external Modbus master through Modbus TCP or Modbus RTU. The current Modbus type list has no ASCII option.

Configure the forwarding group and target through Data Forwarding. This page covers Modbus server properties, address mapping, client permissions, and protocol debug.

Open the plugin

Open Development Configuration → Data Forwarding and:

  1. Save the forwarding-group variable range.
  2. Add a target, choose Modbus Server, and fill in its basic target information.
  3. Open Target properties, choose the Modbus type and channel, then configure protocol, permissions, serial, DTU, or TLS settings.
  4. Save the target and configure a required Slave variable address for each exposed variable.
  5. Enable the target and verify with an external Modbus master or the debug page.

Basic target information

SettingDefaultConfiguration
Group-Select a saved forwarding group.
Target name-Required and unique within the group.
EnableEnabledDisable to stop listening.
Log levelInfoTemporarily use Debug for protocol diagnostics.
Start timeout60 secondsValid range is 1 to 3600 seconds.

Target properties

Protocol

SettingDefaultConfiguration
Modbus typeModbusTcpCurrent choices are ModbusTcp (MBAP) and ModbusRtu (binary RTU + CRC16). TCP normally uses TcpService; RTU normally uses SerialPort.
Default station1Used when an address has no S= prefix.
Multiple-station modeEnabledAllows multiple stations in one target.
Channel typeTcpServiceSelect TcpService, SerialPort, or the channel required by the deployment.

Data format

SettingDefaultConfiguration
Data formatABCDSelect ABCD, BADC, CDAB, or DCBA to match the external master.
Reverse string bytesDisabledReverse string bytes by word only when required by the external layout.

Permissions

SettingDefaultConfiguration
Allow RPC writeEnabledTarget-level write switch. Disable for read-only monitoring.
Client permission listEmptyEmpty allows all TCP client IPs. When non-empty, only matching AllowedClientIp entries connect; AllowWrite must also be true for writes.

Runtime

SettingDefaultConfiguration
Write to memory immediatelyEnabledApplies an accepted write to the gateway variable immediately.
Send delay0 msDelay before a reply frame when required by the master.
Connection timeout3000 msConnection-operation timeout; minimum 100 ms.
Heartbeat contentEmptyOptional application heartbeat content.
Heartbeat is HexDisabledTreats heartbeat content as hexadecimal when enabled.
Heartbeat interval60000 msServer heartbeat interval.

Connection

SettingDefaultConfiguration
Remote address127.0.0.1:502Used only when the selected channel requires a remote endpoint.
Local bind address0.0.0.0:502TCP service listen address. Restrict it to a required interface in production.
Serial portCOM1Used for serial channels.
DTU IDEmptyIdentifier used to match a DTU service connection.
DTU ID is HexDisabledParses the DTU ID as hexadecimal bytes when enabled.
DTU service typeDefaultSelect the DTU registration mode required by the terminal.

TLS

SettingDefaultConfiguration
Enable SSLDisabledEnables TLS for the channel.
SSL target hostEmptyHost name used for client certificate validation.
SSL client certificateEmptyClient certificate for mutual TLS.
SSL server certificateEmptyCertificate presented by a server channel.
SSL CA certificateEmptyCA used to validate peer certificates.
Allow untrusted certificateEnabledTemporary self-signed testing only; disable in production.
SSL protocolNoneKeep the system default unless the peer requires a specific TLS version.
Check certificate revocationDisabledEnable according to the security policy.

Serial port

SettingDefaultConfiguration
Baud rate9600Must match the external master and serial device.
Data bits8Must match the external master.
ParityNoneMust match the external master.
Stop bitsOneMust match the external master.
DTR / RTSEnabled / EnabledHardware flow-control switches.
Async streamEnabledEnables asynchronous serial I/O.
HandshakeDefaultSerial handshake mode.
Input / output buffer4096 / 2048 bytesIncrease only for long or continuous frames.

Capacity and reliability

SettingDefaultConfiguration
Maximum concurrency1Maximum concurrent protocol requests; minimum 1.
Maximum connections10000Maximum client connections.
Frame cache time500 msFrame assembly cache window; minimum 100 ms.
Client cleanup time120000 msIdle-client cleanup interval.

Target variable properties

SettingDescription
Slave variable addressRequired. Modbus address exposed to the external master.
Data typeDefault Int16. Data type used for this target mapping.
Allow RPC writeAllows external clients to write this variable when target-level and channel-level write permissions also allow it.

The variable must already be inside the forwarding group's range. Adding a target variable property does not add a member to the group.

Address rules

AddressData areaCommon read function
00001CoilsFC1
10001Discrete inputsFC2
30001Input registersFC4
40001Holding registersFC3

Addresses use one-based notation. S=2;40001 exposes holding register 40001 at station 2; F=3;0 explicitly uses FC3 with zero-based offset 0; 40001.3 exposes bit 3 of the register.

Within one target, station, function, and start-address combinations must not overlap. Match the data type and register size to the external master's point list.

Functions

FunctionPurpose
Read and writeRead a confirmed point and write only to an approved test point.
Forwarding pipelineUse Forwarding pipeline and review the returned result.
Protocol serviceUse Protocol service to send or inspect protocol frames and view the device or target response.

Target debug

Open Development Configuration → Data Forwarding, select the forwarding group and target, and open Debug.

Read and write

Modbus Server read and write panel

Read a mapped address first. Before writing, confirm target, channel, client, and variable write permissions.

Forwarding pipeline

Modbus Server forwarding pipeline

Use the pipeline view to confirm how a group variable becomes an exposed Modbus value.

Protocol service

Modbus Server protocol service

Check the listening endpoint, connected clients, and protocol-service state.

Verify the target

  1. Start the target and confirm the server is listening.
  2. Connect an external Modbus master.
  3. Read one mapped variable in each configured data area.
  4. If writing is enabled, write one safe value and confirm the gateway variable changes as expected.

Troubleshooting

SymptomCheck
Master cannot read a valueListening channel, bind address, station, function code, target variable property, and data type.
Client cannot connectChannel type, local bind address, port, firewall, maximum connections, and client permission list.
Value has wrong byte orderData format, string-byte setting, target data type, and external master format.
Write is rejectedTarget RPC write, variable RPC write, client permission, and the external master's function code.
Serial server has no responsePort ownership, baud rate, data bits, parity, stop bits, flow control, and frame timing.