VB接收下位机发送的数据并取出其中的数据 求大神相助 本帖最后由 skevil 于 2012-12-12 22:15:14 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.MSComm1.RThreshold = 42. Dim bytInput() As Byte Dim tmp As Variant Case comEvReceive intInputLen = MSComm1.InBufferCount tmp = MSComm1.Input bytInput = tmp For n = LBound(bytInput) To UBound(bytInput) ' 把接收的数据安十六进制格式放入缓冲中 If bytInput(n) = &HFF And bytInput(n + 3) = &HFF Then buffer = buffer & Right("0" & Hex(bytInput(n + 1)), 2) & Right("0" & Hex(bytInput(n + 2)), 2) & " " n = n + 3 End If Next n Text2.Text = buffer 请教sql语句 一个棘手的问题 OCA文件删除后主程序为何不能运行? TRUE DBGRID的使用问题请教 请教如何高效的处理VB中的byte()数组;谢谢!!! 请问自动填表是如何实现的,最好给个实例 请问!如何在dbdynaset中使用findfirst? 用VB画二维曲线 VB关闭用shell打开的网页 请问那位大哥有BMP和GIF文件格式的中文资料,急急急急急急急,谢谢! wmic bat脚本怎么写啊 VB多个窗体怎么同步移动位置?
MSComm1.RThreshold = 42.
Dim bytInput() As Byte
Dim tmp As Variant Case comEvReceive
intInputLen = MSComm1.InBufferCount
tmp = MSComm1.Input
bytInput = tmp
For n = LBound(bytInput) To UBound(bytInput) ' 把接收的数据安十六进制格式放入缓冲中
If bytInput(n) = &HFF And bytInput(n + 3) = &HFF Then
buffer = buffer & Right("0" & Hex(bytInput(n + 1)), 2) & Right("0" & Hex(bytInput(n + 2)), 2) & " "
n = n + 3
End If
Next n
Text2.Text = buffer