en:software:qview:qview_6:qview60

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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] qem207en: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
 +  <DataGroup Name>
 +  DATAPROGRAM
 +    <number of recipes>
 +  STEP
 +    <number of steps>
 +;Indexed variables declaration
 +    <variable name> <F/B/W/L/S>
 +    <variable name> <F/B/W/L/S>
 +    <variable name> <F/B/W/L/S>
 +</code>
 +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     L
 +    Variable2     S
 +    Variable3     F
 +  STEP
 +    10
 +;Indexed variables declaration
 +    Variable4     W
 +    Variable5     B
 +</code>
 +To refer to variable //Variable4// in recipe 5 to step 9, the used code is:
 +<code QCL>
 +Variable4[5, 9]
 +</code>
 +
 +We can imagine the memory structure of a variable DATAGROUP, in our example with static and indexed variables, as the following table:
 +
 +^ ^  Variable1  ^  Variable2  ^  Variable3  ^  Variable4  ^^^^^  Variable5  ^^^^^
 +^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  //programs// or //recipes//, while the rows are //steps//.\\ 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  //programs// or //recipes//, while the rows are //steps//.\\
  • Last modified: 2022/08/31 09:02