System variablesPermalink

Implicit variables

The following implicitely created system variables can be used to program a visualization:

Implicitely generated variable

Data type

 

Function

Currently usable in

HMI

Currently usable in

Simulation

Currently usable in

Target Visu

Currently usable in

WebVisu

CurrentVisu                                   

String[40]

Name of the currently opened visualization. If the name gets changed, a change to another visualization will be done.

Note: With compiler versions < V2.3.7.0 the name string MUST be defined in capital letters. With compiler versions as from V2.3.7.0 the string can be defined in small letters IF the library SysLibStr.lib is included in the project.

Depending on the target system this variable can be activated/deactivated in the Target Settings dialog, category Visualization.

x

x

x

x

CurrentCaller

String[40]

Name of the previously opened visualization. Is used for the ZOOMTOCALLER functionality. Only set and modified in TargetVisu.

-

-

x

-

CurrentLanguage

String[40]

Currently set language, available in the language file. The language. Only set and modified in TargetVisu.

-

-

x

-

CurrentUserLevel *

INT

Currently set user level 0..7.

x

x

x

x

CurrentPasswords[0 .. 7] *

 

ARRAY [0..7]

of String[20]

All passwords which are defined in "Usergroup passwords".

x

x

x

x

CurrentWriteAccessClientId

DWORD

ID of the visualization client which in a multi-client operation currently has the write access on the PLC data

-

-

x

x

CurrentClientId

DWORD

 ID of the current visualization client

-

-

x

x

Implicit variables as remanent variables:

The implicit variables of a target visualization can be declared as remanent variables :

For this purpose the variables must be declared explicitly as global variables. This declaration MUST be done in the topmost (alphabetic order) global variables list in folder 'Global Variables' in the Resources tab. If the declaration is placed in another global variable list, a compile error will occur.

⮫ “Global variables”

Example:

VAR_GLOBAL RETAIN

 VisuDoExecuteUserlevelInit : BOOL := TRUE;

 CurrentUserLevel : INT := 0;

 CurrentPasswords : ARRAY[0..7] OF STRING[20] := 'a','b','c','d','e','f','g','h';

END_VAR

* Regard for the variables CurrentUserLevel, CurrentPasswords[...]: Those must be of the same type (normal, RETAIN, PERSISTENT...)! If they are defined as remanent variables, additionally a variable "VisuDoExecuteUserlevelInit" of type BOOL must be declared as a RETAIN variable in the global variables list, initialized with TRUE (" VisuDoExecuteUserlevelInit : BOOL := TRUE;").