943,865 Members | Top Members by Rank

Ad:
Sep 13th, 2009
0

help with serial port....

Expand Post »
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...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
gopi17 is offline Offline
39 posts
since Sep 2008
Sep 15th, 2009
0

Re: help with serial port....

this if vb.net sample
Reputation Points: 10
Solved Threads: 10
Junior Poster in Training
omoridi is offline Offline
72 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Open a file in vb 6
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: send sms to mobile in vb6.0





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC