Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to send data via com port while pressing a button???
Posted
Comments
ZurdoDev 12-Mar-12 12:50pm    
You write code so that when the button is pressed it does what you need it to. What you are asking is quite involved, what have you done so far?
nevin pillai 12-Mar-12 13:01pm    
http://www.4shared.com/rar/v7CA_VMT/New_folder.html

this is what i have done....

1 solution

In order to access comport you need to have namespace
using System.IO.Ports;
then in button click event write this
{
then need to create an object for serial port like this
C#
SerialPort obj = new SerialPort("COM1");//But be shore that the bardrate matches between hardware and computer system 
            obj.Open();

 obj.Write("some data");
            obj.Close();

}

Hope this may help you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900