Close Serial Port (script step reference)

By September 1, 2019September 4th, 2019Online 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 18


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 ; "" ]

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 14 to 18 –> Close Serial Port (serip7800) 2019-0904 12:00:34