需要帮助连接数字称重机 [英] help required to connect to the digital weighing machin
问题描述
您好b $ b
我正在编写一份阅读牛奶乳制品秤秤的申请表。
该工具有有RS232端口,我已经购买了一个USB转换连接到我的笔记本电脑。
称重机是3级。
我是在vb.net 2010中使用串口选项
COM13,9600,Parity.None,8,StopBits.One
我无法打开连接但无法读取数据..我正在使用以下代码来读取数据
Hi
I am writing an application to read weighing scale reading of a milk dairy.
The instrument has got RS232 Port and I have purchased a USB converted to connect this to my laptop.
weighing machine is of class 3.
I am using Serial Port option in vb.net 2010
"COM13", 9600, Parity.None, 8, StopBits.One
I am unable to open the connection but unable to read the data.. I am using following code to read the data
Private Sub port_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles port.DataReceived
Try
If port.IsOpen = False Then port.Open
ReceivedText(port.ReadExisting())
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
End Sub()
Private Sub ReceivedText(ByVal [text] As String)
If Me.rtbReceived.InvokeRequired Then
Dim x As New SetTextCallback(AddressOf ReceivedText)
Me.Invoke(x, New Object() {(text)})
Else
Me.rtbReceived.Text &= [text]
End If
End Sub
'rtbReceived is a Rich text box
我得到一些需要净化的垃圾数据......而且无法一直获取数据。
不是没有如何连接以及如何连接获取数据。
尝试过port.write(P)和port.write(T)和port.write(P).. ..但没有任何结果...收到的消息作为操作超时。
请帮助我得到结果
感谢和问候
Santosh Sharma
I am getting some garbage data which needs to be purified... and unable to get data all the time.
don't no how to connect and how to get data.
have tried port.write("P") and port.write("T") and port.write("P").... but without any result ... message received as operation timed out.
Please help me to get the result
Thanks and regards
Santosh Sharma
推荐答案
您应该与创建它的人交谈 - 他们应该提供技术支持并且会比我们更了解他们的产品。如果他们不这样做,那么找另一个供应商并要求退款!
几乎可以肯定,数据不符合您的预期格式或数据通讯参数错误。所以请与知道的人交谈!
You should talk to the people who created it - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
It's almost certainly that the data isn't in the format you expect, or the data comms parameters are wrong. So talk to the people who know!
这篇关于需要帮助连接数字称重机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!