SerialPort.List
---------------

Returns list of names of serial ports.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SerialPort](component_SerialPort.md) | [3.0](newinversion30.md) | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ❌ No |

MBS( "SerialPort.List" { ; Mode } ) 

**MBS**( **"SerialPort.List";** /\* Returns list of names of serial ports. \*/  
**$Mode**) /\* Optional; Pass 1 on Windows to see longer names from registry.  
Pass 2 on macOS or Windows to return JSON. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Mode | Pass 1 on Windows to see longer names from registry.   Pass 2 on macOS or Windows to return JSON. |  | Optional |

### Result

Returns the list of names.

### Description

Returns list of names of serial ports.  
On Windows can list ports with textual name.  
  
When script calling this function runs on client in FileMaker Pro, you may see the ports of the machine your FileMaker Pro runs on. But if run on server side, you see the ports of the server.  
  
Added mode 2 for MBS Plugin in version 12.3 to return information as JSON. Returns JSON array with objects. Each object has at least Index and Name values.  
### Examples

Get device list and pick first one:

 Set Variable \[ $list ; Value: MBS ( "SerialPort.List" ) \]  
Set Variable \[ $firstDevice ; Value: LeftValues($list ; 1) \]  
### See also

- [SerialPort.Close](SerialPortClose.md)
- [SerialPort.Open](SerialPortOpen.md)
- [SerialPort.Path](SerialPortPath.md)
- [SerialPort.Read](SerialPortRead.md)
- [SerialPort.Write](SerialPortWrite.md)

### Release notes

- **Version 12.3**
    - Added Mode = 2 for [SerialPort.List](https://www.mbsplugins.eu/SerialPortList.shtml) function to return information as JSON.
- **Version 8.2**
    - Rewrote [SerialPort.List](http://www.mbsplugins.eu/SerialPortList.shtml) on Windows to query COM ports better.

### Example Databases

- [Network/Serial Port](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Network/Serial%20Port.shtml#2ScriptAnchor_)

### Blog Entries

- [Neues MBS Plugin 12.3 für Claris FileMaker](https://www.mbsplugins.de/archive/2022-07-12/Neues_MBS_Plugin_123_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 12.3 for Claris FileMaker](https://www.mbsplugins.de/archive/2022-07-12/MBS_Plugin_123_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.3pr1](https://www.mbsplugins.de/archive/2022-06-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.2pr6](https://www.mbsplugins.de/archive/2018-05-07/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.2pr10](https://www.mbsplugins.de/archive/2016-05-20/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)
- [Serial Port functions for MBS Filemaker Plugin](https://www.mbsplugins.de/archive/2012-12-01/Serial_Port_functions_for_MBS_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 25th February 2026

  
[SerialPort.LastError](SerialPortLastError.md) - [SerialPort.Open](SerialPortOpen.md)

[HTML Version](SerialPortList.shtml)