help with serial port....

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 23
Reputation: gopi17 is an unknown quantity at this point 
Solved Threads: 0
gopi17 gopi17 is offline Offline
Newbie Poster

help with serial port....

 
0
  #1
Sep 13th, 2009
hey can't seem to send and receive data...i followed an instruction from another site...but its not working...can u guys help me out..
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub conn_button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles conn_button.Click
  2. LoginPanel.Hide()
  3. dport.Text = ComboBox1.SelectedItem
  4. drate.Text = ComboBox2.SelectedItem
  5. SerialPort1.PortName = ComboBox1.SelectedItem
  6. SerialPort1.BaudRate = ComboBox2.SelectedItem
  7.  
  8. End Sub
  9.  
  10. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendButton.Click
  11. ListBox1.Items.Add(nameBox.Text & " : " & ChatBox.Text)
  12. ChatBox.Clear()
  13. ChatBox.Select()
  14. SerialPort1.Open()
  15. SerialPort1.Write(ChatBox.Text)
  16. SerialPort1.Close()
  17.  
  18. SerialPort1.Open()
  19. ListBox1.Items.Add(SerialPort1.ReadChar())
  20. SerialPort1.Close()
  21.  
  22. End Sub
  23.  
  24. Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
  25. MsgBox("This is a software", MsgBoxStyle.OkOnly)
  26.  
  27. End Sub
  28.  
  29. Private Sub Dis_button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dis_button.Click
  30. LoginPanel.Show()
  31. End Sub
.

thanks guys...
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 57
Reputation: omoridi is an unknown quantity at this point 
Solved Threads: 8
omoridi omoridi is offline Offline
Junior Poster in Training

Re: help with serial port....

 
0
  #2
Sep 15th, 2009
this if vb.net sample
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC