SerialPort.OpenPath
-------------------

Opens a special file, device or pipe.

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

MBS( "SerialPort.OpenPath"; Path { ; Mode } ) 

**MBS**( **"SerialPort.OpenPath";** /\* Opens a special file, device or pipe. \*/  
**$Path**; /\* The native path to open.e.g. "\\\\\\\\.\\\\pipe\\\\Test" \*/   
**$Mode**) /\* Optional; The opening mode.  
Can be Read, Write or ReadWrite.  
Default is ReadWrite.e.g. "ReadWrite" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Path | The native path to open. | "\\\\\\\\.\\\\pipe\\\\Test" |  |
| Mode | The opening mode.   Can be Read, Write or ReadWrite.   Default is ReadWrite. | "ReadWrite" | Optional |

### Result

Returns the port reference value which you pass to other [SerialPort](component_SerialPort.md) functions.

### Description

Opens a special file, device or pipe.  
This allows you to e.g. open a pipe on Windows.  
Serial Port reference numbers are starting at 28000 and counting up for each new port.  
### Examples

Open pipe and send message:

 Set Variable \[ $serial ; Value: MBS ( "SerialPort.OpenPath"; "\\\\\\.\\pipe\\Test") \]   
Set Variable \[ $r ; Value: MBS ( "[SerialPort.Write](SerialPortWrite.md)"; $serial ; "Hello World") \]   
Set Variable \[ $r ; Value: MBS ( "[SerialPort.Close](SerialPortClose.md)"; $serial ) \]  
### See also

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

### Release notes

- **Version 13.4**
    - Added [SerialPort.OpenPath](https://www.mbsplugins.eu/SerialPortOpenPath.shtml) function, so you can use [SerialPort](https://www.mbsplugins.eu/component_SerialPort.shtml) functions to open special files or pipes.
    - Added [SerialPort.WaitNamedPipe](https://www.mbsplugins.eu/SerialPortWaitNamedPipe.shtml) function to wait for a pipe and use with [SerialPort.OpenPath](https://www.mbsplugins.eu/SerialPortOpenPath.shtml) on Windows.

### Blog Entries

- [News in MBS FileMaker Plugin 13.4](https://www.mbsplugins.de/archive/2023-09-20/News_in_MBS_FileMaker_Plugin_1/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 13.4 für Claris FileMaker](https://www.mbsplugins.de/archive/2023-09-12/Neues_MBS_Plugin_134_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 13.4 for Claris FileMaker - More than 7100 Functions In One Plugin](https://www.mbsplugins.de/archive/2023-09-12/MBS_Plugin_134_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.4pr7](https://www.mbsplugins.de/archive/2023-09-07/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.4pr6](https://www.mbsplugins.de/archive/2023-09-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 29th August 2023 , last changed 31st August 2023

  
[SerialPort.Open](SerialPortOpen.md) - [SerialPort.Path](SerialPortPath.md)

[HTML Version](SerialPortOpenPath.shtml)