View Single Post
 
Old 09-14-2013, 11:43 AM
StealthRT's Avatar
StealthRT StealthRT is offline
Contributor
 
Join Date: Aug 2002
Posts: 785
Exclamation Serial port (com port) reading data

I have a valentine 1 radar and also the V1Connect (bluetooth adaptor) for it hooked to my PC via a Virtual Serial Port (COM 16).

I am trying to read the data coming from it but all i am getting is gibberish.

My VB.net code is this:
Code:
    Private pendingMsg As New stringbuilder

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each s In System.IO.Ports.SerialPort.GetPortNames()
            lstPorts.Items.Add(s)
        Next s
    End Sub

    Private Sub SerialPort1_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
        Dim completedMsg As String
        completedMsg = String.Empty
        pendingMsg.Append(SerialPort1.BytesToRead())

        If pendingMsg.Length >= 24 Then
            completedMsg = pendingMsg.ToString
            Debug.Print(completedMsg)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SerialPort1.BaudRate = 57600
        SerialPort1.DataBits = 8
        SerialPort1.Parity = IO.Ports.Parity.None
        SerialPort1.StopBits = IO.Ports.StopBits.One
        SerialPort1.PortName = "COM16" 'lstPorts.SelectedItem.ToString
        SerialPort1.Open()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        SerialPort1.Close()
        txtReceived.Text = ""
    End Sub
and the gibberish output is this:
Code:
71919383957767795114129133
71919383957767795114129133152
71919383957767795114129133152167
71919383957767795114129133152167171
71919383957767795114129133152167171190
71919383957767795114129133152167171190191
71919383957767795114129133152167171190191209
71919383957767795114129133152167171190191209228
71919383957767795114129133152167171190191209228229
71919383957767795114129133152167171190191209228229247
71919383957767795114129133152167171190191209228229247266
71919383957767795114129133152167171190191209228229247266280
71919383957767795114129133152167171190191209228229247266280285
71919383957767795114129133152167171190191209228229247266280285304
71919383957767795114129133152167171190191209228229247266280285304311
71919383957767795114129133152167171190191209228229247266280285304311323
71919383957767795114129133152167171190191209228229247266280285304311323342
71919383957767795114129133152167171190191209228229247266280285304311323342343
71919383957767795114129133152167171190191209228229247266280285304311323342343361
71919383957767795114129133152167171190191209228229247266280285304311323342343361380
71919383957767795114129133152167171190191209228229247266280285304311323342343361380382
71919383957767795114129133152167171190191209228229247266280285304311323342343361380382399
71919383957767795114129133152167171190191209228229247266280285304311323342343361380382399418
71919383957767795114129133152167171190191209228229247266280285304311323342343361380382399418419
71919383957767795114129133152167171190191209228229247266280285304311323342343361380382399418419437
71919383957767795114129133152167171190191209228229247266280285304311323342343361380382399418419437456
The datasheets for the V1 are:
http://i.stack.imgur.com/IMIG2.jpg

http://i.stack.imgur.com/UnKUU.jpg

http://i.stack.imgur.com/vJpe6.jpg

http://i.stack.imgur.com/bJFar.jpg

http://i.stack.imgur.com/cTnhn.jpg

The full PDF for the ESP can be found http://www.valentine1.com/eula/eula.asp?d
Reply With Quote