Platforms to show: All Mac Windows Linux Cross-Platform
Back to SerialPortMBS class.
SerialPortMBS.AvailableBytes as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
SerialPortMBS.BaudRate as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This happens automatically in the destructor.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Please call Open() to open a device.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
If enabled, the CTS (clear-to-send) signal is monitored for output flow control.
Than if CTS is turned off, output is suspended until CTS is sent again.
(Read and Write computed property)
SerialPortMBS.DataBits as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Value is 5, 6, 7 or 8.
(Read and Write computed property)
Some examples using this property:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
If enabled DSR (data-set-ready) signal is monitored for output flow control.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
(Read and Write computed property)
SerialPortMBS.HasDataAvailable as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
SerialPortMBS.HasLine as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
The plugin checks the input buffer for a newline character.
SerialPortMBS.Open(Name as String, Index as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
You get the names from List function.
The port is opened with default settings.
Even if port is not showing in list, it may still open here, e.g. virtual COM ports on Windows.
You can open several ports with different connections, e.g. by calling Open once for each SerialPortMBS object.
SerialPortMBS.OpenPath(Path as String)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 23.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This allows you to e.g. open a pipe on Windows.
SerialPortMBS.Parity as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Can be 0 (off), 1 (odd) or 2 (even), see constants.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
The plugin regularly checks if there is new data and raises the DataAvailable event if needed.
SerialPortMBS.Read(MaxByteSizeToRead as Integer) as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Reads bytes from serial port and returns them as text.
The text returned may be shorter than length bytes.
See also AvailableBytes function.
SerialPortMBS.ReadByte as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This is very useful for reading control characters which you can't easily put in a text in FileMaker.
Like 13 for a LF (line feed) or 10 for CR (carriage return).
See also AvailableBytes function.
SerialPortMBS.ReadLine as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
The plugin buffers input and reads text until first newline character. Returns text without that newline character.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
While suspended, we do not trigger event and clear incoming buffer regularly.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
(Read and Write computed property)
SerialPortMBS.StopBits as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Can be 1 or 2 on Mac/Linux and 1, 1.5 or 2 on Windows.
(Read and Write computed property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
While suspended, we do not trigger event and clear incoming buffer regularly.
Please call Resume later.
SerialPortMBS.WinRTSControl as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This property gives you direct access to the RTS control setting on Windows.
And this is set to either disabled or handshake by the RTS property.
Raises an exception if used on MacOS or Linux.
(Read and Write computed property)
SerialPortMBS.Write(value as String) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
Be aware that text encoding conversion may result in different bytes than expected, so please verify on other side the text encoding matches the expectations.
SerialPortMBS.WriteByte(value as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
This is very useful for sending control characters which you can't easily put in a text in Xojo.
Like 13 for a LF (line feed) or 10 for CR (carriage return).
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | SerialPort | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
(Read and Write computed property)
The items on this page are in the following plugins: MBS Util Plugin.