Panel Initialization

This section describes panel initialization

To specify global constants, variables and functions that will be available in all Macro and Expression scripts located in a Panel, you need to specify them in the Panel initialization script.

To specify the Panel initialization script, open Panel Initialization dialog (Figure 1) by clicking on the toolbar icon (or choose Panel initialization from the Panel menu).

Figure 1: Panel Initialization dialog



HIL SCADA namespace can be initialized in three different ways:
  1. Level 1 initialization - initialization of the imports such us HIL API, Numpy, Scipy, etc... This initialization is run automatically each time a new Panel is opened or when Panel which was already saved is loaded.
  2. Level 2 initialization - Level 1 initialization + Panel initialization script. This initialization can be executed only before the simulation is started by clicking on the Run initialization script button inside the Panel Initialization dialog.
  3. Level 3 initialization - Level 2 initialization + local namespace initialization. This initialization is executed automatically each time before the simulation is started. Aditionally, this initialization can be started manually by clicking on Re-initialize namespace action ()
Note: In case you change the namespace (Panel initialization script or any local namespace) while the simulation is running, plese use the Re-initialize namespace action from the toolbar to update the current namespace (Level 3 initialization) without stopping the simulation.
Note: To use a variable specified in the global namespace (in Macro, Expression and Handler scripts) it is enough to use its name:

variable = GLOBAL_VARIABLE + 5
To change the value of a global variable, use this expression:
global GLOBAL_VARIABLE
GLOBAL_VARIABLE = 5

Note: Schematic Editor namespace is available in HIL SCADA global namespace and it is imported as a scm variable.
Note: HIL API is available in HIL SCADA global namespace and it is imported as a hil variable.