free quality report for PLCopenXML exports

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

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

  1. Pass the value from the call's own family (its name is in the message) and check that its default is right.
  2. 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.
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