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:49] – [3.11.1. Static Variables] qem207en:software:qview:qview_6:qview60 [2015/04/28 16:07] – [3.12. DATAGROUP variables old] qem207
Line 573: Line 573:
     <variable name> <F/B/W/L/S>     <variable name> <F/B/W/L/S>
 </code> </code>
-Le variabili indicizzate risiedono nel sottosettore di DATAGROUP nominato come STEP. La loro funzione è quella di introdurre per ogni ricettail concetto di passoIl primo valore di questo settore è un numero o una costante interae indica il numero di passi per ogni ricetta dell'archivioLe variabili indicizzate sono da considerarsi come contenitori di una lista di valori per ogni ricettae sono accessibili come un array a 2 dimensionidove il primo valore è il numero di ricettail secondo il passo desiseratoEsempio:+Indexed variables reside in DATAGROUP subsector named STEP. Their function is to introduce for each recipethe concept of stepThe first value of this sector is a number or an integer constantand represents the number of steps for each recipe in archiveIndexed variables are to be considered as containers of a list of values for each recipeand are accessed as a 2-dimensional arraywhere the first value is the number of the recipethe second the number of desired stepExample:
 <code QCL> <code QCL>
 DATAGROUP DATAGROUP
Line 589: Line 589:
     Variable5     B     Variable5     B
 </code> </code>
-Per far riferimento alla variabile //Variable4// della ricetta al passo 9, viene usato il codice:+To refer to variable //Variable4// in recipe to step 9, the used code is:
 <code QCL> <code QCL>
 Variable4[5, 9] Variable4[5, 9]
 </code> </code>
  
-Possiamo immaginare la struttura della memoria di una variabile DATAGROUP, nel nostro esempio con variabili statiche e indicizzatecome la seguente tabella:+We can imagine the memory structure of a variable DATAGROUP, in our example with static and indexed variablesas the following table:
  
 ^ ^  Variable1  ^  Variable2  ^  Variable3  ^  Variable4  ^^^^^  Variable5  ^^^^^ ^ ^  Variable1  ^  Variable2  ^  Variable3  ^  Variable4  ^^^^^  Variable5  ^^^^^
-^Ricetta 1| | | | | | | | | | | | | |+^Recipe 1| | | | | | | | | | | | | |
 ^:::|:::|:::|:::| | | | | | | | | | | ^:::|:::|:::|:::| | | | | | | | | | |
-^Ricetta 2| | | | | | | | | | | | | |+^Recipe 2| | | | | | | | | | | | | |
 ^:::|:::|:::|:::| | | | | | | | | | | ^:::|:::|:::|:::| | | | | | | | | | |
-^Ricetta 3| | | | | | | | | | | | | |+^Recipe 3| | | | | | | | | | | | | |
 ^:::|:::|:::|:::| | | | | | | | | | | ^:::|:::|:::|:::| | | | | | | | | | |
 ^...| | | | | | | | | | | | | | ^...| | | | | | | | | | | | | |
 ^:::|:::|:::|:::| | | | | | | | | | | ^:::|:::|:::|:::| | | | | | | | | | |
-^Ricetta 100| | | | | | | | | | | | | |+^Recipe 100| | | | | | | | | | | | | |
 ^:::|:::|:::|:::| | | | | | | | | | | ^:::|:::|:::|:::| | | | | | | | | | |
  
