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

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. CitectSCADA 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

ComOpen, ComRead, ComWrite

Example

See ComOpen

See Also

Communication Functions