Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:appnote:an007 [2017/05/02 14:37] – [Creare una visualizzazione mista non ricorsiva] qem103 | en:appnote:an007 [2019/08/29 17:01] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 476: | Line 476: | ||
</ | </ | ||
- | ==== Diagnostica Ingressi | + | ==== Diagnostic Inputs |
- | Si voglia creare una visualizzazione che rappresenti lo stato di 9 ingressi digitali. Lo stesso esempio potrà essere poi utilizzato per la rappresentazione di uscite digitali. Assegneremo perciò, ad ogni ingresso, uno dei segmenti di ciascuno dei tre digit più a destra e lo attiveremo quando il corrispondente ingresso sarà attivo.\\ | + | You want to create a view that represents the State of 9 digital inputs. The same example can be used for the representation of digital outputs. We will assign to each input, one of the segments of each of the three rightmost |
- | La figura mostra l' | + | The figure shows the assignment chose for the inputs and segments of the digits of the display: |
{{: | {{: | ||
- | Innanzitutto dichiareremo, nella unit di configurazione, 9 variabili di dimensione | + | First we will declare, in the configuration |
<code QCL> | <code QCL> | ||
Line 498: | Line 498: | ||
</ | </ | ||
- | Dichiareremo poi anche un array global | + | We will declare a global |
<code QCL> | <code QCL> | ||
ARRGBL | ARRGBL | ||
- | diagnTab B 8 ; | + | diagnTab B 8 ; |
</ | </ | ||
- | Infatti per ogni gruppo di tre ingressi associati ad uno dei tre digit sul display | + | In fact, for each group of three inputs associated with one of the three digits on the display |
^I7^I8^I9^Display^ | ^I7^I8^I9^Display^ | ||
Line 517: | Line 517: | ||
|1|1|1|$| | |1|1|1|$| | ||
- | Servirà infine anche la definizione di alcune costanti da utilizzare come maschera per bit generici di un byte: | + | Will finally also defining some constants to be used as a mask for generic bits of a byte: |
<code QCL> | <code QCL> | ||
Line 533: | Line 533: | ||
</ | </ | ||
- | Il codice completo per ottenere la funzione di diagnostica è: | + | The complete code to obtain the diagnostic function is: |
<code QCL> | <code QCL> | ||
- | ;inizializza tabella | + | ;Initializes table |
diagnTab[1] = CHAR_ | diagnTab[1] = CHAR_ | ||
diagnTab[2] = CHAR_UP | diagnTab[2] = CHAR_UP | ||
Line 546: | Line 546: | ||
diagnTab[8] = CHAR_LOWUPCE | diagnTab[8] = CHAR_LOWUPCE | ||
- | ;stampa messaggio | + | ;print " |
hmi:dis6 = CHAR_I | hmi:dis6 = CHAR_I | ||
hmi:dis5 = CHAR_N | hmi:dis5 = CHAR_N |