Property

System.SerialPortCount


Warning

This item was deprecated in version 2019r2. Please use SerialDevice.Count as a replacement.

Description

Returns the number of serial ports available.

Sample code

The following displays the names of the serial ports on the computer:

For i As Integer = 0 To System.SerialPortCount - 1
  MsgBox(System.SerialPort(i).Name)
Next

Compatibility

All project types on all supported operating systems.