Solved

Trying to read COM Port hangs up

Posted on 2009-04-08
1
138 Views
Last Modified: 2012-05-06
I send a byte packet to request a value from my device, the packet is sent correctly however when it gets to  indvalue = IndicatorPort.ReadLine()
it just hangs nothing happens
Public WithEvents IndicatorPort As New IO.Ports.SerialPort 

Public CurrCOMPort As New ArrayList
 

Public Sub RequestProbeValues()

        Dim Packet(4) As Byte

        Dim intloop As Integer

        Try

            For intloop = 0 To CurrCOMPort.Count - 1

                IndicatorPort = CurrCOMPort.Item(intloop)

                Packet(0) = 42 'Constant BMS message

                Packet(1) = 4 'Constant Length of Table upload

                Packet(2) = 6 ' Constant Command of Table upload

                Packet(3) = 23

                Packet(4) = 152

                IndicatorPort.Write(Packet, 0, 4)

                System.Threading.Thread.Sleep(100)

                Read()

            Next

        Catch ex As Exception

            MessageBox.Show("Unable to Communicate  -Request Probe Value")

        Finally

        End Try

    End Sub

    Public Sub Read()

        indvalue = IndicatorPort.ReadLine()

    End Sub

Open in new window

0
Comment
Question by:cmdolcet
1 Comment
 
LVL 9

Accepted Solution

by:
Deathrace earned 500 total points
ID: 24105242
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now