How do I go about doing this? In a C# program I created a serial port and opened it successfully, but when I send the ASCII command to the com port I get nothing back (when using ReadExisting in C#). When I use “ReadLine” function in C# my app bombs.
I’m unsure whether or not I’m supposed to be using the c# serial port object or some other object to read this data, since the documentation says “ASCII command interface” - not sure what that means.
I’m opening the port like so…
// Set the properties.
port.PortName = "COM" + portnum;
port.BaudRate = 9600;
port.Parity = Parity.None;
port.StopBits = StopBits.One;
// Set the read/write timeouts
port.ReadTimeout = 300;
port.WriteTimeout = 300;
port.DtrEnable = true;
//open the port
port.Open();
Then trying to write & read like so…
port.Write("TF");
//pause for a little and let the serial port catch up
Thread.Sleep(50);
returntemp = port.ReadLine();