Detailed explanation of communication protocols supported by VisualHMI: DCBUS/XGUS/Modbus master-slave frame formats and configurations

freeFree Technical Resource

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

This article will go through the protocols supported by VisualHMI one by one, with a focus onModbus RTU master-slave modeAndframe format- as this is the part most relevant to readers of modbus.cn and the most common pitfall during debugging. The configuration items for other PLC protocols (FX2N/Delta/Xinye/Yonghong) are similar, and are listed at the end of the article.

⚠️ Iron rule: Only one protocol can run on the same serial port.You cannot have both Modbus and DCBUS on UART1. Multi-protocol requirements require hardware multi-channel serial ports.

I. DCBUS protocol (Dacai configuration protocol)

DCBUS is a commonly used configuration protocol for screen and proprietary motherboard docking, with the following frame structure:

FieldLengthDescription
Frame header2 bytesDefault 0xAA55, customizable
Station number1 byteDefault 0, 255 for broadcast
Length1 byteTotal bytes of function code + data + check
Function code1 byte0xF1 for write / 0xF2 for read
Address2 bytesUser area 0x0100~0xFFFF, System area <0x1000
Datan byteRegister value
Check2 bytesCRC16 or reserved 0xCCCC

CRC16 algorithm (C reference provided by Dacai, Modbus lookup table method):

uint16 MB_calc_crc16(uint8 *buffer, uint32 n){
  uint16 crc = 0xffff;
  for(i = 0; i < n; i++){
    crc = crc ^ buffer[i];
    for(j = 0; j > 1;
      if(carry_flag == 1) crc = crc ^ 0xa001;
    }
  }
  return crc;
}

Write variable (0xF1) example, write 100 to 0x1000, station number 0, no CRC:

AA55 00 07 F1 1000 0064 CCCC
 ↑帧头 ↑站 ↑长度 ↑写 ↑地址  ↑值   ↑预留

When station number is set to 1 and CRC is enabled:AA55 01 07 F1 1000 0064 7289, screen responseAA55 01 03 F1 E174.

Read variable (0xF2) example, read 0x1000 (assuming value 100):

主板请求: AA55 00 06 F2 1000 01 CCCC
屏返回:   AA55 00 08 F2 1000 01 0064 CCCC
💡 Debugging tip:After enabling "Auto Upload", if you click the button on the screen to change the register, the screen will actively send a 0xF2 frame to the mainboard for reporting, without the mainboard needing to poll. This is different from Modbus slaves actively reporting; DCBUS reporting is in the direction of screen → mainboard.

II. XGUS Protocol

The default XGUS frame header is 0x5AA5, with a structure of: header (2) + length (1) + function code (1) + address (2) + data (n) + CRC16. There are two modes for switching screens:

模式1: 5AA5 03 80 03 XX        // XX=画面ID
模式2: 5AA5 07 82 0084 5A01 XXXX // XXXX=画面ID

III. Modbus RTU (Key)

The screen supports standard Modbus-RTU, and can be set asmaster (Master)orslave (Slave).

3.1 Master mode ModbusMaster

The screen acts as a master to poll the attached slaves (instruments, frequency converters, PLCs). Key configuration items:

Configuration itemMeaning
Maximum readsMaximum bytes read per single instruction
Number of read intervalsAddress intervals smaller than this value can be merged into one read instruction
Number of write retriesMaximum retries after write failure
TimeoutMilliseconds for waiting for slave response
Interval timeHow long to delay after receiving a response before sending the next one
Write register commandAutomatic (0x06 single write/0x10 multiple writes) or all use 0x10
Offline optimized readingAfter checking, the offline slave will no longer send requests
Number of slavesDefault: 1. For RS485 multi-slave interfaces, a maximum of 10 can be configured. For more, use LUA
Preset byte orderDefault: big-endian. Floating-point/long integer types can be re-specified

Supported function codes:0x01 0x02 0x03 0x04 0x05 0x06 0x0F 0x10.

⚠️ Important: Byte order issues are the most common.Default: big-endian (AB CD), but many devices use "big-endian byte order + big-endian word order" (CD AB) or vice versa. If floating-point display is incorrect, first check the byte order, as it is not a protocol issue. UseModbus RTU tutorialByte order conversion table in

3.2 Slave mode ModbusSlave

The screen acts as a Modbus slave, waiting for the host computer (PLC, gateway, your debugging software) to read. Configuration items:

Configuration itemMeaning
Slave station numberModbus address of this screen
Character intervalIf it exceeds this ms, it is considered a frame break
Delay responseRespond after a delay after receiving the request

Also supports the full set of function codes from 0x01 to 0x10. In slave mode, "screen write address/screen read address" can achieve screen and PLC screen linkage.

IV. PLC Protocols (FX2N/FX3U/Delta/Sinic-Tek/Yonghong)

These configuration items are highly consistent, with the following core differences listed:

ProtocolRegister addressing characteristics
FX2NShort standard mode instructions (such as 02 30 31 30 30 30 30 32 03 35 36), long extended mode instructions with a large address range
FX3USimilar to FX2N, with standard/extended modes
DELTA DVPASCII mode: STX + address + instruction + data + LRC check + CR LF
Sinic-Tek XC/XDStandard Sinic-Tek PLC protocol
Yonghong FBStandard Yonghong Protocol

All PLC protocols have an "Synchronize Screen with PLC" option: screen changes are written to a specified PLC address, or the screen switches when a certain PLC address changes value (0xFFFF for automatic).

This document is compiled from the protocol description section of the VisualHMI development documentation of Guangzhou Dacai Technology (hmi-doc.gz-dc.com). The frame format and register configuration are faithfully preserved as per the original text. The copyright belongs to Dacai Technology. Emphasis and formatting are realigned here.

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 *.