Cicode Programming Reference > Cicode Function Categories > Communication Functions > ComClose


Closes a communication port. 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. Citect SCADA automatically closes all communication ports at shutdown.

This function can only be called from an I/O Server.




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

ComOpen, ComRead, ComWrite


See ComOpen

See Also

Communication Functions

Published June 2018