Shared Serial Ports - Get access to serial ports and devices by multiple applications
Docs

Shared Ports

Virtual Serial Port Tools supports creation of virtual serial devices that “share” an existing serial device, allowing any number of applications to work with the original serial device.

Shared Port

Connection

To create a shared port, first call the ISerialPortLibrary.createSharedPort method and then configure it using the ISharedPortDevice.sharedPort property.

Additional port options can be set using IConfigurableDevice.baudRate, IConfigurableDevice.dataBits, IConfigurableDevice.parity, IConfigurableDevice.stopBits and IConfigurableDevice.flowControl properties. These properties allow you to override port parameters.

Operation

Shared virtual serial port is created as non-exclusive device and allows itself to be opened by any number of applications. Actual data and control codes are redirected to original serial device.

The first application that opens a port is assigned as “master” application. Only master application is allowed to set several important port parameters, such as baud rate, line parameters and flow control settings. All attempts to modify these settings by other opening applications are silently discarded.

Other port parameters, like wait masks, timeouts and others are per-application and may be different. When all handles to the shared device are closed, the next application that opens a serial device is again assigned as “master” application.

If there are parameter overrides configured for a port, they will silently be used instead of the configuration specified by the application.

It is not supported to create several shared ports for the same original port. Configuration utility explicitly prohibits it, but API does not. If you still create several shared port devices for the same original device, only one of them will work at a time.

Configuration Utility

Configuration Utility allows the user to create and configure shared ports using the Share Port Window.