SCR201: unknown-system-function
system.* member that does not exist in Ignition 8.3
| Code | SCR201 |
| Name | unknown-system-function |
| Category | Scripts (SCR) |
| Default severity | error |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports system.x.y (and the legacy alias fpmi.x.y) where y is not a
function, constant, object or package of the package system.x in any
scope of Ignition 8.3 (gateway, Vision Client or Designer). Aliases are
followed: after db = system.db, db.runQery(...) is checked as
system.db.runQery. The chain is checked up to the first member that is
not a package: what follows a function, constant or object
(system.net.httpClient().get) is not checked. A local variable named
system that is not an alias of the scripting API is not checked.
The member list comes from the scripting API of a real 8.3 gateway with
Ignition's standard modules. Third-party modules add their own top-level
packages (for example a MES module's system.mes) and sometimes add
functions to Ignition's own packages, so by default a name is only
reported when it is a near miss of a known member of the same package:
the same name in other letter case, one edit away for names of four or
more letters, or two edits away for names of eight or more
(system.tag.readBlockng, system.Tag, system.datset). The message
names the member it probably means. In strict mode every unknown member
of a known package is reported; list the members your modules add in
allow.
Why is this bad?
Section titled “Why is this bad?”The script raises AttributeError when it reaches the name: usually a
typo or a function that only existed in an older Ignition version.
Example
Section titled “Example”def runAction(self, event): values = system.tag.readBlockng(["[default]Line/Speed"])Use instead:
def runAction(self, event): values = system.tag.readBlocking(["[default]Line/Speed"])Options
Section titled “Options”allow(default[]): extrasystem.*paths that exist on your gateways (from third-party or in-house modules).*matches any characters,?one character, and a path also allows everything below it, for example["system.mes", "system.util.myCompanyHelper"]. Listing a path here only silences this rule: asystem.*member that Ignition 8.3 does not have may run code or read files, so it still keeps the safe fixes of other rules from being safe until the project lists it under[fix] vetted-system-functions.
Option reference
Section titled “Option reference”Set in [rules.SCR201] of iglint.toml (or [tool.iglint.rules.SCR201] in pyproject.toml).
| Option | Type | Default | Description |
|---|---|---|---|
allow |
array of strings | [] |
Extra system.* paths (wildcards *, ?) that exist on your gateways. |
Generated from the rule metadata by iglint generate-docs; iglint rule SCR201 prints the same page in the terminal. Source: docs/rules/SCR201.md.