SerialPort.SetTag
-----------------

Sets tag value.

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

MBS( "SerialPort.SetTag"; PortReference; Tag ) 

**MBS**( **"SerialPort.SetTag";** /\* Sets tag value. \*/  
**$PortReference**; /\* The reference number of the port. You get this number from [SerialPort.Open](SerialPortOpen.md) when you open the port.e.g. $port \*/   
**$Tag**) /\* The new tag value. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PortReference | The reference number of the port. You get this number from [SerialPort.Open](SerialPortOpen.md) when you open the port. | $port |
| Tag | The new tag value. |  |

### Result

Returns OK or error.

### Description

Sets tag value.  
You can use the tag value to associate whatever value you like with the serial port object. Use [SerialPort.GetTag](SerialPortGetTag.md) function later to get back the value.  
### See also

- [SerialPort.GetTag](SerialPortGetTag.md)
- [SerialPort.Open](SerialPortOpen.md)
- [SerialPort.Read](SerialPortRead.md)
- [SerialPort.Resume](SerialPortResume.md)
- [SerialPort.SetCTS](SerialPortSetCTS.md)
- [SerialPort.SetDSR](SerialPortSetDSR.md)
- [SerialPort.SetDTR](SerialPortSetDTR.md)
- [SerialPort.SetParity](SerialPortSetParity.md)
- [SerialPort.SetRTS](SerialPortSetRTS.md)
- [SerialPort.Setup](SerialPortSetup.md)

### Release notes

- **Version 13.0**
    - Added [SerialPort.GetTag](https://www.mbsplugins.eu/SerialPortGetTag.shtml) and [SerialPort.SetTag](https://www.mbsplugins.eu/SerialPortSetTag.shtml) functions.

### Blog Entries

- [New in MBS FileMaker Plugin 13.0](https://www.mbsplugins.de/archive/2023-01-24/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.6pr1](https://www.mbsplugins.de/archive/2022-12-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 29th November 2022 , last changed 29th November 2022

  
[SerialPort.SetStopBits](SerialPortSetStopBits.md) - [SerialPort.SetXON](SerialPortSetXON.md)

[HTML Version](SerialPortSetTag.shtml)