serialportused

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - USB Interface
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-18, Last change: 2025-08-18

returns the ports that are in use already



See Also:

Example Illustration

 missing image of serialportused

Syntax

su=serialportused

Output Parameter

su: serial in use

Examples


serialportused




Copyright 2022-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, serialportused, is designed to identify serial ports that are currently in use on a system. It is part of the SolidGeometry library, specifically introduced in version 5.1, and is categorized under auxiliary procedures.

Input Parameters

The function serialportused does not take any input parameters. It operates without requiring any arguments from the user.

Output

The function returns a variable su, which is a list of serial ports that are currently in use.

Algorithm Explanation

The function utilizes two key MATLAB functions: serialportlist("all") and serialportlist("available").

The core operation of the function is performed by the setdiff function:

su = setdiff(serialportlist("all"), serialportlist("available"));

The setdiff function calculates the difference between the two lists: all serial ports and available serial ports. The result is a list of serial ports that are in use, as these are the ports present in the "all" list but absent from the "available" list.

Example Usage

To use the function, simply call it without any arguments:

serialportused

This will return the list of serial ports that are currently in use.

Related Functions

The function is related to other functions such as raamboterminal and serialportlist, which may be used for further serial port management and operations.

Overall, the serialportused function provides a straightforward method to identify which serial ports are occupied, aiding in debugging and resource management tasks.

Algorithm explaination created using ChatGPT on 2025-08-18 21:58. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21