This is an old revision of the document!
DEVICE MMIQ
0.1 Introduction
The MMIQ device is need to create a human-machine interface system (HMI) programmable using the development environment Qpaint.
The device provides a range of information on the interface panel with a speed of update can be set by means of the sampling time.
0.2 Installazione
0.2.1 DEVICE DECLARATION IN THE CONFIGURATION UNIT (.CNF)
In the configuration unit, in the BUS section, must be declared an instrument whose firmware contains the MMIQ device.
In the INTDEVICE section must be add the following definition:
;--------------------------------- ; Internal device declaration ;--------------------------------- INTDEVICE <device name> MMIQ TCamp
where:
<device name> | The name assigned to the device. |
MMIQ | Keyword that identifies the device. |
Tcamp | Time sampling device (1÷10 ms). |
0.2.1.1 Example
;-------------------------------- ; Internal device declaration ;-------------------------------- INTDEVICE DEV MMIQ 0001
0.3 Operation
0.3.1 KEYSTROKES
The key and keyf parameters are used to recognise which key was pressed. The values associated with each key are given in the chapter of this manual “Commands and parameters”.
Any bit of the key and keyf parameters is associated with a button, so if you want to determine the pressing of several keys it helps to check that these parameters assume a value equal to the sum of the values associated with the keys.
0.3.2 LEDS
The leds and blinkleds parameters are used to access (or flashing) and turn off the leds on the keyboard.
Normally there is one led for each function key.
To access (or flashing) and turn off the led you must assign to the code associated with the function key.
Every bit of the leds and blinkleds parameters is associated with an led.
0.4 Commands and parameters table
0.4.1 Simbologia adottata
Il nome del parametro, stato o comando è riportato alla sinistra della tabella.
R
Indica se il relativo parametro o stato è ritentivo (al momento dellinizializzazione del device
mantiene lo stato precedentemente definito), oppure lo stato che assume al momento
dellinizializzazione del device.
Se il device non necessita d'inizializzazione il campo R indica il valore che il parametro o
stato assume allaccensione della scheda.
R = Ritentivo
0 = Al momento dellinizializzazione del device il valore è forzato a zero.
1 = Al momento dellinizializzazione del device il valore è forzato a uno.
- = Al momento dellinizializzazione del device è presentato il valore significativo.
D
Indica la dimensione del parametro.
F = Flag
B = Byte
W = Word
L = Long
S = Single Float
0.4.1.1 Condizioni
Sono descritte tutte le condizioni necessarie affinché il parametro sia considerato corretto o perché il comando sia accettato.
In alcuni casi sono specificati dei valori limite per laccettazione del parametro: se sono introdotti
dei valori esterni ai limiti impostati, il dato è in ogni caso accettato; pertanto devono
essere previsti opportuni controlli dellapplicativo tali da garantire il corretto funzionamento.
Per lesecuzione di un comando, tutte le relative condizioni devono necessariamente essere
soddisfatte; in caso contrario il comando non è inviato.
A
Indica il modo d'accesso.
R = Read (lettura).
W = Write (scrittura).
R-W= Read / Write.
0.4.2 Comandi / Parametri per la tastiera
Nome | D | R | A | Condizioni | Descrizione |
---|---|---|---|---|---|
key | L | - | R | - | Key Rappresenta in ogni istante lo stato dei tasti. Ogni tasto è rappresentato da un bit. Per lassegnazione dei bit fare riferimento a quanto segue: KEY_1 268435456 KEY_2 1048576 KEY_3 4096 KEY_4 536870912 KEY_5 2097152 KEY_6 8192 KEY_7 1073741824 KEY_8 4194304 KEY_9 16384 KEY_0 8388608 KEY_CLR -2147483648 KEY_ENTER 128 KEY_HELP 64 KEY_DECPT 32 KEY_SIGN 16 KEY_ESC 33554432 KEY_UP 131072 KEY_PGUP 512 KEY_LEFT 67108864 KEY_NEXT 262144 KEY_RIGHT 1024 KEY_INS 134217728 KEY_DOWN 524288 KEY_PGDN 2048 |
keyf | L | - | R | - | Function Key Rappresenta in ogni istante lo stato dei tasti funzione. Ogni tasto è rappresentato da un bit. Per lassegnazione dei bit fare riferimento a quanto segue: KEY_F1 33554432 KEY_F2 67108864 KEY_F3 134217728 KEY_F4 268435456 KEY_F5 536870912 KEY_F6 131072 KEY_F7 262144 KEY_F8 524288 KEY_F9 1048576 KEY_F10 2097152 KEY_F11 1 KEY_F12 2 KEY_F13 4 |
0.4.3 Comandi / Parametri per i leds
Nome | D | R | A | Condizioni | Descrizione |
---|---|---|---|---|---|
leds | L | 0 | R-W | - | Leds status Parametro utilizzato per accendere i LED dei tasti funzione. Ogni bit del parametro è associato un LED. Per il valore associato al parametro keyf. |
blinkleds | L | 0 | R-W | - | Blink Leds status Parametro utilizzato per far lampeggiare i LED dei tasti funzione. Ogni bit del parametro è associato un LED. Per il valore associato al parametro keyf. N.B. Perché un led possa lampeggiare è necessario associare il valore relativo a quel led sia al parametro leds che al parametro blinkleds. |
0.4.4 Comandi / Parametri generici
Nome | D | R | A | Condizioni | Descrizione |
---|---|---|---|---|---|
language | B | R | R-W | - | Language Parametro per impostare la lingua da visualizzare. I valori vanno da 0 al numero di lingue introdotto -1. |
Reverse | B | R | R-W | Non gestito nei display non grafici | Reverse Parametro per impostare la modalità reverse del display. Range 0÷1 |
contrast | W | R | R-W | - | Contrast Parametro per impostare il contrasto del display. Range 1÷99. Default=33 Per valori prossimi a 99 il display appare scuro, mentre per valori prossimi a 1 appare chiaro. |
clrtime | W | R | R-W | - | Clear time Parametro per impostare il tempo associato del tasto CLEAR. Durante l'inserimento di un dato, se il tasto CLEAR viene premuto per più di quel tempo, il dato introdotto viene azzerato. |
error | B | 0 | R | - | Error Indica se vi sono errori nel device. In dettaglio: 0 = no error 1 = no application present 2 = checksum no match 3 = file format no match 4 = incorrect display size 5 = out of memory 6 = error readin the page 7 = error in erase operation 8 = internal error 9 = error in write memory 10 = error in read operation 11 = internal error 12 = image present but not possible 13 = font not supported 14 = internal error |
memuse | B | 0 | R | - | Memory used Indica la percentuale di memoria utilizzata per memorizzare il file applicativo di QPAint. |
0.5 Limitazioni
Nessuna limitazione.
0.6 Esempio applicativo
; Accensione di un LED alla pressione del tasto funzione ; (si accende solo il LED F1 e tutti gli altri si spengono). IF DEV:keyf EQ KEY_F1 DEV:leds = KEY_F1 ELSE DEV:keyf EQ KEY_F1 ENDIF ; Accensione di due LED alla pressione di due tasti funzione ; (viene acceso/spento solo il LED relativo al tasto premuto). IF DEV:keyf EQ KEY_F1 DEV:leds = DEV:leds ORB KEY_F1 ELSE DEV:leds = DEV:leds ANDB (-1-KEY_F1) ENDIF IF DEV:keyf EQ KEY_F2 DEV:leds = DEV:leds ORB KEY_F2 ELSE DEV:leds = DEV:leds ANDB (-1-KEY_F2) ENDIF