Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:software:qview:qview_6:qview60 [2015/04/28 15:49] – [3.11.1. Static Variables] qem207 | en:software:qview:qview_6:qview60 [2022/08/31 09:02] (current) – qem214 | ||
---|---|---|---|
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 | + | * In a DATAGROUP |
- | * Le variabili | + | * The Datagroup |
- | * La sottosezione | + | * The subsection |
- | * 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 | + | * Compared to a common |
- | ===== - DATAGROUP | + | |
- | Datagroup variables are a special | + | |
- | Each program | + | |
- | * 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> | ||
- | DATAGROUP | ||
- | < | ||
- | [;Number of programs (or recipe) | ||
- | DATAPROGRAM | ||
- | <number of programs> | ||
- | ;Static variables declaration | ||
- | < | ||
- | < | ||
- | < | ||
- | [;Number of steps | ||
- | STEP | ||
- | <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 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 | ||
- | 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.\\ | ||
Line 1307: | Line 1200: | ||
===== - Instructions for digital outputs ===== | ===== - Instructions for digital outputs ===== | ||
- | Instructions for activating or disactivating | + | Instructions for activating or deactivating |
(<output name>= 1), however dedicated instructions are faster. | (<output name>= 1), however dedicated instructions are faster. | ||
Line 1318: | Line 1211: | ||
==== - RESOUT ==== | ==== - RESOUT ==== | ||
- | Disactivate | + | Deactivate |
<code QCL> | <code QCL> | ||
RESOUT <output name> | RESOUT <output name> | ||
Line 3387: | Line 3280: | ||
A summary of the QCL keywords. | A summary of the QCL keywords. | ||
- | ^ ABS | absolute value | + | ^ ABS | absolute value | |
- | ^ ACOS | arc cosine | + | ^ ACOS | arc cosine |
- | ^ AND | logic AND | | + | ^ AND | logic AND |
- | ^ ANDB | bitwise logic And | | + | ^ ANDB | bitwise logic And |
- | ^ APPLICATION | + | ^ APPLICATION |
- | ^ ARRGBL | + | ^ ARRGBL |
- | ^ ARRSYS | + | ^ ARRSYS |
- | ^ ASIN | arc sine | + | ^ ASIN | arc sine | |
- | ^ ATAN | arc tangent | + | ^ ATAN | arc tangent |
- | ^ B | byte | + | ^ B | byte | |
- | ^ BEGIN | task unit code section | + | ^ BEGIN | task unit code section |
- | ^ BREAK | break | | + | ^ BREAK | break |
- | ^ BUS | configuration file section | + | ^ BUS | configuration file section |
- | ^ CALL | call to subroutine | + | ^ CALL | call to subroutine |
- | ^ CASE | SWITCH-CASE instruction | + | ^ CASE | SWITCH-CASE instruction |
- | ^ CEIL | Nearest integer rounding not less than the given value | | + | ^ CEIL | Nearest integer rounding not less than the given value | |
- | ^ CONST | configuration file section | + | ^ CONST | configuration file section |
- | ^ COS | cosine | + | ^ COS | cosine |
- | ^ COT | cotangent | + | ^ COT | cotangent |
- | ^ D | double precision | + | ^ D | double precision |
- | ^ DATAGROUP | + | ^ DATAGROUP |
- | ^ DATAPROGRAM | + | ^ DATAPROGRAM |
- | ^ DEVGROUP | + | ^ DEVGROUP |
- | ^ ELSE | Else in IF instruction | + | ^ ELSE | Else in IF instruction |
- | ^ END | task end | + | ^ END | task end | |
- | ^ ENDDEVGROUP | + | ^ ENDDEVGROUP |
- | ^ ENDIF | end of IF instruction | + | ^ ENDIF | end of IF instruction |
- | ^ ENDSUB | + | ^ ENDSUB |
- | ^ ENDSWITCH | + | ^ ENDSWITCH |
- | ^ ENDWHILE | + | ^ ENDWHILE |
- | ^ EQ | uguale | + | ^ EQ | uguale |
- | ^ EXP | exponential | + | ^ EXP | exponential |
- | ^ EXTDEVICE | + | ^ EXTDEVICE |
- | ^ F | flag | + | ^ F | flag | |
- | ^ FLOOR | Nearest integer rounding not greater than the value | | + | ^ FLOOR | Nearest integer rounding not greater than the value |
- | ^ FOR | FOR instruction | + | ^ FOR | FOR instruction |
- | ^ FPROG | FPROG instruction | + | ^ GE | greater or equal to |
- | ^ FSTEP | FSTEP instruction | + | ^ GLOBAL |
- | ^ GE | greater or equal to | | + | ^ GT | greater |
- | ^ GLOBAL | + | ^ IF | IF instruction |
- | ^ GT | greater | + | ^ INPUT | configuration file section |
- | ^ IF | IF instruction | + | ^ INTDEVICE |
- | ^ INPUT | configuration file section | + | ^ ISFINITE |
- | ^ INTDEVICE | + | ^ ISINF | checks if the given number is infinite |
- | ^ ISFINITE | + | ^ ISNAN | checks if the given number is NaN (Not a Number) |
- | ^ ISINF | + | ^ ISNORMAL |
- | ^ ISNAN | checks if the given number is NaN (Not a Number) | + | ^ JUMP | JUMP instruction |
- | ^ ISNORMAL | + | ^ L | long |
- | ^ JUMP | JUMP instruction | + | ^ LE | less or equal to | |
- | ^ LE | less or equal to | + | ^ LN | natural logarhythm |
- | ^ LN | natural logarhythm | + | ^ LT | less than |
- | ^ LT | less than | | + | ^ MULDIV |
- | ^ MULDIV | + | ^ NEG | negative sign (inversion of sign or two's complement) |
- | ^ NEG | negative sign (inversion of sign or two's complement) | + | ^ NEQ | operatore |
- | ^ NEQ | operatore | + | ^ NEXT | NEXT instruction |
- | ^ NEXT | NEXT instruction | + | ^ NOP | NOP instruction |
- | ^ NOP | NOP instruction | + | ^ NOT | not |
- | ^ NOT | not | | + | ^ NOTB | bitwise negation (one's complement) |
- | ^ NOTB | bitwise negation (one's complement) | + | ^ OR | logic OR | |
- | ^ OR | logic OR | + | ^ ORB | bitwise OR | |
- | ^ ORB | bitwise OR | + | ^ OUTPUT |
- | ^ OUTPUT | + | ^ POW | power of | |
- | ^ POW | power of | + | ^ REFERENCE |
- | ^ REFERENCE | + | ^ REFERENCES |
- | ^ REFERENCES | + | ^ RESOUT |
- | ^ RESOUT | + | ^ RESTART |
- | ^ RESTART | + | ^ RESUME |
- | ^ RESUME | + | ^ RETURN |
- | ^ RETURN | + | ^ RMULDIV |
- | ^ RMULDIV | + | ^ ROUND | Nearest integer rounding |
- | ^ ROUND | Nearest integer rounding | + | ^ S | single precision |
- | ^ S | single precision | + | ^ SETOUT |
- | ^ SETOUT | + | ^ SHLL | shift logical left | |
- | ^ SHLL | shift logical left | + | ^ SHLR | shift logical right |
- | ^ SHLR | shift logical right | | + | ^ SIN | sine | |
- | ^ SIN | sine | + | ^ SQRT | square root |
- | ^ SQRT | square root | | + | ^ STEP | configuration file section |
- | ^ STEP | configuration file section | + | ^ SUB | subroutine |
- | ^ SUB | subroutine | + | ^ SUSPEND |
- | ^ SUSPEND | + | ^ SWITCH |
- | ^ SWITCH | + | ^ SYSTEM |
- | ^ SYSTEM | + | ^ TAN | tangent |
- | ^ TAN | tangent | + | ^ TIMER | configuration file section |
- | ^ TIMER | configuration file section | + | ^ TRUNC | Nearest integer rounding not greater in magnitude |
- | ^ TRUNC | Nearest integer rounding not greater in magnitude | + | ^ W | word | |
- | ^ W | word | + | ^ WAIT | wait instruction |
- | ^ WAIT | wait instruction | + | ^ WHILE | while instruction |
- | ^ WHILE | while instruction | + | ^ XORB | bitwise exclusive OR | |
- | ^ XORB | bitwise exclusive OR | + | |