Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

Local variables are variables, that are valid within a picture instance. It means that the same picture, opened on several consoles (processes D2000 HI) at the same time, uses its copies of local variables. Local variable are visible within the picture script, in the system level are not available. They can be connected to graphic object and Windows controls.
There are four five categories of picture local variables:


  • Basic local variables – they have no special features and can be connected to object and manipulate the object value.
  • Input-output local variables – they allow to give parameters to the picture opened from other picture in both directions.
  • Reference local variables - they are used for identification of graphic objects and Windows controls. Such variables are used as unique identifiers of these objects within the picture script.
  • Indexed - they are used to handle current displayed row of structured variable connected to graphic object to view.
  • External - as Basic, ale sú parametrizovateľné z rodičovskej schémy


Configuration of local variables

...

Clicking the button from the Main toolbar opens the dialog box allowing to configure local variables.

Image RemovedImage Added


Definition of a local variable consists of the following attributes:


First columnThe column is used to select given local variable in the list. Double-click on the column corresponds to clicking the button OK in the dialog window. After inserting graphic objects from clipboard into picture, the column shows symbols for added local variable or name or definition conflict.
Variable nameLocal variable name. The name can be used either for connection to picture graphic object or in the picture script. The name must begins with the character '_' (underline)
.Value typeLocal variable value type. Possible types:
  • BOOL - binary, logical variable
  • INT - integer variable
  • REAL - real variable
  • TIME - variable of Absolute time type
  • TEXT - text variable
  • STRUCT - structured variable
ValueThe attribute is valid only for reference variable and defines its value for use in the picture script
.

Kotva
kategoria
kategoria
Category

Category of the local variable. According to selected category, local variables in the list are shown in corresponding colors:
  • Image Modified LOCAL - basic local variable
  • Image Modified INOUT - input-output local variable used for passing parameters between pictures
  • Image Modified REFID - reference local variable used for object identification in picture script
  • Image Modified INDEX - indexed local variable that specifies a row of structured variable
Value typeLocal variable value type. Possible types:
  • BOOL - binary, logical variable
  • INT - integer variable
  • REAL - real variable
  • TIME - variable of Absolute time type
  • TEXT - text variable
  • STRUCT - structured variable
StructureThe attribute is valid only for the value type STRUCT and defines the object of Structure definitiontype, that determines the type of structured local variable.
The attribute is also valid for index local variable that handles a filter (detailed description in index local variables below).
Value
  • for reference variable and defines its value for use in the picture script.
  • for loval and external variables its their start value
Filter type
Filter
  • filter type of index local variable (detailed description in index local variables below).
  • parameter pre lokálne a externe premenné:
    • No start value - bez štartovacej hodnoty
    • Passive - pasívna štartovacia hodnota - iba sa nastaví pri otvorení schémy
    • Active - aktívna štartovacia hodnota  - pri kliknutí nad viditeľným, nezakázaným grafickým objektom používajúcim lokálnu premennú na zobrazenie sa do nej automaticky nastaví hodnota interného identifikátora objektu v D2000 prezentovaná výrazom MyValue. Táto hodnota sa dá použiť v zobrazovacích paletách použitím výrazu MyValue v stavovom skripte riadku palety.
Status textObject of Status text type, that will be used for displaying the value of the local variable when it is connected to graphic object.

Poznámka:  položky ktoré nemajú význam sú nedostupné a majú označenie ---

Use of local variables

...


Kotva
basic
basic
Basic variables
They are used for connect to graphic objects / Windows controls. Connection is being performed in the palette Connect object - the tab Connect. Using such a connected local variable allows to read or modify the object contents.
Kotva
in_out
in_out
Input-output variables
They are used for parameter passing among pictures. Among pictures they are paired by name - when a picture is being opened from mother picture, the contents of mother picture variables is copied into input-output variables with the same names in the opened picture. Before closing the new picture, new contents of the input-output variables is copied to corresponding mother picture variables.
Kotva
reference
reference
Reference variables

They are used to name (identification) objects. There are three cases, you need to identify an object:

  • when you need to call an object function
  • when you define an object event handler
  • when you detect the event source in generic event handler

 

- e.g. %HI_SetText(_N1, "Text")
- e.g. ENTRY N1_OnClick

- e.g. ENTRY OnClick(IN INT _RefID)
              IF _RefID = _N1 THEN


Kotva
indexed
indexed
Indexed variables

They are used to handle current displayed row of structured variable connected to graphic object to view. Handling the value of indexed variable from the picture script you can change current connected structure row. The change of value in the picture ensures the change of value of variable but not the connected row of structure.

Index variables can handle so-called filter. Filter allows optimization of the communication between the processes D2000 Server and D2000 HI by distribution of the values of the row defined by the indexed variable and not the values of whole structured variable. In the case, the indexed variable must be bound with an structured variable using the attribute Structure. Filter type is defined in the attribute Filter type:

  • No filter - filtering is disabled - there are distributed value changes of all rows.
  • Passive - filtering is enabled. Initial value of the indexed variable is not defined - it must be initialized in the picture script. While no value of the indexed variable is defined no change of filtered structured variable is not distributed.
  • Active - filtering is enabled. Initial value of the indexed variable is automatically set according the picture instance. After opening the picture, the distributed value of the filtered structure row is according the picture instance number.

When the filtering is enabled, value distribution can be also handled by the functions %HI_OpenRow, %HI_CloseRow, %HI_ChangeRow.

External variablesHodnoty externých premenných sú parametrizovateľné z rodičovskej schémy, ktorá zobrazuje túto schému v zobrazovači ako podschému. Pri parametrizácii z rodičovskej schémy je na takúto externú premennú možné naviazať inú premennú a externá premenná potom reprezentuje hodnotu tejto naviazanej premennej. Akákoľvek zmena naviazanej premennej sa teda premietne do zmeny hodnoty externej premennej. Väzba je obojsmerná, takže aj zmena externej premennej spôsobí zmenu naviazanej premennej. Externé premenné sa typicky používajú v prípade, keď je schéma použivaná ako komponent. Externé premenné je možné pripájať ku grafickým objektom rovnako ako základné premenné.


Note:
List of local variables is sorted first by category (the column Category) and then by name (the column Variable name). Dialog box of local variables keeps the last sorting when it is reopened.
When a conflict is occurred (see the chapter Inserting graphic objects from clipboard into picture), the list is sorted only by name.
Clicking on header of some column classifies the list downwardly, next clicking classifies it upwardly.
When the local variable is editing from the Connect object palette, tab Script, the appropriate row in the dialog window of local variables is color highlighted (gray color).