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
Queries number of bytes available in buffer.

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
Queries or sets the baud rate.

(Read and Write computed property)

SerialPortMBS.Clear

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clears incoming buffer.

SerialPortMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Closes serial port.

This happens automatically in the destructor.

SerialPortMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The constructor.

Please call Open() to open a device.

SerialPortMBS.CTS as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The current CTS mode.

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
Queries or sets the data bit size.

Value is 5, 6, 7 or 8.
(Read and Write computed property)

Some examples using this property:

SerialPortMBS.DSR as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Queries or sets whether DSR mode is used.

If enabled DSR (data-set-ready) signal is monitored for output flow control.
(Read and Write computed property)

SerialPortMBS.DTR as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Queries or sets whether DTR (data-terminal-ready) flow control is used.

(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
Whether data is available to read.

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
Checks if a line is available.

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
Opens the serial port.
Example

dim port as new SerialPortMBS

// open a port
port.Open("COM1")

// check the path
MessageBox port.Path

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
Opens the special file/device/pipe.

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
Queries or sets parity setting.

Can be 0 (off), 1 (odd) or 2 (even), see constants.
(Read and Write computed property)

SerialPortMBS.Poll

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Polls to see if there is new data.

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.

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
Returns the byte value or an error message.

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
Reads a line of text from serial port.

The plugin buffers input and reads text until first newline character. Returns text without that newline character.

SerialPortMBS.Resume

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Resumes serial port.

While suspended, we do not trigger event and clear incoming buffer regularly.

SerialPortMBS.RTS as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Queries or sets whether to use RTS (request-to-send) flow control.

(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
Queries or sets number of stop bits.

Can be 1 or 2 on Mac/Linux and 1, 1.5 or 2 on Windows.
(Read and Write computed property)

SerialPortMBS.Suspend

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Suspends serial port.

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
The RTS (request-to-send) flow control.

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
Returns the number of bytes written or an error message.

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
Returns the number of bytes written.

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).

SerialPortMBS.XON as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SerialPort MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Queries or sets if XON/XOFF flow control is used.

(Read and Write computed property)

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...