Solved

Trying to read COM Port hangs up

Posted on 2009-04-08
1
142 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
Deathrace earned 500 total points
ID: 24105242
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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