-Altre informazioni+Other informations
-  * In un DATAGROUP tutte le variabilisia statiche che indicizzatesono ritentive (mantengono il valore allo spegnimento). +  * In DATAGROUP all variablesboth static and indexedare retentive (maintain the value at power off). 
-  * Le variabili Datagroup possono essere più di una, in questo caso è necessario inserire più parole chiave DATAGROUP. +  * The Datagroup variables may be more than one, in this case it is necessary to insert more DATAGROUP keywords
-  * La sottosezione DATAPROGRAM è obbligatoriamentre quella STEP è opzionale+  * The subsection DATAPROGRAM is mandatorywhile the STEP is optional
-  * Il numero massimo di ricette impostabile è 65534. +  * The maximum number of recipes can be set is 65534. 
-  * Il numero massimo di passi impostabile è 65534. +  * The maximum number of steps can be set is 65534. 
-  * Rispetto ad un comune array, le variabili statiche possono supportare anche un dato di dimensione Flag (F). +  * Compared to a common array, static variables can also support Flag size data (F).
-===== - DATAGROUP variables old ===== +
-Datagroup variables are 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//.\\ +
-Each program (columncontains two kinds of variable: +
-  * Static. +
-  * indexed.+
  
-Static variables can take on different values according to their program (column) reference. In the declaration each of these variables is identified by an individual name so, to be able to refer to different values that it can take on, indexing has to be used. For example, to refer to the //dslVeMa// variable of program (column) 5, use the code: 
- 
-<code QCL> 
-  dslVeMa[5] 
-</code> 
- 
-Indexed variables can have different values according to their program (column) and step (row) reference. In the declaration, each of these variables is identified by the same name so, to be able to refer to its different values, indexing must be used. For example, to refer to the “ddwLuPe” variable of program (column) 5 and step (row) 3, use the code: 
- 
-<code QCL> 
-  ddwLuPe[5,3] 
-</code> 
- 
-The datagroup is best represented as the chart below: 
-^_^Prog.1^Prog. 2^Prog. 3^Prog. 4^Prog. 5^_^ 
-^_|dslVeMa[1]|dslVeMa[2]|dslVeMa[3]|dslVeMa[4]|dslVeMa[5]^Static^ 
-^Step 1|ddwLuPe[1,1]|_|_|_|_^indexed^ 
-^Step 2|ddwLuPe[1,2]|_|_|_|_^:::^ 
-^Step 3|ddwLuPe[1,3]|_|_|_|ddwLuPe[5,3]^:::^ 
-^Step 4|_|_|_|_|ddwLuPe[5,4]^:::^ 
-^Step 5|_|_|_|_|ddwLuPe[5,5]^:::^ 
-In the two, static and indexed, datagroup sections several variables can be declared. 
- 
-The syntax for defining DATAGROUP variables: 
-<code QCL> 
-DATAGROUP 
-  <DataGroup Name> 
-[;Number of programs (or recipe) 
-  DATAPROGRAM 
-    <number of programs> 
-;Static variables declaration 
-    <variable name> <F/B/W/L/S> 
-    <variable name> <F/B/W/L/S> 
-    <variable name> <F/B/W/L/S>] 
-[;Number of steps 
-  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> 
-dove: 
-|DATAGROUP|Keyword for defining a DataGroup.| 
-|<DataGroup Name>|Name associated to the DataGroup.| 
-|DATAPROGRAM|Keyword for defining the static variables in the DataGroup.| 
-|<number of programs>|Number of programs (DataProgram) composing the DataGroup.| 
-|<variable name>|Name of the static variable in the DataGroup.| 
-|<F/B/W/L/S>|Static variable type| 
-|STEP|Keyword for defining indexed variables in the DataGroup.| 
-|<number of steps>|Number of steps comprising the DataGroup.| 
-|<variable name>|Name of the indexed variable in the DataGroup.| 
-|<F/B/W/L/S>|Indexed variable type| 
- 
-The DATAGROUP definition is made up of 3 parts: 
-  * the datagroup name definition; 
-  * the number of programs and static variables (starting with DATAPROGRAM); 
-  * the number of program steps and indexed variables (starting with keyword STEP). 
- 
-The datagroup name follows all the general rules for variable name syntax. 
- 
-The number of programs is written in number form, or with the aid of constants and must be different to zero. The maximum number of programs is 65534. 
- 
-The number of steps is written in number form, or with the aid of constants and must be different to zero. The maximum number of steps is 65534. 
- 
-The DATAPROGRAM subsection is mandatory, while the STEP subsection is optional. 
- 
-A STEP section cannot be declared without declaring at least one indexed variable. A STEP section can be declared without declaring a DATAPROGRAM section. A DATAPROGRAM cannot be declared without declaring at least one static variable. A DATAPROGRAM section can be declared without declaring a STEP section.\\ 
-All static and indexed variables in a DATAGROUP are retentive (i.e. they keep their value after a shut-off). 
- 
-To calculate the total memory space of the DATAGROUP consider that each variable in the datagroup takes up 4 bytes (regardless of the variable types). So the memory space in byte is equal to: 
- 
-(N.Programs x N.Static variables x 4 ) + ( N.Programs x N.Steps x N.Indexed variables x 4).\\ 
-Example: 
-<code QCL> 
-DATAGROUP 
-  dMyDataGrp            ;Datagroup name 
-  DATAPROGRAM 
-    DIM_PROG            ;Number of programs 
-    ;--------------Static variables declaration------------------ 
-    dsfStat1 F          ; 
-    dswStat2 W          ; 
-  STEP 
-    DIM_STEP            ;Number of step for each program 
-    ;--------------Indexed variables declaration------------- 
-    ddbDin1 B           ; 
-    ddlDin2 L           ; 
-</code> 
- 
- 
-Syntax for static variables: 
-<code QCL> 
-< Nome variabile Static > < [ num_prog ] > 
-</code> 
- 
-Syntax for indexed variables: 
-<code QCL> 
-< Nome variabile Index > < [ num_prog, num_step ] > 
-</code> 
- 
-//num_prog// and //num_step// can be a number (not SINGLE), a constant, variable or complex expression. In the case of number or constant, the compilation controls that the index is not over the maximum size declared in the configuration unit (by number of programs and number of steps respectively); the other indexes - //num_prog and num_step// - start from one. 
 ===== - BUS Section ===== ===== - BUS Section =====
 The BUS section in the configuration unit is essential to declare the QMOVE hardware model being used.\\ The BUS section in the configuration unit is essential to declare the QMOVE hardware model being used.\\
  • Last modified: 2022/08/31 09:02