serial port

conquerors

New member
Joined
Dec 20, 2010
Messages
1
Programming Experience
Beginner
is there any other way to access a serial port using visual basic.net 2010? i followed the steps in this site, How to access serial and parallel ports by using Visual Basic .NET but i just got this output

Open the serial port.
Send the attention command to the modem.
Wait for data to come back to the serial port...

and stopped there. i can't get the

Read the OK response data in the serial port.
Close the serial port.

and i was thinking, because it is very much easy to access serial port in vb6, so can i just use vb6 and then connect to visual basic.net? it is like a language inside a language. would that be possible? thank you much.
 
That article is very old, click the link in first line where is says "For a Microsoft Visual Studio 2005 version of this article, see 904795" to see an example using the SerialPort class.
You would also need to configure the baud rate etc if the connected equipment uses different than default settings. The data sent and received depends on the protocol of the connected equipment.
 
Accessing the serial port is really simple.
Just create an object instantiating from System.IO.Ports.SerialPort
Then you can configure it to open the preferred com, set the baudrate, send and receive messages.
As JohnH already told you, you can thus send and receive data, what then is written in that data depends on the protocol used.
 
Back
Top