free quality report for PLCopenXML exports

Rules / channel-sensor-off

A wired module input has its sensor type set to Off

A module channel is mapped to a variable but no sensor type is selected. The channel is not digitised and the variable stays at zero whatever the signal. Structured Text does not show it: the setting lives in the device parameters.

Severity: Critical Rule id: channel-sensor-off Sensor type cleared on a wired channel

This rule only runs on CODESYS .export files: PLCopenXML does not contain these settings.

What the rule checks

A module channel is wired to an IEC variable, but no sensor type is selected on it. The channel is not digitised: the variable stays at zero whatever the input. The trouble is that zero is plausible: for an outdoor sensor it reads as "0 °C outside", the weather-compensated curve immediately computes the wrong setpoint, and the commissioning engineer goes looking for the bug in the code. None of this is visible in ST, where the variable is declared and read as usual; the setting lives in the device parameters. A module usually has more free inputs than wired ones, and for those "off" is the correct setting, so the rule only looks at channels whose VALUE is bound to a variable (a status code is bound on free inputs too, and by that measure every input would look wired).

What it does to the plant

Zero looks plausible, "0 °C outside", so the heating curve computes the wrong setpoint while the engineer hunts for a bug in the code.

Example

Bad: the rule fires
VAR_GLOBAL    rOutdoor : REAL;END_VARDEVICE MV210_101    SensorValue1.SensorValue -> GVL.rOutdoor    SensorType1.SensorType = 0
Fixed: the rule is silent
VAR_GLOBAL    rOutdoor : REAL;END_VARDEVICE MV210_101    SensorValue1.SensorValue -> GVL.rOutdoor    SensorType1.SensorType = 35

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. Select the sensor type for the channel in the device parameters: the one physically connected (Pt100, Pt1000, 4…20 mA).
  2. If the input really is unused, remove the variable binding from the channel: "off" then becomes an honest setting and the rule goes quiet.
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