Recently, I am working on a serial communication problem in VB! The general function is to press a button, VBProgramSend hexadecimal data to the serial port. Then, it receives the data returned from the lower computer.
The program is relatively simple, so if you can debug the program in the virtual serial port under Windows, it will be almost completed!
Now let's summarize the debugging steps:
1. Download The sudt serialnull serial port virtual tool and serial port debugging Assistant (the Super Terminal can do the same, but the Super Terminal does not receive the callback function)
Ii. First, sudt serialnull serial port virtual tool virtualizes two serial ports COM1 and com2 (without these two virtual serial ports, the software program cannot find the serial port)
3. Open the vbprogram, and the serial port debugging assistant to adjust the corresponding configuration (baud rate, data bit, stop bit ...), Note that the serial port number used by the VB program is different from the serial port number used by the debugging assistant. Otherwise, an error is reported!
4. When the vbprogram sends data, the debugging assistant receives the data and returns the data automatically. The data received by VB is displayed in the text control. The program is successfully debugged!
In addition, if the virtual serial port creation process is enabled, the physical serial port is temporarily unavailable. When the virtual serial port is switched off, the physical serial port communication is normal!