电子吊称中的仪表串口发送微机的到数据包是十六制的。但接收的一串串“25517013481272311660041760016226”这样的数字,这不是厂家说的十六制呀?
项目:代码如下
With Ports("COM1")
Dim cnt As Integer = .BytesToRead
If cnt > 0 Then '缓冲区是否有数据
Dim Val(cnt - 1) As Byte
.Read(val,0,cnt)
Dim v As String
For Each t As Byte In Val
v = v & t
Next
if forms("电子称重").opened then
forms("电子称重").controls("textbox8").value = forms("电子称重").controls("textbox8").value & v
else
forms("电子称重").open()
forms("电子称重").controls("textbox8").value = v
end if
End If
End With
请教下,是代码有问题吗?
[此贴子已经被作者于2010-7-8 10:10:35编辑过]