If I run my following Code, which I created with SharpDevelop:
SerialPort serial = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One);
void sendMsg_Click(object sender, EventArgs e)
{
serial.Open();
serial.WriteLine(textBox1.Text);
serial.Write(new byte[] {0x0A, 0xE2, 0xFF}, 0, 3);
serial.Close();
}
Below is the Exception appearing while executing the code :
The Exception is the following:
System.IO.IOException: Falscher Parameter.
bei System.IO.Ports.InternalResources.WinIOError
bei System.IO.Ports.SerialStream.EndWrite
bei System.IO.Ports.SerialStream.Write
bei System.IO.Ports.SerialPort.Write
bei System.IO.Ports.SerialPort.WriteLine
bei Chat_via_RS232.MainForm.sendMsg_Click in c:\Users\admin\Documents\SharpDevelop Projects\Latias.eu IT\Chat via RS232\MainForm.cs:Zeile 35
bei System.Windows.Forms.Control.OnClick
bei System.Windows.Forms.Button.OnClick
bei System.Windows.Forms.Button.OnMouseUp
bei System.Windows.Forms.Control.WmMouseUp
bei System.Windows.Forms.Control.WndProc
bei System.Windows.Forms.ButtonBase.WndProc
bei System.Windows.Forms.Button.WndProc
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc
bei System.Windows.Forms.NativeWindow.DebuggableCallback
bei System.Windows.Forms.Application.ComponentManager.FPushMessageLoop
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop
bei System.Windows.Forms.Application.Run
bei Chat_via_RS232.Program.Main in c:\Users\admin\Documents\SharpDevelop Projects\Latias.eu IT\Chat via RS232\Program.cs:Zeile 24
Can someone help me please.
Regards
Lala