Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Serial in vb.net

Status
Not open for further replies.

Harris100

Programmer
Joined
Feb 7, 2015
Messages
3
Location
US
How to I change these lines in vb.net Serial? Thanks
MSComm2.CommPort = 4
MSComm2.PortOpen = True
MSComm2.Settings = "9600,N,8,1"
MSComm2.InBufferCount = 0
 

[tt]My.Computer.Ports.OpenSerialPort()[/tt]

has a number of overloads to enable you to open the port with a variety of parameters.
 
Alternatively drop a SerialPort component on your form and set its properties either through code or through the PropertyGrid.
 
is this is correct?

My.Computer.Ports.Serial.CommPort = 4
My.Computer.Ports.Serial.PortOpen = True
My.Computer.Ports.Serial.Settings = "9600,N,8,1"
My.Computer.Ports.Serial.InBufferCount = 0

Thanks
 
I've never used any form of port control with VS. The last time I directly programmed serial or parallel ports was in assembler under DOS.

I've just given you a couple of alternative things for you to experiment with.

You can also look at [tt]System.IO[/tt] where all the port control methods reside. ([tt]My.Computer[/tt]) just uses a small subset of them.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top