DEVICE MMIQ
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.
1.1 Installazione
1.1.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). |
1.1.1.1 Example
;-------------------------------- ; Internal device declaration ;-------------------------------- INTDEVICE DEV MMIQ 0001
1.2 Operation
1.2.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.
1.2.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.
1.3 Commands and parameters table
1.3.1 Symbols used
The name of the parameter, state or command is shown at the left of the table.
R
Indicates if the parameter or state is retentive (upon initialization of the device maintains the previously defined state), or the state assumes upon initialization of the device.
If the device does not need to initialize the “R” field indicates the value that the parameter or state take to the power on of the card.
R = Retentive
0 = Upon initialization of the device the value is forced to zero.
1 = Upon initialization of the device the value is forced to one.
- = Upon initialization of the device is presented significant value.
D
Indicates the size of the parameter.
F = Flag
B = Byte
W = Word
L = Long
S = Single Float
1.3.1.1 Conditions
Are described all the conditions that must exist is considered correct or because the command is accepted.
In some cases, limit values are specified for the acceptance of the parameter: If there are any values outside the limits set, the data is in any case accepted; therefore appropriate controls of the application must be provided to ensure the proper functioning.
To run a command, all conditions must be met; otherwise the command is not sent.
A
Indicates the access mode.
R = Read.
W = Write.
R-W= Read / Write.
1.3.2 Commands / Parameters for the keyboard
Name | D | R | A | Conditions | Description |
---|---|---|---|---|---|
key | L | - | R | - | Key Represents the state of the keys at all times. Each key is represented by one bit. For the bit assignments refer to the following: 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 Represents the state of the function keys at all times. Each key is represented by one bit. For the bit assignments refer to the following: 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 |
1.3.3 Commands / Parameters for the leds
Name | D | R | A | Conditions | Description |
---|---|---|---|---|---|
leds | L | 0 | R-W | - | Leds status Parameter that is used to turn on the function key LED. Every bit of this parameter is associated with a LED. For the value associated with keyf parameter. |
blinkleds | L | 0 | R-W | - | Blink Leds status Parameter used to blink the leds of function keys. Every bit of this parameter is associated with a LED. For the value associated with keyf parameter. N.B. Because an led can blink You must bind the value for that led both the leds parameter that the blinkleds parameter. |
1.3.4 Generic Commands / Parameters
Name | D | R | A | Conditions | Description |
---|---|---|---|---|---|
language | B | R | R-W | - | Language Parameter to set the language to view. Values range from 0 to the number of languages introduced -1. |
Reverse | B | R | R-W | Not manage in the non-graphical display | Reverse Parameter to set the reverse mode of the display. Range 0÷1 |
contrast | W | R | R-W | - | Contrast Parameter to set the contrast of the display. Range 1÷99. Default=33 For values that are near to 99 the display appears dark, While for values that are near to 1 it is clear. |
clrtime | W | R | R-W | - | Clear time Parameter to set the time associated with the CLEAR key. When inserting a data, if the CLEAR button is pressed for more than that time, the data introduced will be reset. |
error | B | 0 | R | - | Error Indicates if there are any errors in device. In detail: 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 Indicates the percentage of memory used to store the QPaint application files. |
1.4 Limitations
No limitation.
1.5 Application example
; Switching ON of a LED at the function key pressed ; (only power ON the F1 LED and everyone else power OFF). IF DEV:keyf EQ KEY_F1 DEV:leds = KEY_F1 ELSE DEV:keyf EQ KEY_F1 ENDIF ; Swithing ON of two LED at the two function keys pressed ; (is only ON/OFF the LED relative to the key pressed). 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