SCR204: deprecated-system-function
Deprecated system.* function
| Code | SCR204 |
| Name | deprecated-system-function |
| Category | Scripts (SCR) |
| Default severity | warning |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports uses of system.* functions that Ignition 8.3 marks as deprecated
(also through aliases), with the replacement Ignition names when it names
one, or else the one Inductive Automation's documentation names (for
example system.tag.readBlocking for system.tag.read, with how the call
changes). system.dataset.toPyDataSet and a few others have no
replacement in 8.3. Deprecation is taken from the scope the script runs in; a library
module is only reported when the function is deprecated in every scope
where it exists.
A replacement is only suggested where it exists: a gateway script that
calls system.util.beep is told that system.vision.beep exists only in
the Vision Client and the Designer. A library module runs in the scope of
whatever imports it, so its message says where a replacement exists when
that is not everywhere (system.security.getUsername and its replacement
system.vision.getUsername both exist only in the Vision Client and the
Designer).
Some replacements Ignition names are not system.* functions:
system.net.httpGet and the other system.net.http* functions are
replaced by the client system.net.httpClient() returns, and the message
names that method (.get(...)).
system.db.runUpdateQuery and the other deprecated query functions are
replaced by functions that run the query as a prepared statement. For a
SET statement (SET IDENTITY_INSERT Orders ON) that changes what the
code does: SQL Server keeps a SET option made by a prepared statement
only until that call ends, so the next statement no longer sees it. When
the query is a string literal (or a name assigned one) that starts with
SET, the message suggests no replacement and says why.
Why is this bad?
Section titled “Why is this bad?”Deprecated functions still work, but they are kept only for
compatibility: they may be removed in a later version, some no longer
receive fixes, and many have a replacement that is faster or works in
more scopes (for example system.tag.readBlocking instead of
system.tag.read).
Example
Section titled “Example”def runAction(self, event): value = system.tag.read("[default]Line/Speed").valueUse instead:
def runAction(self, event): value = system.tag.readBlocking(["[default]Line/Speed"])[0].valueGenerated from the rule metadata by iglint generate-docs; iglint rule SCR204 prints the same page in the terminal. Source: docs/rules/SCR204.md.