rs232
rs232
rs232
rs232
rs232
rs232 rs232 rs232 rs232 rs232 rs232 rs232 rs232
rs232 rs232
rs232
Go Back  Xtreme Visual Basic Talk > > > rs232


Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2010, 10:27 PM
anigurl anigurl is offline
Newcomer
 
Join Date: Sep 2010
Posts: 1
Default rs232


Code:
Public Class Messager
    Private mintBaud As Integer
    Dim varRx As String

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Comm1.CommPort = TextBox1.Text
        Comm1.Settings = TextBox2.Text & ",N,8,1"
        Try
            Comm1.PortOpen = True

        Catch ex As Exception
            If Err.Number = 8018 Then
                MsgBox("The port cant open", vbOKOnly, "Error")
                Exit Sub
            ElseIf Err.Number = 8002 Then
                MsgBox(" The Port number invalid", vbOKOnly, "Error")
                Exit Sub
            End If

        End Try
        Button1.Enabled = False
        Button2.Enabled = True
        Button3.Enabled = True
        Button4.Enabled = True
        CheckBox1.Enabled = True
        CheckBox2.Enabled = True
        Comm1.DTREnable = CheckBox1.Checked
        Comm1.RTSEnable = CheckBox2.Checked

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged

    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        Comm1.DTREnable = CheckBox1.Checked
    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        Comm1.RTSEnable = CheckBox2.Checked
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        RichTextBox1.Text = ""
        Comm1.Output = RichTextBox1
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        If Comm1.CommEvent > 1000 Then Comm1.InBufferCount = 0
        If Comm1.CommEvent = 2 And Comm1.InBufferCount > 0 Then
            varRX = Comm1.Input
            RichTextBox2.Text = varRx
        End If

    End Sub

    Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged

    End Sub

    Private Sub RichTextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox2.TextChanged

    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Comm1.PortOpen = False
        Button1.Enabled = True
        Button2.Enabled = False
        Button3.Enabled = False
        Button4.Enabled = False
        CheckBox1.Enabled = False
        CheckBox2.Enabled = False
        Comm1.DTREnable = False
        Comm1.RTSEnable = False
    End Sub

    Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged

    End Sub

    Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar1.Click

    End Sub

End Class


plz any1 debug this for me...i remove the timer in hardware and insert the buffers codes...i face the problem wen i try to send the data..and receive the data...

Last edited by Flyguy; 09-13-2010 at 02:52 AM.
Reply With Quote
  #2  
Old 09-20-2010, 01:35 AM
mkaras's Avatar
mkarasrs232 mkaras is offline
Ultimate Contributor

Retired Leader
* Expert *
 
Join Date: Mar 2004
Location: Beaverton, OR
Posts: 1,874
Default

You will have to provide a whole lot more information regarding what is not working, what symptoms you see, what you have tried and how those attempts made things better or worse.

Please do not expect anyone to try to guess what you are doing or to spend much more time than the little bit you did to post this so far.

Michael Karas
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
rs232
rs232
rs232 rs232
rs232
rs232
rs232 rs232 rs232 rs232 rs232 rs232 rs232
rs232
rs232
 
rs232
rs232
 
-->