Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
en:software:qview:qview_6:qview60 [2015/04/28 15:47] – [3.11.1. Variabili Statiche] qem207 | en:software:qview:qview_6:qview60 [2015/04/28 16:06] – [3.11.2. Indexed Variables] qem207 | ||
---|---|---|---|
Line 560: | Line 560: | ||
^Recipe 100| | | | | ^Recipe 100| | | | | ||
+ | ==== - Indexed Variables ==== | ||
+ | <code QCL> | ||
+ | DATAGROUP | ||
+ | < | ||
+ | DATAPROGRAM | ||
+ | <number of recipes> | ||
+ | STEP | ||
+ | <number of steps> | ||
+ | ;Indexed variables declaration | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | Indexed variables reside in DATAGROUP subsector named STEP. Their function is to introduce for each recipe, the concept of step. The first value of this sector is a number or an integer constant, and represents the number of steps for each recipe in archive. Indexed variables are to be considered as containers of a list of values for each recipe, and are accessed as a 2-dimensional array, where the first value is the number of the recipe, the second the number of desired step. Example: | ||
+ | <code QCL> | ||
+ | DATAGROUP | ||
+ | Name | ||
+ | DATAPROGRAM | ||
+ | 100 | ||
+ | ;Static variables declaration | ||
+ | Variable1 | ||
+ | Variable2 | ||
+ | Variable3 | ||
+ | STEP | ||
+ | 10 | ||
+ | ;Indexed variables declaration | ||
+ | Variable4 | ||
+ | Variable5 | ||
+ | </ | ||
+ | To refer to variable // | ||
+ | <code QCL> | ||
+ | Variable4[5, | ||
+ | </ | ||
+ | |||
+ | We can imagine the memory structure of a variable DATAGROUP, in our example with static and indexed variables, as the following table: | ||
+ | |||
+ | ^ ^ Variable1 | ||
+ | ^Recipe 1| | | | | | | | | | | | | | | ||
+ | ^::: | ||
+ | ^Recipe 2| | | | | | | | | | | | | | | ||
+ | ^::: | ||
+ | ^Recipe 3| | | | | | | | | | | | | | | ||
+ | ^::: | ||
+ | ^...| | | | | | | | | | | | | | | ||
+ | ^::: | ||
+ | ^Recipe 100| | | | | | | | | | | | | | | ||
+ | ^::: | ||
+ | |||
+ | Other informations: | ||
+ | * In a DATAGROUP all variables, both static and indexed, are retentive (maintain the value at power off). | ||
+ | * The Datagroup variables may be more than one, in this case it is necessary to insert more DATAGROUP keywords. | ||
+ | * The subsection DATAPROGRAM is mandatory, while the STEP is optional. | ||
+ | * The maximum number of recipes can be set is 65534. | ||
+ | * The maximum number of steps can be set is 65534. | ||
+ | * Compared to a common array, static variables can also support a Flag size data (F). | ||
===== - DATAGROUP variables old ===== | ===== - DATAGROUP variables old ===== | ||
Datagroup variables are a special data structures. When declaring a datagroup, a part of memory is organised in a table of rows and columns. The columns are called | Datagroup variables are a special data structures. When declaring a datagroup, a part of memory is organised in a table of rows and columns. The columns are called |