Help needed on RS232
Help needed on RS232
Help needed on RS232
Help needed on RS232
Help needed on RS232
Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232
Help needed on RS232 Help needed on RS232
Help needed on RS232
Go Back  Xtreme Visual Basic Talk > > > Help needed on RS232


Reply
 
Thread Tools Display Modes
  #1  
Old 06-24-2010, 02:07 AM
danielsii danielsii is offline
Newcomer
 
Join Date: Jun 2010
Posts: 3
Unhappy Help needed on RS232


I need help in getting data from COM port. I can't the the moRS232.Read(128) code working in my project. And i get my rs232 class from codeworks.it. The message thrown is "Read Pending Error".
Attached is my VB project if u need it for reference.

Thanks.

here is the code:
Code:
Private Sub FindDistance_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FindDistance.Click

        ' Initializes and Open
        'moRS232.Read(128)

        'Read value from the input
        Dim tRead As String = Trim(moRS232.InputStreamString)
        Dim Read_X1 = Microsoft.VisualBasic.Left(tRead, 4)
        Dim Read_Y1 = Microsoft.VisualBasic.Right(tRead, 4)
        If Label4.Text = "Connected" Then
            intX1 = random.Next(-25, 25)
            intY1 = random.Next(-25, 25)
        Else
            intX1 = 0
            intY1 = 0
        End If
        circleDiameter = 1

        'Calculate Distance
        Dim Distance1 As Single = Math.Sqrt(intX1 ^ 2 + intY1 ^ 2)
        'Dim Distance2 As Single = Math.Sqrt(Read_X2 ^ 2 + Read_Y2 ^ 2)
        'Dim Distance3 As Single = Math.Sqrt(Read_X3 ^ 2 + Read_Y3 ^ 2)

        Label2.Text = Distance1

        'Draw the Radar
        picCanvas.Invalidate()
    End Sub
Attached Files
File Type: zip CTS1.zip (211.5 KB, 2 views)

Last edited by danielsii; 06-24-2010 at 03:49 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Help needed on RS232
Help needed on RS232
Help needed on RS232 Help needed on RS232
Help needed on RS232
Help needed on RS232
Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232 Help needed on RS232
Help needed on RS232
Help needed on RS232
 
Help needed on RS232
Help needed on RS232
 
-->