ComClose
- Last UpdatedFeb 02, 2024
- 1 minute read
This function flags a port for close and reopen when the next ComOpen (Port mode 0) or driver open occurs. It does not actually close the port when called. Any Cicode tasks that are waiting for a read or write operation to complete (or that are retrying to read or write) return with a range error.
Plant SCADA automatically closes all communication ports at shutdown.
This function can only be called from an I/O server.
Syntax
ComClose(hPort)
hPort:
The communication port handle, returned from the ComOpen function. This handle identifies the table where all data on the associated communication port is stored.
Return Value
0 if the port is successfully closed, or an error if the port is already closed or if the port number is invalid.
Related Functions
Example
See ComOpen.