Home > Software engineering >  VB in real-time serial communication error 8020
VB in real-time serial communication error 8020

Time:10-11

I VB beginner, recently with USB to RS232 written in VB6.0 by use of 8020 problems, the operating system is Windows 7 64 - bit,
Use serial debugging assistant testing is no problem, you can send receive data, shows that there is no problem,
Program from CSDN download on the BBS (VB serial communication program (VB) program), is a great god what's the solution? Here attached code and some serial debugging assistant, and port screenshots,

Code:


Private Sub CMDRe_Click ()
TRe. Text=TRe. Text & amp; VbCrLf & amp; CStr (MSComm1. Input)
MsgBox "2222 first"
End Sub

Private Sub CMDSend_Click ()
If MSComm1. PortOpen=True Then
MSComm1. The Output=TSend. Text
MsgBox "CCCCCCC first
"The Else
MsgBox "both please connect first
"End the If
End Sub

Private Sub Connect_Click ()
If MSComm1. PortOpen=True Then
MSComm1. PortOpen=False
MsgBox "FALL"
The Else
MSComm1. PortOpen=True
End the If
End Sub

Private Sub Form_Load ()
MPort=7 MSComm1.Com
MSComm1. Settings="9600, n, 8, 1", "
MSComm1. InBufferCount=0
MSComm1. RThreshold=1
MSComm1. SThreshold=1
End Sub

Private Sub MSComm1_OnComm ()
Select Case mEvent MSComm1.Com
Case comEvReceive
TRe. Text=TRe. Text & amp; MSComm1. Input & amp; VbCrLf
End the Select
End Sub
Program download address: http://download.csdn.net/detail/huphup/1195874

CodePudding user response:

Suggest you use VB.NET serialport, VB6 + MSCOMM in Windows 7 64 - bit, may not be how

CodePudding user response:

VB6 + MSCOMM in Windows 7 32 also often flashes than
As if my serial connection 6, 8 feet for the job is not stable, often go wrong, just can't find a serial port, serial port elves also will go wrong

CodePudding user response:

reference 1st floor wangwei244157887 response:
suggest you use VB.NET serialport, VB6 + MSCOMM in Windows 7 64 - bit, may not be how light

I use SP, yeah, but I still want to know why this problem the forehead

CodePudding user response:

refer to the second floor spt_petrolor response:
VB6 + MSCOMM in Windows 7 32 also often flashes than
As if my serial connection 6, 8 feet for the job is not stable, often go wrong, just can't find a serial port, serial port elves also will go wrong

I will only 2 to 3 feet serial port is sub,,
  • Related