free quality report for PLCopenXML exports

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

Bad: the rule fires
<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>
Fixed: the rule is silent
<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

  1. Assign each module a unique address (IP or Unit-ID) in the device configuration.
  2. Cross-check the network address map: an address must be unique on one bus.
Check your project

Upload a PLCopen XML or CODESYS .export file: the report is free and the code is not stored.

Local version on GitHub →

The same linter without uploading a file: command line and GitHub Action.

Related rules

2026-11-26

Processing happens in memory, and the uploaded code is not stored. The tool advises; code changes are up to the engineer (see what the linter can't see). What happens to your code → · Rule reference · Your code & privacy · Industry benchmark · Feedback · GitHub