Skip to main content

Script Management

Script Management maintains runtime scripts used by configured variables, memory calculations, forwarding templates, dynamic database storage, and MQTT RPC. A saved script takes effect only after it compiles successfully.

This page explains the Web operation workflow. For script syntax, available types, and complete examples, see Script Development Reference.

Key Terms

TermDescription
Local scriptA script saved in the current project. It can be edited, compiled, or deleted.
Loaded scriptA compiled script currently available to runtime configuration.
CompileChecks whether the script can be loaded and used by GatewayRuntime.
CategoryA label used to group and filter scripts.
Input parameterA configurable value exposed by the script, such as a threshold or scale factor.

Log in to GatewayRuntime Web and open Development Configuration → Script Management.

Script management page

Page Layout

AreaDescription
Local ScriptsLists scripts saved in the current project and provides create, edit, compile, delete, and batch operations.
Loaded ScriptsShows scripts currently available to runtime configuration. Use this tab to confirm that a compilation result has been loaded.
Category filterFilters scripts by category.
SearchSearches by script name.
ToolbarProvides create, batch compile, batch delete, and refresh actions.

List Fields

FieldDescription
SelectionSelects scripts for batch compilation or deletion.
NameScript name used by configuration selectors.
CategoryScript grouping label.
TypeIntended runtime use of the script.
Updated timeTime of the most recent save or compilation.
ActionsEdit, compile, or delete the selected script.

Create a Script

Click the create button and complete the creation dialog.

Create script dialog

FieldDescription
Script typeSelect the intended use. The available editor and parameter fields change with the selected type.
NameRequired and unique in the current project. Use a stable business-oriented name.
CategoryOptional grouping label for search and maintenance.

After creation, the script editor opens automatically.

Script Types

TypeTypical use
Data transformationConverts collected values before they are stored or forwarded.
Memory variable calculationCalculates a memory variable from other runtime values.
Dynamic modelProduces a custom forwarding object from variable, device, alarm, or plug-in event data.
Dynamic SQLControls custom database table or write behavior.
MQTT RPCProcesses an MQTT message and prepares the agreed response.
Full sourceAdvanced extension option. Confirm its runtime and maintenance impact before use.

Select the type required by the target configuration. Do not change an existing script to an unrelated purpose merely because the editor accepts the content.

Script Editor

The editor contains a top action bar, an editing area, and a bottom information panel.

Script editor

AreaDescription
BackReturns to the script list. Compile and save required changes before leaving.
Undo / redoReverts or reapplies recent editor changes.
Compile and saveCompiles the current content. A successful result is saved and loaded for runtime use.
Editing areaMaintains the current script content.
Bottom panelShows compilation messages, script information, and input parameters.

Bottom Panel

TabDescription
Compilation logShows errors, warnings, and successful compilation output. Select a diagnostic item to locate the related editor position.
Script informationMaintains the script name and category.
Input parametersMaintains configurable values exposed to the script.

Input Parameter Fields

FieldDescription
NameParameter identifier. Keep it stable after the script is referenced.
Display nameLabel shown in configuration pages.
TypeString, Boolean, integer, decimal, or another supported value type.
Default valueValue used when a configuration does not provide an override.
DescriptionOperational meaning, unit, valid range, and safety notes.

Compilation Log

Click Compile and Save and review the Compilation Log tab.

Script compilation log

MessageMeaning
Compilation startedA new compilation has started for the displayed script.
ErrorThe script cannot be loaded. Resolve the first error before reviewing dependent messages.
WarningCompilation may continue, but the warning should be reviewed before deployment.
Compilation succeededThe current script passed compilation and is available for loading.

After a successful compilation, return to the list and refresh Loaded Scripts to confirm that the expected name and type are present.

Common Operations

OperationProcedure
EditSelect Edit, make the approved change, then click Compile and Save.
Compile one scriptSelect Compile in the script row to validate the saved content.
Batch compileSelect multiple scripts and use the batch compile button. This is useful after a runtime upgrade.
DeleteConfirm that no variable, forwarding target, or rule still references the script, then delete it.
RefreshReload local and loaded script information after compilation or runtime changes.

Operational Notes

ScenarioRecommendation
Production changeBack up the project and validate the change with test data before applying it to active acquisition or control points.
Compilation failureReview the first error. Later messages are often consequences of the first failure.
Script not listed as loadedConfirm successful compilation, refresh the Loaded Scripts tab, and verify the selected script type.
Referenced script deletionReplace or remove all references before deletion to prevent affected variables or forwarding targets from failing.
AOT deploymentDynamic compilation availability depends on the deployed package. Complete script validation before deployment.