I have an integer array d:int[] d = new int[]{1,2,3,4}
I want to send this through serial port (System.IO.Ports.SerialPort).
What I have written was
serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);//SerialPort.GetPortNames()[0].ToString(), 9600, Parity.None, 8, StopBits.One
serialPort.Handshake = Handshake.None;
serialPort.RtsEnable = true;
serialPort.DtrEnable = true;
if(serialPort.IsOpen == false)
serialPort.Open();
try
{
//serialPort.Write(buffer_2_send, 0, buffer_2_send.Length);
serialPort.Write(d, 0, d.Length);
serialPort.WriteLine("43665");
}
catch (Exception exp)
{
MessageBox.Show(exp.ToString());
}
And I am receiving this array d in another PC with Hercules RS232 software.
I am not seeing anything in Hercules screen for the line serialPort.Write(d, 0, d.Length);.
What would be the problem. The line serialPort.WriteLine("43665"); is writing the string "43665" to the Hercules screen.