
VB上动态显示单片机送来的数据 同时可以保存在 数据库Access 以后调用处理
你好,不知道我能不能加你QQ,我看你回答了一个关于VB程序的问题,我也有类似的问题希望你解答一下可以吗?...
你好,不知道我能不能加你QQ,我看你回答了一个关于VB程序的问题,我也有类似的问题希望你解答一下可以吗?
展开
1个回答
展开全部
Dim intInputLen As Integer
Select Case Me.MSComm1.CommEvent
Case comEvReceive
'此处添加处理接收的代码
MSComm1.InputMode = comInputModeBinary '二进制接收
intInputLen = MSComm1.InBufferCount
ReDim bytInput(intInputLen)
bytInput = MSComm1.Input
For i = 0 To UBound(bytInput)
If Len(Hex(bytInput(i))) = 1 Then
strData = strData & "0" & Hex(bytInput(i))
Else
strData = strData & Hex(bytInput(i))
End If
Next
End Select
Select Case Me.MSComm1.CommEvent
Case comEvReceive
'此处添加处理接收的代码
MSComm1.InputMode = comInputModeBinary '二进制接收
intInputLen = MSComm1.InBufferCount
ReDim bytInput(intInputLen)
bytInput = MSComm1.Input
For i = 0 To UBound(bytInput)
If Len(Hex(bytInput(i))) = 1 Then
strData = strData & "0" & Hex(bytInput(i))
Else
strData = strData & Hex(bytInput(i))
End If
Next
End Select
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询