Sincerely help vb serial port communication failure problem!!!!!!
Time:09-17
I use mscomm1 controls try via bluetooth microcontroller data read from a serial port (com3) Run the tip real-time error 8002: invalid port number
Private Sub Form_Load () If MSComm1. PortOpen=True Then MSComm1. PortOpen=False 'first to determine whether a serial port to open, If you open the first closed MSComm1.Com mPort=3 'set port 1 MSComm1. Settings="115200, N, 8, 1" 'set the baud rate, parity, seven data bits, one stop bit MSComm1. InBufferSize=1024 'sets the receive buffer of 1024 bytes MSComm1. OutBufferSize=4096 'sets the send buffer of 4096 bytes MSComm1. InBufferCount=0 'empty input buffer MSComm1. OutBufferCount=0 'empty output buffer MSComm1. SThreshold=1 'send buffer empty trigger to send events MSComm1. RThreshold=1 'every X characters to receive buffer triggered receive events MSComm1. OutBufferCount=0 'empty send buffer MSComm1. InBufferCount=0 'empty receive buffer MSComm1. PortOpen=True 'open the serial port MSComm1. An InputMode=comInputModeText
The most strange is that with this program can be read by cable port (com6) normal single chip out data, to com3 is no And with the arduino serial port monitor can be read normal two ports (com6 or com3) data
CodePudding user response:
Information not helped by the analysis of the problems Invalid port number is invalid port number This error is generally in a serial port does not exist, when it is 1) that can only be run to confirm you a serial port is exist, 2) Intel ME also like Com3, will there be a serial port of overlapping, really not in the device manager to change the serial number,
CodePudding user response:
The arduino and serial assistants can read so a serial port is the existence of certain Serial number also changed numerous times and no success... So I'm very helpless ah t. T
CodePudding user response:
A problem in MSComm1. PortOpen=True MSComm1 PortOpen always shows to false
CodePudding user response:
Try without serial port control, use the API to operate
CodePudding user response:
Connect other serial ports are closed, or try to restart the machine,