Knowledge Base Nr: 00294 sercom.cs - http://www.swe-kaiser.de

Downloads:

c#: .net: serielle schnittstelle (rs232) benutzen

  
private static void CourtsEinAus(byte[] cmd)
{
// Instantiate the communications port with some basic settings
SerialPort port = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One);

// Open the port for communications
port.Open();

// Write a set of bytes
port.Write(cmd, 0, cmd.GetLength(0));

// Close the port
port.Close();
}