SerialPort.Setup
----------------

Sets baud rate, parity and data/stop bits in one call.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SerialPort](component_SerialPort.md) | [16.3](newinversion163.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "SerialPort.Setup"; PortReference; BaudRate { ; Parity; DataBits; StopBits } ) 

**MBS**( **"SerialPort.Setup";** /\* Sets baud rate, parity and data/stop bits in one call. \*/  
**$PortReference**; /\* The reference number of the port. You get this number from [SerialPort.Open](SerialPortOpen.md) when you open the port.e.g. $port \*/   
**$BaudRate**; /\* The new baud rate as number.e.g. 9600 \*/   
**$Parity**; /\* Optional; The new parity setting.  
Can be 0 (off), 1 (odd) or 2 (even)e.g. 1 \*/   
**$DataBits**; /\* Optional; The new data bits setting.  
Value can only be 5, 6, 7 or 8.e.g. 8 \*/   
**$StopBits**) /\* Optional; The new stop bits setting.  
Can be 1 or 2 on Mac and 1, 1.5 or 2 on Windows.e.g. 2 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PortReference | The reference number of the port. You get this number from [SerialPort.Open](SerialPortOpen.md) when you open the port. | $port |  |
| BaudRate | The new baud rate as number. | 9600 |  |
| Parity | The new parity setting.   Can be 0 (off), 1 (odd) or 2 (even) | 1 | Optional |
| DataBits | The new data bits setting.   Value can only be 5, 6, 7 or 8. | 8 | Optional |
| StopBits | The new stop bits setting.   Can be 1 or 2 on Mac and 1, 1.5 or 2 on Windows. | 2 | Optional |

### Result

Returns OK or error.

### Description

Sets baud rate, parity and data/stop bits in one call.  
### See also

- [SerialPort.GetXON](SerialPortGetXON.md)
- [SerialPort.Open](SerialPortOpen.md)
- [SerialPort.Path](SerialPortPath.md)
- [SerialPort.Read](SerialPortRead.md)
- [SerialPort.Resume](SerialPortResume.md)
- [SerialPort.SetCTS](SerialPortSetCTS.md)
- [SerialPort.SetDTR](SerialPortSetDTR.md)
- [SerialPort.SetRTS](SerialPortSetRTS.md)
- [SerialPort.SetTag](SerialPortSetTag.md)
- [SerialPort.SetXON](SerialPortSetXON.md)

### Release notes

- **Version 16.3**
    - Added SerialPort.Setup function.

### Blog Entries

- [MBS FileMaker Plugin, version 16.3pr2](https://www.mbsplugins.de/archive/2026-06-15/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 11st June 2026 , last changed 11st June 2026

  
[SerialPort.SetXON](SerialPortSetXON.md) - [SerialPort.Suspend](SerialPortSuspend.md)

[HTML Version](SerialPortSetup.shtml)