free quality report for PLCopenXML exports

Rules / param-channel-mismatch

Pump 2's block input is fed with pump 1's signal

The parameter name refers to one channel while the value comes from another: bPump2_Fault := xFaultPump1. The rule fires only when the channel numbering in that same call is confirmed by matching pairs.

Severity: Critical Rule id: param-channel-mismatch Channel parameter fed from another channel

What the rule checks

In a function block call the parameter name refers to one channel while the value comes from another: bPump2_Fault := gvl.alarm_nasos_CO1. The rule fires only when channel numbering is proven within the same call, that is, consistent pairs exist for at least two channels. The consequence is quiet and dangerous: a faulty pump is treated as healthy and picked for duty, the interlock never fires, and the log looks perfectly normal.

What it does to the plant

A faulty pump is treated as healthy and selected to run, the protection never trips, and the log looks normal.

Example

Bad: the rule fires
VAR_GLOBAL    xFaultPump1, xFaultPump2, xFaultPump3 : BOOL;    xIdlePump1, xIdlePump2, xIdlePump3 : BOOL;END_VARFUNCTION_BLOCK FB_PumpGroupVAR_INPUT    bPump1_Idle, bPump2_Idle, bPump3_Idle : BOOL;    bPump1_Fault, bPump2_Fault, bPump3_Fault : BOOL;END_VARVAR_OUTPUT    iReady : INT;END_VARiReady := BOOL_TO_INT(bPump1_Idle AND NOT bPump1_Fault)        + BOOL_TO_INT(bPump2_Idle AND NOT bPump2_Fault)        + BOOL_TO_INT(bPump3_Idle AND NOT bPump3_Fault);PROGRAM PumpsVAR    fbGroup : FB_PumpGroup;END_VARfbGroup(bPump1_Idle := gvl.xIdlePump1,        bPump1_Fault := gvl.xFaultPump1,        bPump2_Idle := gvl.xIdlePump2,        bPump2_Fault := gvl.xFaultPump1,        bPump3_Idle := gvl.xIdlePump3,        bPump3_Fault := gvl.xFaultPump3);
Fixed: the rule is silent
VAR_GLOBAL    xFaultPump1, xFaultPump2, xFaultPump3 : BOOL;    xIdlePump1, xIdlePump2, xIdlePump3 : BOOL;END_VARFUNCTION_BLOCK FB_PumpGroupVAR_INPUT    bPump1_Idle, bPump2_Idle, bPump3_Idle : BOOL;    bPump1_Fault, bPump2_Fault, bPump3_Fault : BOOL;END_VARVAR_OUTPUT    iReady : INT;END_VARiReady := BOOL_TO_INT(bPump1_Idle AND NOT bPump1_Fault)        + BOOL_TO_INT(bPump2_Idle AND NOT bPump2_Fault)        + BOOL_TO_INT(bPump3_Idle AND NOT bPump3_Fault);PROGRAM PumpsVAR    fbGroup : FB_PumpGroup;END_VARfbGroup(bPump1_Idle := gvl.xIdlePump1,        bPump1_Fault := gvl.xFaultPump1,        bPump2_Idle := gvl.xIdlePump2,        bPump2_Fault := gvl.xFaultPump2,        bPump3_Idle := gvl.xIdlePump3,        bPump3_Fault := gvl.xFaultPump3);

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. Fix the index in the value: bPump2_Fault := gvl.alarm_nasos_CO2.
  2. Repeated per-channel calls are better folded into a loop over an array (FOR i := 1 TO 3 DO fb[i](...)), and then there is nothing left to renumber.
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