Command Set Instruction
Command Set Instruction
1
Directory
1. Command set code description.................................................................. 4
1.1 System operation related...................................................................................................4
1.5 Progress_bar.............................................................................................................. 7
1.6 Slider.......................................................................................................................... 8
1.7 Image......................................................................................................................... 9
1.12 Switch...................................................................................................................... 15
1.16 Gauge_pointer.........................................................................................................16
2
2.6 Check box customization related.....................................................................................21
3
Basic Introduction
Basic command format:
For example:
ST<{"cmd_code":"open_win","widget":"label_value"}>ET
ST<{"cmd_code":"set_value","widget":"label_value",”value”:100}>ET
Important: The text content should be with the quotes(“”), including widgets’ name but the
value content shouldn’t be with the quotes, such as value or true/false states.
Example:
ST<{"cmd_code":"sys_reboot","type":"system"}>ET
System reboot
Example:
ST<{"cmd_code":"sys_hello","type":"system"}>ET
Test if the communication between the MCU and the display works normal. The display will
return command 0x0001 if the communication works.
Example:
ST<{"cmd_code":"sys_version","type":"system"}>ET
Get the version information for the current firmware. The display will return the command
0x0002 for the firmware version information.
******************************************************************************
4
1.2 Common command
Command can be used for all widgets:
Example:
ST<{"cmd_code":"set_enable","type":"widget","widget":"button1","enable":true}>ET
ST<{"cmd_code":"set_enable","type":"widget","widget":"button1","enable":false}>ET
ST<{"cmd_code":"set_visible","type":"widget","widget":"button1","visible":true}>ET
ST<{"cmd_code":"set_visible","type":"widget","widget":"button1","visible":false}>ET
******************************************************************************
*The previous window will not be closed if open a window. The value you have saved in the
widget will be temporarily saved unless it is closed or the display is shut down.
Example :
ST<{"cmd_code":"open_win","widget":"label_value"}>ET
close_win Close all the windows you opened previously (not suggested, be cautious to use)
*The previous window will be closed and the value you have saved in the widget will be cleared.
Example:
ST<{"cmd_code":"close_win","widget":"label_value"}>ET
5
back_win Close the current window and go back to the previous window
*The previous window will be closed and the value you have saved in the widget will be cleared.
Example:
ST<{"cmd_code":"back_win"}>ET
*The previous window will be closed and the value you have saved in the widget will be cleared.
Example:
Back to the window named “label_value”, close all the window above it. Normally worked for the
multiple layers windows
ST<{"cmd_code":"back_win_to","widget":"label_value"}>ET
ST<{"cmd_code":"back_win_to","widget":"home_page"}>ET
*The previous window will not be closed and the value you have saved in the widget will be
temporarily saved unless it is closed or the display is shut down..
Example:
ST<{"cmd_code":"back_home"}>ET
******************************************************************************
Example:
ST<{"cmd_code":"set_text","type":"label","widget":"label1","text":"Hello Stone"}>ET
6
Set the “edit1” content as “1234567890”
ST<{"cmd_code":"set_text","type":"edit","widget":"edit1","text":"1234567890"}>ET
Example:
ST<{"cmd_code":"get_text","type":"label","widget":"label1"}>ET
ST<{"cmd_code":"get_text","type":"edit","widget":"edit1"}>ET
Notice: the label widget can be only set/get value as the float type
Example:
ST<{"cmd_code":"get_value","type":"label","widget":"label1"}>ET
ST<{"cmd_code":"get_value","type":"edit","widget":"edit1"}>ET
******************************************************************************
1.5 Progress_bar
Example:
ST<{"cmd_code":"set_max","type":"progress_bar","widget":"progress_bar1","max":100}>ET
Example:
7
ST<{"cmd_code":"show_text","type":"progress_bar","widget":"progress_bar2","show_text":"tr
ue"}>ET
Example:
ST<{"cmd_code":"set_value","type":"progress_bar","widget":"progress_bar3","value":40}>ET
Example:
ST<{"cmd_code":"get_value","type":"progress_bar","widget":"progress_bar"}>ET
Example:
ST<{"cmd_code":"get_percent","type":"progress_bar","widget":"progress_bar"}>ET
******************************************************************************
1.6 Slider
Example:
ST<{"cmd_code":"set_max","type":"slider","widget":"slider1","max":200}>ET
Example:
ST<{"cmd_code":"set_min","type":"slider","widget":"slider1","min":0}>ET
Example:
ST<{"cmd_code":"set_step","type":"slider","widget":"slider1","step":1}>ET
8
set_value Set current point value for slider
Example:
ST<{"cmd_code":"set_value","type":"slider","widget":"slider1","value":0}>ET
Example:
ST<{"cmd_code":"get_value","type":"slider","widget":"slider1"}>ET
******************************************************************************
1.7 Image
Example:
ST<{"cmd_code":"set_image","type":"image","widget":"image","image":"guage_bg"}>ET
ST<{"cmd_code":"set_image","type":"image","widget":"image","image":"vgus01"}>ET
Example:
ST<{"cmd_code":"set_draw_type","type":"image","widget":"image","draw_type":2}>ET
>IMAGE_DRAW_DEFAULT = 0: Default setting. Show the image as the original size on the top-
left corner on the target rectangular;
>IMAGE_DRAW_CENTER = 1: Center display. Show the image as the original size on the center
of the target rectangular;
>IMAGE_DRAW_ICON = 2: Icon display mode. The showing method will be same with the
center display but the size will be centered and scaled as the size of the target rectangular.
>IMAGE_DRAW_SCALE = 3: Scale display mode. Zoom in/out the image as the size of the
target rectangular (the original ratio is not guaranteed).
>IMAGE_DRAW_SCALE_AUTO = 4: Auto scale mode. Zoom in/out the image as the height
or width of the target rectangular (It will choose the smallest ratio) and center displayed.
9
>IMAGE_DRAW_SCALE_DOWN = 5: Zoom in mode. If the image is larger than target
rectangular, it will be zoomed in. If not then center display.
>IMAGE_DRAW_SCALE_W = 6: Width scale mode. Zoom in/out the image as the width of the
target rectangular. The height will be adjusted as the zoomed scale of the width. The oversized
part will not be displayed.
>IMAGE_DRAW_SCALE_H = 7: Height scale mode. Zoom in/out the image as the height of the
target rectangular. The width will be adjusted as the zoomed scale of the height. The oversized
part will not be displayed.
Example:
ST<{"cmd_code":"set_scale","type":"image","widget":"image","scale_x":0.5,"scale_y":0.5}>ET
ST<{"cmd_code":"set_scale","type":"image","widget":"image","scale_x":1,"scale_y":1}>ET
*The image draw type must be center or icon if you need to enable the rotate the image.
Example:
ST<{"cmd_code":"set_rotation","type":"image","widget":"image","rotation":90}>ET
ST<{"cmd_code":"set_rotation","type":"image","widget":"image","rotation":180}>ET
******************************************************************************
Example:
ST<{"cmd_code":"set_play","type":"image_animation","widget":"image_animation"}>ET
10
set_pause Pause the image animation
Example:
ST<{"cmd_code":"set_pause","type":"image_animation","widget":"image_animation"}>ET
Example:
ST<{"cmd_code":"set_stop","type":"image_animation","widget":"image_animation"}>ET
set_format Set the name format for the animation image value
Example:
Set the name format for “image_animation” as text+digits (for example: num1)
ST<{"cmd_code":"set_format","type":"image_animation","widget":"image_animation","format":
"%s%d"}>ET
Example:
ST<{"cmd_code":"set_image","type":"image_animation","widget":"image_animation","image":"
num"}>ET
set_interval Set the gap between 2 frame of the image animation (ms)
Example:
ST<{"cmd_code":"set_interval","type":"image_animation","widget":"image_animation","interva
l":200}>ET
Example:
11
ST<{"cmd_code":"set_loop","type":"image_animation","widget":"image_animation","loop":true}
>ET
set_range Set the start and end value for the animation image
Example:
ST<{"cmd_code":"set_range","type":"image_animation","widget":"image_animation","start_ind
ex":1,"end_index":10}>ET
******************************************************************************
Image value is a special function which you can assign a special name and value to a series
images. And you can increase or edit the value, to change the related image display. Mostly used
in the art-work digit/text function.
Example:
ST<{"cmd_code":"set_image","type":"image_value","widget":"image_value1","image":"num"}>
ET
Example:
ST<{"cmd_code":"set_format","type":"image_value","widget":"image_value2","format":"%02.2
f"}>ET
Example:
ST<{"cmd_code":"set_max","type":"image_value","widget":"image_value","max":200}>ET
Example:
12
ST<{"cmd_code":"set_min","type":"image_value","widget":"image_value","min":0}>ET
Example:
ST<{"cmd_code":"set_value","type":"image_value","widget":"image_value","value":6.66}>ET
Example:
ST<{"cmd_code":"get_value","type":"image_value","widget":"image_value"}>ET
******************************************************************************
set_text Change the selector to the option with the input text
Example:
ST<{"cmd_code":"set_text","type":"text_selector","widget":"text_selector1","text":"green"}>ET
set_value Change the selector to the option with the input value(If the option type
is text, the value will be the digits in front of each option)
Example:
ST<{"cmd_code":"set_value","type":"text_selector","widget":"text_selector1","value":2}>ET
set_selected Change the selector to the option with the input selected number(The
option number will start from 0)
Example:
Change the current option of “text_selector1” to option No.1, which is option “green”
ST<{"cmd_code":"set_selected","type":"text_selector","widget":"text_selector1","selected_ind
ex":1}>ET
13
get_text Get the current option text content
Example:
ST<{"cmd_code":"get_text","type":"text_selector","widget":"text_selector1"}>ET
Example:
ST<{"cmd_code":"get_value","type":"text_selector","widget":"text_selector1"}>ET
Example:
ST<{"cmd_code":"get_selected","type":"text_selector","widget":"text_selector1"}>ET
******************************************************************************
Example:
ST<{"cmd_code":"set_date","type":"digit_clock","widget":"digit_clock","date":"12:23"}>ET
ST<{"cmd_code":"set_date","type":"digit_clock","widget":"digit_clock","date":"12:23:46"}>ET
ST<{"cmd_code":"set_date","type":"digit_clock","widget":"digit_clock","date":"2021-02-26
12:23"}>ET
ST<{"cmd_code":"set_date","type":"digit_clock","widget":"digit_clock","date":"2021-02-26
12:23:46"}>ET
Example:
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"hh:mm"}>E
T
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"hh:mm:ss"}
>ET
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"YYYY-MM-
DD hh:mm"}>ET
14
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"YYYY-MM-
DD hh:mm:ss"}>ET
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"YYYY-MM-
DD hh:mm:ss w"}>ET
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"YYYY-MM-
DD hh:mm:ss W"}>ET
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"YYYY-MM-
DD hh:mm:ss MMM"}>ET
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"YYYY-M-D
h:m:s"}>ET
ST<{"cmd_code":"set_format","type":"digit_clock","widget":"digit_clock","format":"YYYY/MM/
DD hh:mm:ss"}>ET
Example:
ST<{"cmd_code":"get_date","type":"digit_clock","widget":"digit_clock"}>ET
******************************************************************************
1.12 Switch
Example:
ST<{"cmd_code":"set_value","type":"switch","widget":"switch","value":true}>ET
ST<{"cmd_code":"set_value","type":"switch","widget":"switch","value":false}>ET
******************************************************************************
set_value Set the check box value between 0/1 (true or false)
Example:
ST<{"cmd_code":"set_value","type":"check_button","widget":"check_button","value":true}>ET
ST<{"cmd_code":"set_value","type":"check_button","widget":"check_button","value":false}>ET
******************************************************************************
15
1.14 Radio button
Example:
ST<{"cmd_code":"set_value","type":"radio_button","widget":"radio_button","value":true}>ET
ST<{"cmd_code":"set_value","type":"radio_button","widget":"radio_button","value":false}>ET
get_checked Get the value of currently checked radio buttons; radio button
Example:
ST<{"cmd_code":"get_checked","type":"radio_button","widget":"radio_button"}>ET
******************************************************************************
set_image Set image name for gauge (same with the image command)
Example:
ST<{"cmd_code":"set_image","type":"gauge","widget":"guage1","image":"gauge_bg"}>ET
ST<{"cmd_code":"set_image","type":"gauge","widget":"guage1","image":"gauge_bg1"}>ET
ST<{"cmd_code":"set_draw_type","type":"gauge","widget":"gauge1","draw_type":2}>ET
Set the draw type for the gauge image. The draw type value is same with the image widget
******************************************************************************
1.16 Gauge_pointer
Example:
16
ST<{"cmd_code":"set_image","type":"gauge_pointer","widget":"guage_pointer","image":"guag
e_pointer1"}>ET
Example:
ST<{"cmd_code":"set_angle","type":"gauge_pointer","widget":"guage_pointer","angle":60}>ET
17
Return command set instruction
Example: ST< 0x1068 0x0004 0x01 0x02 0x03 0x04 >ET CRC16
******************************************************************************
Example:
System working normal, serial port auto return after display boots:
18
Hex code:53 54 3C 00 00 00 01 01 3E 45 54 AB 25
Example:
Hex code:53 54 3C 00 01 00 01 01 3E 45 54 6B 35
Example:
Hex code:53 54 3C 00 02 00 18 56 31 2E 30 2E 30 31 2E 38 30 30 78 34 38 30 2E 32 31 30 35 31
33 52 43 3E 45 54 67 50
******************************************************************************
Key value:
Example:
Hex code: 53 54 3C 10 01 00 08 62 75 74 74 6F 6E 39 01 3E 45 54 E7 E0
0x02 Button released (after release the button, the CLICK event function will be
trigger)
19
Example:
Hex code: 53 54 3C 10 01 00 08 62 75 74 74 6F 6E 39 02 3E 45 54 A3 E0
0x03 long press trigger (Long press will NOT trigger the CLICK event)
Example:
Hex code: 53 54 3C 10 01 00 08 62 75 74 74 6F 6E 39 03 3E 45 54 5F E1
******************************************************************************
Key value:
Example:
Example:
******************************************************************************
Key value:
0x01 Switch on
Example
20
Switch value changed return:
Switch off
Hex code: 53 54 3C 10 10 00 07 73 77 69 74 63 68 00 3E 45 54 21 F2
Switch on
Hex code: 53 54 3C 10 10 00 07 73 77 69 74 63 68 01 3E 45 54 DD F3
******************************************************************************
Key value:
Example
Un-check
Hex code: 53 54 3C 10 20 00 0D 63 68 65 63 6B 5F 62 75 74 74 6F 6E 00 3E 45 54 AF 1E
Checked
Hex code: 53 54 3C 10 20 00 0D 63 68 65 63 6B 5F 62 75 74 74 6F 6E 01 3E 45 54 53 1F
******************************************************************************
21
0x1031 radio button value changed return passively(by get_checked command from MCU)
Key value:
Example:
Hex code: 53 54 3C 10 30 00 0E 72 61 64 69 6F 5F 62 75 74 74 6F 6E 31 01 3E 45 54 34 4E
Hex code: 53 54 3C 10 30 00 0D 72 61 64 69 6F 5F 62 75 74 74 6F 6E 00 3E 45 54 32 36
radio button value changed return passively be getting command from MCU:
Hex code: 53 54 3C 10 31 00 0E 72 61 64 69 6F 5F 62 75 74 74 6F 6E 31 01 3E 45 54 34 4E
Hex code: 53 54 3C 10 31 00 0D 72 61 64 69 6F 5F 62 75 74 74 6F 6E 00 3E 45 54 32 36
******************************************************************************
22
Key value:
Example: 0x42400000 current slider’s value: 48.000000 (Type: float compliant with
IEEE 754 specification)
Example:
Slider value changing return (real-time slider value return from UART. The data return step is
based on the slider step setting in the GUI):
ST< 0x10 0x40 0x00 0x0B slider1 0x42 0x40 0x00 0x00 >ET
Hex code: 53 54 3C 10 40 00 0B 73 6C 69 64 65 72 31 42 40 00 00 3E 45 54 27 6D
ST< 0x10 0x40 0x00 0x0B slider1 0x42 0x44 0x00 0x00 >ET
Hex code: 53 54 3C 10 40 00 0B 73 6C 69 64 65 72 31 42 44 00 00 3E 45 54 A3 6C
Hex code: 53 54 3C 10 41 00 0B 73 6C 69 64 65 72 31 42 44 00 00 3E 45 54 33 3D
******************************************************************************
0x1051 progress bar percentage return passively, by get_percent command from MCU
Key value:
Example: 0x42400000 current slider’s value: 48.000000 (Type: float compliant with
IEEE 754 specification)
23
progress_bar value changed to 54.978615
ST< 0x10 0x50 0x00 0x10 progress_bar 0x42 0x5B 0xEA 0x1A >ET
Hex code: 53 54 3C 10 50 00 10 70 72 6F 67 72 65 73 73 5F 62 61 72 42 5B EA 1A 3E 45 54 BF 09
ST< 0x10 0x50 0x00 0x10 progress_bar 0x42 0x5B 0xFF 0xED >ET
Hex code: 53 54 3C 10 50 00 10 70 72 6F 67 72 65 73 73 5F 62 61 72 42 5B FF ED 3E 45 54 08 36
ST< 0x10 0x50 0x00 0x10 progress_bar 0x42 0x5C 0x00 0x00 >ET
Hex code: 53 54 3C 10 50 00 10 70 72 6F 67 72 65 73 73 5F 62 61 72 42 5C 00 00 3E 45 54 C7 16
ST< 0x10 0x51 0x00 0x10 progress_bar 0x00 0x00 0x00 0x28 >ET
Hex code: 53 54 3C 10 51 00 10 70 72 6F 67 72 65 73 73 5F 62 61 72 00 00 00 28 3E 45 54 C7 16
******************************************************************************
0x1062 label value return (float type)(while the label was targeted by the set_value function on
the button, the code will return once the value is changed)
Command format:
Float value: the last 4 bytes (Type: float compliant with IEEE 754 specification)
24
Float type value content:
Example:
Hex code: 53 54 3C 10 60 00 0D 22 6C 61 62 65 6C 22 3A 53 74 6F 6E 65 3E 45 54 00 CE
53 54 3C 10 60 00 0D 22 6C 61 62 65 6C 22 3A 31 32 33 34 35 3E 45 54 A4 2B
53 54 3C 10 60 00 1C 22 6C 61 62 65 6C 22 3A 48 65 6C 6C 6F 20 53 74 6F 6E 65 20 44 65 73 69
67 6E 65 72 3E 45 54 00 8B
Hex code: 53 54 3C 10 62 00 09 6C 61 62 65 6C 3F A1 47 AE 3E 45 54 6C 8B
Float value: 8
Hex code: 53 54 3C 10 62 00 0A 6C 61 62 65 6C 32 41 00 00 00 3E 45 54 C2 99
******************************************************************************
25
0x1070 edit text return (Initiatively or passively. It can be returned after the edit text changed,
or returned by get_text command)
Command format:
*The text length has to be less than 1024 byte (the text length after “target name”:)
Example:
Hex code: 53 54 3C 10 70 00 0E 22 65 64 69 74 22 3A 61 62 63 64 65 66 67 3E 45 54 CA EB
Hex code: 53 54 3C 10 70 00 15 22 65 64 69 74 22 3A 53 74 6F 6E 65 20 44 65 73 69 67 6E 65 72
3E 45 54 9E 0F
Example:
Hex code: 53 54 3C 10 71 00 08 65 64 69 74 00 00 00 7B 3E 45 54 B6 5C
Hex code: 53 54 3C 10 71 00 08 65 64 69 74 FF FF FF 85 3E 45 54 4A 62
Float value: The last 4 bytes of the command data(Type: float compliant with IEEE 754
specification)
Example:
26
ST<0x10 0x72 0x00 0x08 edit 0x42 0xF6 0xE9 0x79>ET
Hex code: 53 54 3C 10 72 00 08 65 64 69 74 42 F6 E9 79 3E 45 54 48 75
Hex code: 53 54 3C 10 72 00 08 65 64 69 74 C2 F6 E9 79 3E 45 54 80 F4
******************************************************************************
0x1081 text selector value return initiatively (int type value, can be read by get_value command
from MCU)
0x1082 text selector index number return passively (int type value by get_value command from
MCU)
Command format:
Text: “widget name”: text content (text length can not be longer than 1024 bytes)
Example:
Hex code: 53 54 3C 10 80 00 15 22 74 65 78 74 5F 73 65 6C 65 63 74 6F 72 31 22 3A 32 30 32 30
3E 45 54 63 40
27
Hex code: 53 54 3C 10 80 00 17 22 74 65 78 74 5F 73 65 6C 65 63 74 6F 72 32 22 3A 79 65 6C 6C
6F 77 3E 45 54 06 5E
Hex code: 53 54 3C 10 81 00 12 74 65 78 74 5F 73 65 6C 65 63 74 6F 72 31 00 00 07 E5 3E 45 54
FE 5A
Text_selector1 value: 4
Hex code: 53 54 3C 10 81 00 12 74 65 78 74 5F 73 65 6C 65 63 74 6F 72 32 00 00 00 04 3E 45 54
17 99
*Notice: if the text selector is in text mode, the returned value will be the current option
number, NOT index number. For example, the setting is: 1:red;2:blue;3:green;4:yellow;5:grey;
the text right now should be yellow
Hex code: 53 54 3C 10 82 00 12 74 65 78 74 5F 73 65 6C 65 63 74 6F 72 31 00 00 00 32 3E 45 54
75 32
Hex code: 53 54 3C 10 82 00 12 74 65 78 74 5F 73 65 6C 65 63 74 6F 72 32 00 00 00 05 3E 45 54
14 7C
******************************************************************************
28
Command format:
Example:
Hex code: 53 54 3C 10 92 00 0F 69 6D 61 67 65 5F 76 61 6C 75 65 40 87 5C 29 3E 45 54 F6 DB
******************************************************************************
29