AdsLib
Loading...
Searching...
No Matches
Functions
AdsLib.h File Reference
#include "AdsDef.h"

Go to the source code of this file.

Functions

long AdsPortCloseEx (long port)
 
long AdsPortOpenEx ()
 
long AdsGetLocalAddressEx (long port, AmsAddr *pAddr)
 
long AdsSyncSetTimeoutEx (long port, uint32_t timeout)
 

Detailed Description

Copyright (c) 2015 - 2022 Beckhoff Automation GmbH & Co. KG

Function Documentation

◆ AdsGetLocalAddressEx()

long AdsGetLocalAddressEx ( long  port,
AmsAddr pAddr 
)

Returns the local NetId and port number.

Parameters
[in]portport number of an Ads port that had previously been opened with AdsPortOpenEx().
[out]pAddrPointer to the structure of type AmsAddr.
Returns
ADS Return Code

◆ AdsPortCloseEx()

long AdsPortCloseEx ( long  port)

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

Parameters
[in]portport number of an Ads port that had previously been opened with AdsPortOpenEx().
Returns
ADS Return Code

◆ AdsPortOpenEx()

long AdsPortOpenEx ( )

Establishes a connection (communication port) to the message router. The port number returned by AdsPortOpenEx() is required as parameter for further AdsLib function calls.

Returns
port number of a new Ads port or 0 if no more ports available

◆ AdsSyncSetTimeoutEx()

long AdsSyncSetTimeoutEx ( long  port,
uint32_t  timeout 
)

Alters the timeout for the ADS functions. The standard value is 5000 ms.

Parameters
[in]portport number of an Ads port that had previously been opened with AdsPortOpenEx().
[in]timeoutTimeout in ms.
Returns
ADS Return Code