HMI Instruction
1、 Description of Serial Port
1-1 Working mode of the serial port
(UART is adopted. Each data transmission involves 11 bits, among which there is 1 start bit, 8 data bits, 1 SPACE parity bit and 1 stop bit. Baud rate could be set via one of the following 2 methods:)
(1),、With power supplied, if the I/O 0 lead pin of the terminal is at a high level or in a floating state, Baud rate will be the value preset by the user within the range of 1,200-115,200bps. For specific setting method, please refer to 0xE0 command. The factory default value is 115,200bps.
(2),、With power supplied, if the I/O 0 lead pin of the terminal is at a low level, the initial value of Baud rate will be 921,600bps. It may be alerted through 0xE0 command during use.
(Note: As above two setting methods, the default baud rate will be different if not setting the initial value while leaving the factory. But, after setting the baud rate and storing it, when power supplied again, the baud rate will be the set value.)
1-2 Data frame structure
The serial port data frame is composed of 4 data blocks, as stated in the following table:)
Data block |
1 |
2 |
3 |
4 |
5 |
Example |
0xAA |
0x70 |
0x01 |
Check_H:L(Optional) |
0xCC 0x33 0xC3 0x3C |
Description |
The frame header is fixed as 0xAA. |
Command |
Data length, 248 at most |
2-byte checksum |
Frame end mark (frame end) |
Notes: 2-byte checksum: It is enabled when PARA2.1=0 (to be set by 0xE0/E3 command or SD card). The calculation of checksum starts from command on, and ends at the last datum. The bytes are accumulative.
Example:Para2.1=1 AA 70 01 CC33 C33C The frame cumulative sum check is not enabled.)
Para2.1 =0 AA 70 01 00 71 CC33 C33C The frame cumulative sum check is enabled.
1-3 Communication frame buffer (FIFO)
HMI contains a communication frame buffer, which is of an FIFO structure. Users are allowed to transmit data to HMI continuously as long as the communication buffer is not overflowed.
The hardware BUSY lead pin indicates the state of FIFO buffer. When it is in a normal state, BUSY lead pin will be at a high level (RS232 electrical level has a negative voltage). When the FIFO buffer is filled, BUSY lead pin will shift to a low level (RS232 electrical level has a positive voltage). In such a case, users should stop transmitting data, and start again when BUSY recovers to the high level.
As for the ordinary application, as processing speed of HMI is very high, users do not have to judge the signal state of BUSY. However, as for applications which need to transmit several data frames within a short period of time (for instance, more than 1 hundred screen parameters are to be refreshed at a high speed in one time), it is recommended BUSY signal be used to control serial port transmission.
Notes: If there is “frame loss” observed during use of HMI by the user, which means some of the data fail to be displayed, the buffer might be over-flowed. In such a case, an oscilloscope will be needed to check whether the BUSY signal has changed. If it has, then the transmitting speed should be lowered, or the BUSY signal judgment processing speed of the hardware increased :
1-4 Byte transmission sequence
All the commands or data are in the hexadecimal format; as for the font (2 bytes) data, the Most Significant Bit method is always used. For instance: x coordinate is 16, and its data in HEX format is 0x0010 and its transmission sequence is 0x00 0x10.
1-5 Transmission direction
The transmission direction is defined in accordance with the following rules :
(1). Downstream (Tx) users transmit data to HMI; data are inputted via the “DIN” or “RXD” lead pins of the HMI user interface.
(2). Upstream (Rx) HMI transmits data to users; data are outputted via the “DOUT” or “TXD” lead pins of the HMI user interface.
2,、 Command look-up table
Category |
Command |
Description |
Handshake |
0x00 |
View the configuration and version information. |
Show the parameter configuration
|
0x40 |
Set the color palette. |
0x41 |
Set the character display spacing. |
|
0x42 |
Apply color to the background color palette. |
|
0x43 |
Apply color to the foreground color palette. |
|
0x44 |
Set the cursor display mode. |
|
Text display |
0x53 |
8*8 dot matrix ASCII character |
0x54 |
Display of 16*16 dot matrix GBK extended code character string |
|
0x55 |
Display of 32*32 dot matrix GB2312 internal code character string |
|
0x6E |
Display of 12*12 dot matrix GBK extended code character string |
|
0x6F |
Display of 24*24 dot matrixGB2312 internal code character string |
|
0x98 |
Any dot matrix; display of any coded string |
|
0x45 |
extbox restriction enabled/disabled |
|
Point setting |
0x50 |
Set several points for the background color (points deleted). |
0x51 |
Set several points for the foreground color. |
|
0x74 |
Quickly set points with dynamic curve |
|
0x72 |
Direct video memory operation |
|
Line segments and polygons |
0x56 |
Connect the designated points using the foreground color line (Display polygon). |
0x5D |
Connect the designated points using the background color line (Delete polygon). |
|
0x75 |
Display consecutive homology perpendicular line segments in a fast manner (frequency spectrum) |
|
0x76 |
Display the broken line graph in a fast manner. |
|
0x78 |
Offset ligature |
|
Arcs and circular regions |
0x57 |
Color inversion/display several arcs and circular regions. |
Rectangular box |
0x59 |
Display several rectangular frames of the foreground color (Display rectangular frames). |
0x69 |
Display several rectangular frames of the background color (Delete rectangular frames). |
|
Region manipulation |
0x73 |
Fill the designated area with bi-color bitmaps. |
0x64 |
Fill the designated area. |
|
0x52 |
Clear screen. |
|
0x5A |
||
0x5B |
Fill several designated areas. |
|
0x5C |
Convert the color of several designated areas. |
|
0x60 |
Rotate left several designated areas. |
|
0x61 |
Rotate right several designated areas. |
|
0x62 |
Move left several designated areas. |
|
0x63 |
Move right several designated areas. |
|
Picture/icon display |
0x70 |
Display a full-screen picture. |
0x7B |
Display a full-screen picture and calculate CRC16 checksum. |
|
0x71 |
Cut an icon from the designated picture and paste it to the currently displayed page. |
|
0x9C |
Cut an icon from the designated picture, filter its background, and paste it to the currently displayed page. Recover the original background automatically before pasting. |
|
0x9D |
Cut an icon from the designated picture, filter its background, and paste it to the currently displayed page. |
|
0x9E |
Cut an icon from the designated picture, rotate it by a designated degree, and paste it to the currently displayed page. Background filtering is optional. |
|
0xE2 |
Store the currently displayed picture to the terminal. |
|
0x97 |
ICON display (Maximum size: 255×255) |
|
0x99 |
Display user-defined icon. |
|
0xD0 |
Refresh the full-screen display in a forced manner. |
|
Animation support |
0x9A |
Enable/disable the in set of automatic execution of presetting by user. |
Holding buffer manipulation |
0xC0 |
Write data into the holding buffer. |
0xC101 |
Display the data point of the holding buffer. |
|
0xC102 |
Display the data line of the holding buffer. |
|
0xC103 |
Use the displayed data line of the holding buffer (Dynamic zooming of the curve). |
|
0xC104 |
Use the high-speed flash-free ligature of the displayed data point of the holding buffer (Oscilloscope). |
|
0xC105 |
Use the displayed broken line graph for data zooming of the holding buffer. |
|
0xC106 |
Use the window restriction bi-directional broken line graph for data zooming of the holding buffer. |
|
0xC107 |
Empty the point setting buffer. |
|
0xC107 |
Set points in the point setting buffer. |
|
0xC107 |
Restore set point buffer to the current page |
|
0xC108 |
Use the holding buffer to display the parameters. |
|
0xC110 |
Use the holding buffer command to achieve synchronous display. |
|
0xC2 |
Read data from the holding buffer. |
|
0xF2 |
Download font library. |
|
0x90 |
Write data to the user memory. |
|
0x91 |
Read data from user memory. |
|
0x71 |
Key code uploading |
|
0xE5 |
Configure key code interface. |
|
0x72 |
After the touch panel is released, it will be the last uploading (It can be disabled through 0xE0 command setting). |
|
0x73 |
When the touch panel is pressed, data uploading is allowed (It can be set to allow uploading for only one time via 0xE0 command). |
|
0xE4 |
Touch panel calibration |
|
0x78 |
When the touch panel is released under the automatic switch mode of the touch interface, the preset key codes will be uploaded automatically. |
|
0x79 |
When the touch panel is pressed under the automatic switch mode of the touch interface, the preset key codes will be uploaded automatically. |
|
0x7C01 |
Enter ASCII character string in the touch interface. |
|
0x7C02 |
Enter mixed English-Chinese character string in the touch interface. |
|
Buffer control |
0x79 |
The buzzer sounds for one time. |
Video switch |
0x7A |
Switchover between video and HMI functions. |
Backlight control |
0x5E |
Turn off the backlight or set the touch (key control) backlight mode. |
0x5F |
Turn on the backlight or adjust backlight brightness through PWM method. |
|
Clock manipulation |
0x9B |
Enable/disable automatic overlapping display of the clock and read the current clock. |
0xE7 |
Set the clock. |
|
Parameter configuration |
0xE0 |
Configure the parameters; it is not stored in the event of power failure. |
0xE3 |
Configure the parameters; it is stored in the event of power failure. |
|
Practical calculation method |
0xB001 |
The Pinyin input method based on level-1 character library |
0xB002 |
Calculate (A*B+C)/D; E is a 4-byte quotient. F is a 2-byte remainder. |
|
0xB003 |
Array sort of unsigned integers (2 bytes) |
|
0xB004 |
Pinyin input query based on GBK character library |
|
聲音操作 Sound manipulation |
0x30 |
Play music stored at the designated location. |
0x32 |
Real time volume adjustment. |
|
0x33 |
Stop playing immediately. |
|
0x3F |
Respond to sound operational orders. |