Hi everyone I want to send/receive data serially via rs-232 using c#,VS10 ... my code for do so is as follows .....
SerialPort sp = new SerialPort();
//predefined values are baud rate =9600, parity=none, databits=8,stopbit=1
//for sending data I used a textbox same name itself and a button "sendbutton" which coded as follow
try
{
sp.WriteLine(textBox.Text);
textBox.Text = "";
}
catch (System.Exception ex)
{
baudRatelLabel.Text = ex.Message;
}
//for receiving data code is as follows
try
{
textBox.Text = "";
textBox.Text = sp.ReadLine();
}
catch (System.Exception ex)
{
baudRatelLabel.Text = ex.Message;
}
I installed this application in two pc and communicate both using using rs232 (both female end). But the data i'm sendig from one pc by send button is not received by another pc ....what should i do now.....
First thing I would do is use a different application to read the data. HyperTerminal, for example. Try to figure out if your app is sending or not, then, once you get it to send, work on trying to figure out if it is receiving data properly or not.