beckhoff — 5.2.1 adsPortOpenEx

API Parameter Return value long : returns the error state of the function. 5.1.20 adsAmsPortEnabled Returns a truth value indicating whether the passed port is open. long adsAmsPortEnabled(JNIBool lj_pEnabled); Parameter JNIBool : j_pEnabled JNIBool buffer which contains the truth value after the call. Return value long : returns the error state of the function. 5.1.21 getAdsCallbackObject Returns the associated AdsCallback object. AdsCallbackObject getAdsCallbackObject (); Parameter Return value AdsCallbackObject : the AdsCallbackObject object 5.2 Extended functionalities With the existing functions only one ADS port could be created for each process.

Particularly for multithreaded applications this is not sufficient, since the individual ADS commands would block each other. With the new functions it is now possible to use more than one port. This would enable a separate ADS port to be used for each thread, for example. New ports can be opened via the AdsPortOpenEx function. The returned port number is then transferred as parameter to the individual sync functions. 5.2.1 adsPortOpenEx Establishes a connection (communication port) to the TwinCAT message router. Unlike with AdsPortOpen, a new ADS port is opened each time. The methods marked as thread-safe are passed the port number returned by AdsPortOpenEx as a parameter.

If no TwinCAT MessageRouter is present, the AdsPortOpenEx function will fail. long adsPortOpenEx (); TX1000 20 Version: 1.1