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:18] – qem202 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | PRELIMINARE/ | ||
- | |||
====== QVIEW 6.0 ======= | ====== QVIEW 6.0 ======= | ||
Line 560: | Line 558: | ||
^Recipe 100| | | | | ^Recipe 100| | | | | ||
- | ===== - DATAGROUP variables old ===== | + | ==== - Indexed Variables |
- | 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 | + | |
- | Each program (column) contains 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] | + | |
- | </ | + | |
- | + | ||
- | Indexed variables can have different values according to their program (column) and step (row) reference. In the declaration, | + | |
- | + | ||
- | <code QCL> | + | |
- | ddwLuPe[5, | + | |
- | </ | + | |
- | + | ||
- | 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, | + | |
- | ^Step 2|ddwLuPe[1, | + | |
- | ^Step 3|ddwLuPe[1, | + | |
- | ^Step 4|_|_|_|_|ddwLuPe[5, | + | |
- | ^Step 5|_|_|_|_|ddwLuPe[5, | + | |
- | In the two, static and indexed, datagroup sections several variables can be declared. | + | |
- | + | ||
- | The syntax for defining DATAGROUP variables: | + | |
<code QCL> | <code QCL> | ||
DATAGROUP | DATAGROUP | ||
< | < | ||
- | [;Number of programs (or recipe) | ||
DATAPROGRAM | DATAPROGRAM | ||
- | <number of programs> | + | <number of recipes> |
- | ;Static variables declaration | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | [;Number of steps | + | |
STEP | STEP | ||
<number of steps> | <number of steps> | ||
Line 605: | Line 569: | ||
< | < | ||
< | < | ||
- | < | + | < |
</ | </ | ||
- | dove: | + | Indexed |
- | |DATAGROUP|Keyword for defining a DataGroup.| | + | |
- | |< | + | |
- | |DATAPROGRAM|Keyword for defining the static | + | |
- | |<number of programs> | + | |
- | |< | + | |
- | |< | + | |
- | |STEP|Keyword for defining indexed variables in the DataGroup.| | + | |
- | |<number of steps> | + | |
- | |< | + | |
- | |< | + | |
- | + | ||
- | The DATAGROUP definition | + | |
- | * 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 | + | |
- | + | ||
- | The number | + | |
- | + | ||
- | The DATAPROGRAM subsection is mandatory, while the STEP subsection is optional. | + | |
- | + | ||
- | A STEP section cannot | + | |
- | All static | + | |
- | + | ||
- | To calculate | + | |
- | + | ||
- | (N.Programs x N.Static variables x 4 ) + ( N.Programs x N.Steps x N.Indexed variables x 4).\\ | + | |
- | Example: | + | |
<code QCL> | <code QCL> | ||
DATAGROUP | DATAGROUP | ||
- | | + | |
DATAPROGRAM | DATAPROGRAM | ||
- | | + | |
- | ;--------------Static variables declaration------------------ | + | ;Static variables declaration |
- | | + | |
- | | + | |
+ | Variable3 | ||
STEP | STEP | ||
- | | + | |
- | ;--------------Indexed variables declaration------------- | + | ;Indexed variables declaration |
- | | + | |
- | | + | |
</ | </ | ||
- | + | To refer to variable // | |
- | + | ||
- | Syntax for static variables: | + | |
<code QCL> | <code QCL> | ||
- | < Nome variabile Static > < [ num_prog | + | Variable4[5, 9] |
</ | </ | ||
- | Syntax for indexed variables: | + | We can imagine the memory structure of a variable DATAGROUP, in our example with static and indexed variables, as the following table: |
- | <code QCL> | + | |
- | < Nome variabile Index > < [ num_prog, num_step ] > | + | ^ ^ 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). | ||
- | // | ||
===== - 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.\\ |