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 howCodePudding user response:
VB6 + MSCOMM in Windows 7 32 also often flashes thanAs 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: