FY HMI Serial Command Set PDF
FY HMI Serial Command Set PDF
FY HMI Serial Command Set PDF
Verr:V1.0
list
One、Instruction Set........................................................................................................................................... 2
1.1 Serial command overview ..................................................................................................................... 2
1.4 Serial HMI statement(Can only be written to the control's event when the project is edited)..... 18
1. All instruction names and parameters are all in ASCII string format, non-
binary data, easy to read and debug.
2. All instruction names use lowercase letters (only the instruction name is
lowercase, regardless of the parameter size status).
◆ Color format:
The LCD module uses 16-bit true color display, the picture is exquisite, the color
is rich, and the data format adopts the standard 565 color format:
D1 D1 D1 D1 D1 D1 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
5 4 3 2 1 0
65536 color R4 R3 R2 R1 R0 G5 G4 G3 G2 G1 G0 B4 B3 B2 B1 B0
For example: pure red = F800 (hexadecimal) / 63488 (decimal), pure blue = 001F
(hexadecimal) / 31 (decimal)
Note: The user can debug and obtain the desired color value through software. The
color value can only be expressed in decimal value;
◆ Operation instructions:
The instruction set is divided into two parts: the configuration control instruction
set and the basic instruction set.
The main difference between the two is that the configuration instruction set is
directly object-oriented operation, and the relevant parameters of these objects are all
configured in advance in the host computer software, and downloaded together with the
picture to the screen memory; the basic instruction set can be understood as the most The
underlying instruction set, most operations must contain coordinate, color, font and other
parameter information. When the host computer interface editing software cannot fulfill
some of your special display requirements, the user uses the basic instructions to achieve
the desired display effect, such as clearing the screen. In most cases, these drawing
instructions are not needed. Most of the applications can be implemented through the
control operations of the interface editing software.
◆ Description:
The instruction end character is two bytes of “0x0D 0x0A”. When the
command is sent by the FY HMI system, the terminator is automatically added.
When using the universal serial port assistant, ensure that the serial port
assistant can automatically append “0x0D 0x0A”, otherwise you need to manually
append “0x0D 0x0A"
1.2 Basic instruction set
Quantity:3
parameter 3:Image ID
Quantity:7
parameter 7:Image ID
Quantity:5
parameter 5:Image ID
Quantity:11 1. wristr
0,0,200,40,0,63488,1024,1,1,1,"FY HMI"
1. When the character is written beyond the
parameter 1:Starting point x (Use font 1 to write "FY HMI" in the
set w, it will automatically wrap. If the
area of starting coordinates (0,0),
Writing coordinate remaining characters are not written after the
wristr width 100, height 30, the font color
instruction line is changed to h, it will be ignored.
parameter 2:Starting point y is 63488, and the background color is
coordinate 31 (if you do not want to write the 2. For a description of the color values, see
background color (ie no background) the notes for the cls command.
parameter 3:Area width you can set The sta parameter is 3),
the horizontal alignment is centered,
parameter 4:Area height and the vertical alignment is also
centered.)
parameter 5:Image ID
Quantity:5
Quantity:5
Quantity:5
Quantity:4
Instructio
Function Parameter Instance Description
n
1.ref 1(Redraw the control with ID 1) If a control is occluded by the content drawn by
Quantity:1
Redraw the GUI instruction or needs to be displayed
ref 2.ref textBox0(Redraw the control
control after being occluded by another control, you can
parameter:Item ID or control name whose name is textBox0) use ref to redraw.
Quantity:2
1.click btn0,0 (activates the pop-up The control's push/bounce event is automatically
Press/bounce parameter 1:Item ID or control name event of the control named btn0) activated when touched on the screen. If you want
click
event 2.click btn1,1 (activates the press to activate manually without touching it, use the
parameter 2:Event type, 0 is bounce and click command.
event of the control named btn1)
1 is pressed
4. read 123(Return constant value: 123 device only sends the data content, there is no
ie: 0x7b 0x00 0x00 0x00) start identifier, and there is no terminator.
Quantity:2
1.vis button0,0(hidden button0 The first parameter is 255 for all controls on
Hide/show parameter 1:Control name or control ID control) the current page, for example: vis 255, 0 (hiding
vis
control all controls on the current page) vis 255, 1
parameter 2:Status (0 is hidden, 1 is 2.vis button0,1(Show button0 control) (displays all controls on the current page)
displayed)
Quantity:2
1.tsw button0,0 (Let the control whose The first parameter is 255 for all controls on the
Control touch parameter 1:Control name or control ID name is button0 touch invalid) current page, for example: tsw 255, 0 (all controls
tsw
enable 2.tsw button0,1 (Let the control with on the current page are invalid) tsw 255, 1 (all
parameter 2:Status (0 is hidden, 1 is controls on the current page are valid).
the name button0 be valid)
displayed)
1. Before using the random number, you need to use
the randset command to set the random number
generation range. If not, the default is minimum 0
and maximum 2147483647. After setting the range,
Quantity:2 each time the system variable rand is read, it will
1.randset 0,100 (Set the current get a random number.
Random number
randset parameter 1:Minimum random number generation range to a
range setting 2. Each time the range is set using the randset
minimum of 0 and a maximum of 100)
parameter 2:Maximum command, it will remain in effect until the power
is restored or the device is reset.
Quantity:5
Add specified 1.addw 1,0,0,100,50 (Add a sine wave 1. The amplitude and offset values only support 8-
parameter 1:Curve control ID number
waveform data data with an amplitude of 100 and a bit data, with a minimum of 0 and a maximum of 255.
addw
to the curve parameter 2:Curve control channel bias of 50 to the 0 channel of the 2. There are three waveform numbers: 0-sine wave;
control number curve control with ID 1) 1-square wave; 2: triangular wave;
Quantity:2
1.cle 1,0(Clear the 0 channel data of
Clear curve parameter 1:Curve control ID number the curve control with ID 1) 1. A channel number of 255 means that all channel
cle
control data 2.cle 1,255(Clear all channel data for data in this curve control is cleared.
parameter 2:Curve control channel
the curve control with ID 1)
number
Touch touch_j (Enter touch calibration All devices have been calibrated at the factory and
touch_j no
calibration function) are generally not required.
Restore
serial
com_star no com_star
command
execution
Clear all
instructions
that have not
code_c been executed no code_c
in the serial
command
buffer
rest Reset no rest
1.4 Serial HMI statement(Can only be written to the control's event when the project is edited)
1.n0.val has been added to 100 until the screen is not refreshed
during the self-adding process until the end of all statements in
the whole process
1. In the execution of a process with more instructions, or in a long-term
while(number0.val<100) loop statement, all control rights of the system are occupied by this
process. Before the end of the process, although the corresponding memory
{
data can be arbitrarily read and written normally, The screen will not
number0.val++ refresh the display. After adding the doevents, you can transfer control to
the screen refresh. After performing the results, the screen will refresh
}
while all the changed controls. After the refresh, the control will be returned
2. n0.val has been automatically added to 100, the screen will to the current process to continue. Prevent the screen from showing a
continue to refresh the display of the n0 control during the self- display state of suspended animation.
addition process. 2. During the loop of the while statement, the device will not respond to
while(number0.val<100) the touch event. The serial port command will receive the buffer, but it
will not be executed until all the statements in the current process are
{ executed. Please use it carefully to prevent an infinite loop.
number0.val++
doevents
}
prog0.val=var0.val
1. presdim=50
presdim Current backlight brightness value (0-100)
2. presdim=presdim +10
1.defdim=50
Power-on default backlight brightness
defdim 2.defdim=defdim +10
value (0-100)
3.defdim=defdim -10
1.thdra=0 (close)
thdra Touch drawing function switch
2.thdra=1(open)
No serial data automatic sleep time (unit:
ussp=30(30 seconds without serial data
ussp second, minimum 3, maximum 65535, power-on
automatically enters sleep mode)
default 0)
1.usup=0(The serial port does not wake up Power-on default is 0, does not customize wake-up,
Serial data automatic wake-up switch in automatically after sleep) you need to send sleep=0 to wake up the screen, if
usup
sleep mode (power-on default 0) 2.usup=1(Automatic wake-up of the serial port set to 1, the serial port will automatically wake
after sleep) up immediately after receiving any data.
2.get tch1: Current touch coordinate Y The touch coordinates can only be read, and cannot
tch0-tch3 Touch coordinates be assigned. When not pressed, the real-time
3.get tch2: Coordinate X when last pressed coordinate data is 0.
4.get tch3: The coordinates of the last press y
FY HMI 串口指令集 2018-7-28
郑州飞逸科技有限公司 24