AdsPortCloseEx

The connection (communication port) to the TwinCAT message router is closed. The port to be closed must previously have been opened via an AdsPortOpenEx call.

LONG AdsPortCloseEx(
  long nPort
);

Parameter

port

[in] port number of an Ads port that had previously been opened with AdsPortOpenEx.

Return value

Returns the function's error state.

Sample

See Sample 2: Write synchronously to the PLC.