SerialPort

The SerialPort component is used to control a serial port file resource. The component provides synchronous and event-driven I/O, access to pin and break states, and access to serial driver properties.

SerialPort can be wrapped in an internal Stream object, accessible through the BaseStream property, and passed to classes that wrap or use streams.

Properties

The key properties for the SerialPort component include:

  • BaudRate. Specifies the baud rate for the serial port.

  • BytesToRead. Specifies the number of bytes of data in the receive buffer.

  • BytesToWrite. Specifies the number of bytes of data in the send buffer.

  • DataBits. Specifies the standard length of data bits per byte of data.

  • ReadTimeout. The amount of time, in milliseconds, that a read operation can run without completion before a time-out occurs.

  • WriteTimeout. The amount of time, in milliseconds, that a write operation can run without completion before a time-out occurs.

Events

Events can be configured for the SerialPort to specify the behaviour of the control. For example, an action can be configured to occur when an error occurs using the ErrorReceived event property.

For information on configuring events and other components of the design using a script, see: Working with Scripts.

Adding a SerialPort

When you drag a SerialPort component from the Toolbox to a form in Flow Designer, it will appear as an entry in the design space. You can select the control and configure it using the Properties pane.

More information on the SerialPort component can be viewed at the link to Microsoft® Documentation.