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
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