I'm trying to communicate with a digital voltmeter through IR communication which failes for now :
All I have is this document :
specification for Fluke 189 Voltmeter
I can open my connection :
SerialPort sp = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
// open serial port
sp.Open();
// set read time out to 500 ms
sp.ReadTimeout = 500;
Sending works, without any errors, but when I try to receive I get a timeout error.
private void btnGetID_Click(object sender, EventArgs e)
{
try
{
//write line to serial port
//sp.WriteLine(txtText.Text);
sp.WriteLine("ID\r");
//clear the text box
txtText.Text = "";
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
try
{
//clear the text box
txtTextReceive.Text = "";
//read serial port and displayed the data in text box
txtTextReceive.Text = sp.ReadLine();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}
I'm 100% sure that the cable and the settings are correct, because I have an official application that can connect to my Voltmeter on the COM3 port with those settings.
Maybe it has something to do with the carriage return? => <CR> or \r ?!?
I hope someone can help me out here.
Thanx in advance...