Skip to main content

Close Serial Port (script step reference)

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

Close Serial Port

Closes a serial port with the specified name.

SyntaxScript step badge

Close Serial Port [ Select ; Result (error) ; Port name ]


Select entire contents replaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Result (error) an error code
Port name the name of the port to close

Returned Result

Data type returned

Error code


The returned result is an error code. Returned error codes can be:

0 no error the port was closed
$$-4210 portDoesNotExistErr port is not available on this computer
$$-4211 AllPortsNullErr no serial ports are available on this computer
$$-108 memFullErr ran out of memory

Other errors may be returned.

Originated in

Troi Serial Plug-in 5.0


FileMaker Pro 16 to FileMaker Pro 2023


If the “Port name” option is empty or “” all ports are closed.


This will close the COM3 port:

Close Serial Port [ Select ; $ErrorCode ; "COM3" ]

Example 2

This will close all open ports:

Close Serial Port [ Select ; $ErrorCode ; "" ]

Used in example file


Related script stepScript step badge

Open Serial Port

Related functionsFunction badge


Related topics

Troi Serial Plug-in online help (overview)

Online Help Page for Troi Serial Plug-in for 16 to 2023 –> Close Serial Port (serip7800) 2023-0717 13:11:42