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:49] – [3.11.1. Static Variables] 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 573: | Line 571: | ||
< | < | ||
</ | </ | ||
- | Le variabili indicizzate risiedono nel sottosettore di DATAGROUP | + | Indexed variables reside in DATAGROUP |
<code QCL> | <code QCL> | ||
DATAGROUP | DATAGROUP | ||
Line 589: | Line 587: | ||
Variable5 | Variable5 | ||
</ | </ | ||
- | Per far riferimento alla variabile | + | To refer to variable |
<code QCL> | <code QCL> | ||
Variable4[5, | Variable4[5, | ||
</ | </ | ||
- | Possiamo immaginare la struttura della memoria di una variabile | + | We can imagine the memory structure of a variable |
^ ^ Variable1 | ^ ^ Variable1 | ||
- | ^Ricetta | + | ^Recipe |
^::: | ^::: | ||
- | ^Ricetta | + | ^Recipe |
^::: | ^::: | ||
- | ^Ricetta | + | ^Recipe |
^::: | ^::: | ||
^...| | | | | | | | | | | | | | | ^...| | | | | | | | | | | | | | | ||
^::: | ^::: | ||
- | ^Ricetta | + | ^Recipe |
^::: | ^::: | ||
- | Altre informazioni: | + | Other informations: |
- | * In un DATAGROUP tutte le variabili, sia statiche che indicizzate, | + | * In a DATAGROUP |
- | * Le variabili Datagroup possono essere più di una, in questo caso è necessario inserire più parole chiave DATAGROUP. | + | * The Datagroup |
- | * La sottosezione DATAPROGRAM è obbligatoria, | + | |
- | * Il numero massimo di ricette impostabile è 65534. | + | * The maximum |
- | * Il numero massimo di passi impostabile è 65534. | + | |
- | * Rispetto ad un comune array, le variabili statiche possono supportare anche un dato di dimensione Flag (F). | + | * Compared to a common array, static |
- | ===== - DATAGROUP 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 | + | |
- | * Static. | + | |
- | * indexed. | + | |
- | + | ||
- | Static | + | |
- | + | ||
- | <code QCL> | + | |
- | dslVeMa[5] | + | |
- | </ | + | |
- | + | ||
- | Indexed variables can have different values according to their program (column) and step (row) reference. In the declaration, | + | |
- | + | ||
- | <code QCL> | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | The datagroup | + | |
- | ^_^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, | + | |
- | ^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> | + | |
- | DATAGROUP | + | |
- | < | + | |
- | [;Number of programs (or recipe) | + | |
- | DATAPROGRAM | + | |
- | <number of programs> | + | |
- | ;Static variables declaration | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | [;Number of steps | + | |
- | | + | |
- | <number of steps> | + | |
- | ;Indexed variables declaration | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | dove: | + | |
- | |DATAGROUP|Keyword for defining a DataGroup.| | + | |
- | |< | + | |
- | |DATAPROGRAM|Keyword for defining the static variables in the DataGroup.| | + | |
- | |<number of programs> | + | |
- | |< | + | |
- | |< | + | |
- | |STEP|Keyword for defining indexed variables in the DataGroup.| | + | |
- | |<number of steps> | + | |
- | |< | + | |
- | |< | + | |
- | + | ||
- | 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 | + | |
- | + | ||
- | 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 | + | |
- | All static and indexed variables in a DATAGROUP are retentive | + | |
- | + | ||
- | 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 | + | |
- | DATAPROGRAM | + | |
- | DIM_PROG | + | |
- | ; | + | |
- | dsfStat1 F ; | + | |
- | dswStat2 W ; | + | |
- | STEP | + | |
- | DIM_STEP | + | |
- | ; | + | |
- | ddbDin1 B ; | + | |
- | ddlDin2 L ; | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | Syntax for static variables: | + | |
- | <code QCL> | + | |
- | < Nome variabile Static > < [ num_prog ] > | + | |
- | </ | + | |
- | + | ||
- | Syntax for indexed variables: | + | |
- | <code QCL> | + | |
- | < Nome variabile Index > < [ num_prog, num_step ] > | + | |
- | </ | + | |
- | // | ||
===== - 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.\\ |