Rules / param-family-outlier
A block parameter is taken from another unit's settings
All settings in a call come from one family (rValve...) except one taken from a neighbour (rBurnerFullMove), even though the project has its own rValveFullMove. It is the trace of a call copied from another unit.
Severity: Warning
Rule id: param-family-outlier
Parameter fed from another unit's settings
What the rule checks
A call to a unit's control block normally receives that unit's settings as one family: Cfg.rValvePeriod, Cfg.rValveMinMove, Cfg.rValveMaxMove. The rule looks for a call where one argument comes from a neighbouring family (Cfg.rBurnerFullMove) even though the value of the call's own family with the same tail exists in the project (Cfg.rValveFullMove). That is the trace of copying from a neighbouring unit. It is dangerous because commissioning does not reveal it: by default both settings are often equal and everything works. The defect shows only when one of them is changed, and from then on the position model, delay or protection of this unit runs on someone else's setting. Channel numbers are not compared here: a mixed-up number is what param-channel-mismatch catches.
What it does to the plant
Invisible during commissioning because the values are often equal. It shows up when one setting changes and the unit starts running on someone else's value.
Example
VAR_GLOBAL rValvePeriod, rValveFullMove, rValveMinMove, rValveMaxMove : REAL; rBurnerPeriod, rBurnerFullMove, rBurnerMinMove, rBurnerMaxMove : REAL;END_VARFUNCTION_BLOCK FB_ActuatorVAR_INPUT rPeriod, rFullMove, rMinMove, rMaxMove : REAL;END_VARVAR_OUTPUT xOpen : BOOL;END_VARxOpen := rFullMove > rMinMove AND rMaxMove > rPeriod;PROGRAM DrivesVAR fbValve, fbBurner : FB_Actuator;END_VARIF gvl.rValveFullMove <= 0.0 THEN gvl.rValveFullMove := 60.0;END_IFfbValve(rPeriod := gvl.rValvePeriod, rFullMove := gvl.rBurnerFullMove, rMinMove := gvl.rValveMinMove, rMaxMove := gvl.rValveMaxMove);fbBurner(rPeriod := gvl.rBurnerPeriod, rFullMove := gvl.rBurnerFullMove, rMinMove := gvl.rBurnerMinMove, rMaxMove := gvl.rBurnerMaxMove);
VAR_GLOBAL rValvePeriod, rValveFullMove, rValveMinMove, rValveMaxMove : REAL; rBurnerPeriod, rBurnerFullMove, rBurnerMinMove, rBurnerMaxMove : REAL;END_VARFUNCTION_BLOCK FB_ActuatorVAR_INPUT rPeriod, rFullMove, rMinMove, rMaxMove : REAL;END_VARVAR_OUTPUT xOpen : BOOL;END_VARxOpen := rFullMove > rMinMove AND rMaxMove > rPeriod;PROGRAM DrivesVAR fbValve, fbBurner : FB_Actuator;END_VARIF gvl.rValveFullMove <= 0.0 THEN gvl.rValveFullMove := 60.0;END_IFfbValve(rPeriod := gvl.rValvePeriod, rFullMove := gvl.rValveFullMove, rMinMove := gvl.rValveMinMove, rMaxMove := gvl.rValveMaxMove);fbBurner(rPeriod := gvl.rBurnerPeriod, rFullMove := gvl.rBurnerFullMove, rMinMove := gvl.rBurnerMinMove, rMaxMove := gvl.rBurnerMaxMove);
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
- Pass the value from the call's own family (its name is in the message) and check that its default is right.
- If the units really share one setting, give it a common name not tied to either unit, so the next person copying the code does not take it for a mistake.
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