Solved

Trying to read COM Port hangs up

Posted on 2009-04-08
1
140 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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