?
Solved

Trying to read COM Port hangs up

Posted on 2009-04-08
1
Medium Priority
?
144 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 1500 total points
ID: 24105242
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

765 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