The virtual screen is a flagship feature of VisualHMI: without connecting to a real machine, you can run the UI on a computer, and then use virtual serial ports to debug with real PLC/Modbus simulation software. This article will thoroughly explain three debugging methods, especially the one most commonly used for Modbus development.
1. Install a virtual serial port driver (VSPD) first.
The virtual screen and VisualHMI software communicate through a pair of virtual serial ports. Use VSPD (Virtual Serial Port Driver) to create a pair of associated serial ports (such as COM8 ↔ COM9), with the virtual screen and software each occupying one end.
2. Mutual debugging between VisualHMI and virtual screen (DCBUS / XGUS)
This method is suitable for DCBUS and XGUS native protocols. Steps:
- Run the virtual screen, select virtual serial port COM8, and open the serial port
- VisualHMI software selects virtual serial port COM9, click connect
- Open the command assistant, select DCBUS as the protocol, configure the frame header
0xAA55, enable CRC, and set the station number to 0 - Write variable: address 1000, data 0003; system register
0x0100switch screen write 0001 → virtual screen switch to screen 1
0084(not DCBUS 0100); the XGUS frame header is0x5AA5. The frame header/screen switching registers for the two protocols are different, please fill in according to your actual project protocol.3. Virtual screen + third-party PLC simulator (Modbus is the most commonly used)
For Modbus projects, this is your daily 80% debugging posture:
- screen ashost: useModbus Slave(simulated slave) to connect to the other end of the virtual serial port, the screen reads 4x0000 hold register, change the value in Slave, and the screen changes in real time
- screen asSlave: UseModbus Poll(simulated master) to poll the screen and verify whether the frames returned by the screen are correct.
4. Virtual screen + real PLC device
Connect the PLC serial port to the computer (RS232 uses USB to RS232 converter, RS485 uses USB to RS485 converter, TTL uses USB to TTL converter), select the correspondingphysical serial portand baud rate for the virtual screen, and open the serial port to directly interact with PLC data. Without the need to repeatedly download screen programs, debugging efficiency is significantly improved.
Compiled from VisualHMI development documentation of Guangzhou Dacai Technology (hmi-doc.gz-dc.com) Quick Start "Virtual Screen Debugging", copyright belongs to Dacai Technology.
Leave a Reply