Serial Port API

The APIs are supplied by the serial Port object and are used to implement the communication protocol logic of a single or multiple controllers that are not supported by FactoryTalk Optix Studio by default.

Available APIs

The following methods are available:
public void Open();
public void Close();
public byte[] ReadBytes(uint count);
public char[] ReadChars(uint count);
public byte ReadByte();
public char ReadChar();
public string ReadLine();
public byte[] ReadBytesUntil(string delimiter);
public char[] ReadCharsUntil(string delimiter);
public void WriteBytes(byte[] buffer);
public void WriteChars(char[] buffer);
public void WriteLine(string text);
public void CancelRead();
The following C# properties enable you to read or write the object variables, and to change the operation of some methods:
public string PortName { get; set; }
public uint BaudRate { get; set; }
public byte DataSize { get; set; }
public ParityType Parity { get; set; }
public StopBitsType StopBits { get; set; }
public FlowControlType FlowControl { get; set; }
public TimeSpan Timeout { get; set; }
public string NewLine { get; set; } = "\n";