AdsGetLocalAddressEx

Returns the local NetId and port number.

LONG AdsGetLocalAddressEx(
  long     port,
  PAmsAddr pAddr
);

Parameter

port

[in] port number of an ADS port that had previously been opened with AdsPortOpenEx or AdsPortOpen.

pAddr

[out] Pointer to the structure of type AmsAddr.

Return value

Returns the function's error state.

Sample

See Sample 2: Write synchronously to the PLC.