Serial_GetPortNames |
Returns the names of all serial ports that are available on the computer.
Syntax
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 function
Serial_Open |
Related script step
Open Serial Port |
Related topics
Troi Serial Plug-in online help (overview)