![]() |
Serial_Close |
Closes a serial port with the specified name.
Syntax
Serial_Close ( switches ; portname )
Parameters
switches | not used, reserved for future use. Leave blank or put "-Unused" |
portname | the name of the port to close |
Returned Result
Data type returned
Error code
Result
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 3.0
Compatibility
FileMaker Pro 16 to FileMaker Pro 2023
Considerations
If the portname parameter is “” all ports are closed.
Example
This will close the COM3 port:
Set Field [ gErrorCode ; Serial_Close ( "-Unused" ; "COM3" ) ]
Example 2
This will close all open ports:
Set Field [ gErrorCode ; Serial_Close ( "-Unused" ; "" ) ]
Used in example files
SimpleSerial.fmp12
Terminal.fmp12
Related function
Serial_Open |
Related script step
Close Serial Port |
Related topics
Troi Serial Plug-in online help (overview)