Skip to main content

Serial_GetPortNames (function reference)

By July 1, 2023July 17th, 2023Online Help, Troi Serial Plug-in
Troi Serial Plug-in > Functions reference > Serial_GetPortNames
Troi Serial Plug-in for FileMaker Pro

Serial_GetPortNames

Returns the names of all serial ports that are available on the computer.

SyntaxFunction badge

Serial_GetPortNames ( switches )

Parameters

switches not used, reserved for future use. Leave blank or put "-Unused"

Returned Result

Data type returned

Text

Result

The returned result is a list of serial ports that are available on the computer that is running FileMaker Pro. Each available port is on a different line. On Mac OS a result can be for example:
Internal Modem
Bluetooth-Modem

On Windows the result will be for example:
COM2
COM4

Use this function to let the user of the database choose which port to open. Store the name of the chosen port in a global field. You can then check the next time the database is opened whether the portname is still present and ask the user if he wants to change his preference.

If an error occurs an error code is returned. Returned error codes can be:

$$-108 memFullErr Ran out of memory

Other errors may be returned.

Originated in

Troi Serial Plug-in 3.0

Compatibility

FileMaker Pro 16 to FileMaker Pro 2023

Example

Set Field [ result ; Serial_GetPortNames ( "" ) ]

This returns the names of the serial ports available. On our macOS with a Keyspan USB to serial adaptor installed, the result is this list:
KeySerial1
USA28X1d1P1.1
USA28X1d1P2.2
Bluetooth-PDA-Sync
BlueSerialPort-2
Bluetooth-Modem

The first 3 ports are supplied by the Keyspan adaptor. The last 3 ports are serial ports over a Bluetooth wireless connection. To be able to use these you need proper Bluetooth hardware.

On Windows the names of the ports might be:
COM2
COM3
COM4

Used in example file

Terminal.fmp12

Related functionFunction badge

Serial_Open

Related script stepScript step badge

Open Serial Port

Related topics

Troi Serial Plug-in online help (overview)


Online Help Page for Troi Serial Plug-in for 16 to 2023 –> Serial_GetPortNames (serip4804) 2023-0717 12:49:49