VisualHMI serial port upgrade (Private): remote programming project for the mainboard to the screen

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

Enable the user's mainboard (rather than the computer) to upgrade the HMI project: The mainboard sends serial port commands, and the HMI enters download mode, receives files, and saves them as private. This is used for mass production and remote maintenance.

1. Enter download mode

The mainboard sends$cfgenter#, and the HMI enters download mode after responding$ok#(at this time, it does not respond to original protocols such as Modbus).

VisualHMI serial port upgrade (Private): remote programming project for the mainboard to the screen插图

2. Create a file

$file,[pathname],[size],[block],[baudrate]#

with parametersspecifying
pathnamethe internal storage path, such as 3:/bin/image.bin (3: is equivalent to private:)
sizeFile byte size
blockData size per packet, recommended values are 512+4 / 1024+4 / 2048+4
baudrateTransmission baud rate, 0=use current baud rate

Example:$file,3:/bin/image.bin,12345,2052,921600#. The HMI responds with $ok# or $err#.

VisualHMI serial port upgrade (Private): remote programming project for the mainboard to the screen插图1

3. Download data

Packetize and send file data (each containing valid data of block size + 4 bytes of header and trailer).Before changing the baud rate, make sure to confirm that the serial port buffer data has been sent completely(for simplicity, delay for 10ms).

VisualHMI serial port upgrade (Private): remote programming project for the mainboard to the screen插图2

VisualHMI serial port upgrade (Private): remote programming project for the mainboard to the screen插图3

There are three challenges in serial port upgrade:① After entering download mode, the HMI will no longer respond to the original protocol, so do not send business instructions during this period; ② Before changing the baud rate, delay to ensure that the buffer is empty, otherwise the entire packet of lost bytes will be discarded; ③ Start with a block size of 512+4, and use 2048+4 for large files to improve speed.

. Compiled from Guangzhou Dacai Technology VisualHMI development documentation (hmi-doc.gz-dc.com) and other technical tutorials "Serial Port Upgrade Private", copyright belongs to Dacai Technology.

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.