Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello All
I am using serialport communication code in my project but it is not reading data
tel me the solution for this
i am using the folloing method for reading data from serialport

C#
private void Read_Click(object sender, EventArgs e)
        {
            try
            {
                //clear the text box
                textBox.Text = "";
                //read serial port and displayed the data in text box
                textBox.Text = sp.ReadLine();


            }
            catch (System.Exception ex)
            {
                baudRatelLabel.Text = ex.Message;
            }

        }
Posted

1 solution

Hi,

you've already opened and setted up your SerialPort (unfortunately this part of code is missing above)?

MSDN Provides great example here:
http://msdn.microsoft.com/de-de/library/system.io.ports.serialport.aspx[^]

With Best Regards
 
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