By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,230 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,230 IT Pros & Developers. It's quick & easy.

problem using serialport in vb2005

P: n/a
Jan
Hello,

I want to send some simple strings to com1 using vb2005. I want to read
it
in Hyperterminal.
I succeeded to send some data en read it in Hyperterminal, only the data
I
received is not the data I send.

This is the code i used:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
SendSerialData()
End Sub

Sub SendSerialData()
Dim data As String = "x"

' Send strings to a serial port.
Using com1 As IO.Ports.SerialPort =
My.Computer.Ports.OpenSerialPort("COM1", 2400, IO.Ports.Parity.None, 8,
1)

com1.WriteLine(data)
End Using
End Sub

Is there something I forgot?
The settings of the serial port I also used for hyperterminal.

Thank you very much for even reading my question

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 31 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Seb
Jan wrote:
Hello,

I want to send some simple strings to com1 using vb2005. I want to read
it
in Hyperterminal.


Maybe

Sub Com1Conn()

Using com1 As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort("COM1", 9600)
com1.DtrEnable = True
com1.Write("YOUR DATA" & vbCrLf)
' Insert code to transfer data to and from the com port.
End Using

End Sub
Jan 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.