如何用vb编写监控COM1口的数据内容
这是我编写的内容,text1什么也收不到,新手还请多多指教,谢谢了!程序代码:
Private Sub Form_Load() If Not MSComm1.PortOpen Then = 1 '您的串口是 COM1 MSComm1.InputMode = comInputModeText MSComm1.Settings = "9600,n,8,1" MSComm1.RThreshold = 6 MSComm1.EOFEnable = False MSComm1.Handshaking = comNone MSComm1.InBufferSize = 1024 End If End Sub Private Sub MSComm1_OnComm() Select Case '接收数据 Case comEvReceive '对数据进行处理 InString = MSComm1.Input Text1.Text = InString + Text1.Text End Select End Sub
[此贴子已经被作者于2016-7-27 23:07编辑过]