MyException - 我的异常网
当前位置:我的异常网» VB » 关于VB的MSC控件422串口回读数据的有关问题

关于VB的MSC控件422串口回读数据的有关问题(2)

www.MyException.Cn  网友分享于:2013-12-31  浏览:21次

MSComm2.RThreshold = 1
MSComm1.RThreshold = 1
Text1 = "Q1$ "
'Text1 = "vb编写串口通信程序,可以随便进行汉字、字母、符号的发送和接收. "
'Text1 = "AT+CMGS= " + Chr(13) + Chr(13) + Chr(10) 'rs!tel
'Text1 = "AT+CMGS= " + Chr(13) + Chr(13) + Chr(80) 'rs!tel
'Text1 = "AT+CMGS= " + "vb编写串口通信程序,可以随便进行汉字、字母、符号的发送和接收. " + Chr(10) 'rs!tel
strTxt = Text1
End Sub

Private Sub MSComm1_OnComm()
Dim AscInput As String
Select Case Me.MSComm1.CommEvent
Case comEvReceive
Sleep (50) '延迟
'此处添加处理接收的代码
MSComm1.InputMode = comInputModeText 'Text接收
AscInput = MSComm1.Input
Text3 = AscInput
End Select
End Sub

Private Sub MsComm2_OnComm()
Dim AscInput As String
Select Case Me.MSComm2.CommEvent
Case comEvReceive
Sleep (50) '延迟
'此处添加处理接收的代码
MSComm2.InputMode = comInputModeText 'Text接收
AscInput = MSComm2.Input
MSComm2.Output = Mid(AscInput, 1, 1)
Text2 = AscInput
End Select
End Sub

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有