Rules / modbus-address-duplicate
Two modules with the same Modbus address in a CODESYS configuration
Two or more I/O modules are assigned the same address (IP:port#unit). On the bus they answer for each other and the exchange with them is wrong.
Severity: Critical
Rule id: modbus-address-duplicate
Duplicate Modbus address on modules
This rule only runs on PLCopenXML: .export stores task and address configuration differently.
What the rule checks
Two or more modules are assigned the same Modbus address (IP:port#unit), which is a conflict on the bus: their exchange will be incorrect. Checked against leaf I/O modules.
What it does to the plant
Inputs of one module are read as another's, commands go to the wrong device; the fault is intermittent and depends on who answers first.
Example
<configuration name="MV210_101"> <Value visiblename="IPAddress">192.168.0.21</Value> <Value visiblename="Port">502</Value> <Value visiblename="Unit-ID">1</Value></configuration><configuration name="MU210_402"> <Value visiblename="IPAddress">192.168.0.21</Value> <Value visiblename="Port">502</Value> <Value visiblename="Unit-ID">1</Value></configuration>
<configuration name="MV210_101"> <Value visiblename="IPAddress">192.168.0.21</Value> <Value visiblename="Port">502</Value> <Value visiblename="Unit-ID">1</Value></configuration><configuration name="MU210_402"> <Value visiblename="IPAddress">192.168.0.22</Value> <Value visiblename="Port">502</Value> <Value visiblename="Unit-ID">1</Value></configuration>
Both listings are run through the linter by an automated test: the rule fires on the first and stays silent on the second.
How to fix
- Assign each module a unique address (IP or Unit-ID) in the device configuration.
- Cross-check the network address map: an address must be unique on one bus.
Upload a PLCopen XML or CODESYS .export file: the report is free and the code is not stored.
The same linter without uploading a file: command line and GitHub Action.
Related rules
2026-11-26