Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help for serial port programming in vb.net

Status
Not open for further replies.

yvqn9945

Newbie level 4
Joined
Aug 19, 2013
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
50
I want to write a vb.net program for serial communication which consists of Tx window Rx window connect and disconnect buttons. When I press connect if the COM port is unplugged then it must give a message in msgbox – COM port is unplugged please plug it and try again. How to write code for this please any one give a sample code.
 

In .NET you can access serial ports through System.IO.Ports: SerialPort
A less complex example, showing how to receive a string: https://msdn.microsoft.com/en-us/library/7ya7y41k.aspx
The constructor will throw System.IO.IOException if the COM port doesn't exist or cannot be opened. I don't know if "cannot be opened" means that no device is connected, or if another app has control of the port.

I'd help more but all my COM ports are virtual.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top