Linking into Eclipse Galileo

In order to make use of the AdsToJava.dll you need to add the TcJavaToAds.jar to your Eclipse project. This article shows how to add the library and describes which imports are needed in order to make use of it (Please note that procedure can change as your Eclipse version differs from the version mentioned above):

First you need to start Eclipse and create a new project. After that navigate to the Package Explorer and right click your project and choose Properties (see picture below).

Linking into Eclipse Galileo 1:

The next step is to select the "Java Build Path" category and click the "Add External JARs..." button. In the upcoming browser you need to select the TcJavaToAds.jar. The TcJavaToAds.jar can be found at "TwinCAT\ADS Api\AdsToJava".

Linking into Eclipse Galileo 2:


Finally, you need to import the libraries packages depending on which components you want to use. For further information see Java Ads samples.


import de.beckhoff.jni.AdsConstants;
import de.beckhoff.jni.Convert;
import de.beckhoff.jni.JNIByteBuffer;
import de.beckhoff.jni.JNILong;

import de.beckhoff.jni.tcads.AdsCallDllFunction;
import de.beckhoff.jni.tcads.AdsCallbackObject;
import de.beckhoff.jni.tcads.AdsDevName;
import de.beckhoff.jni.tcads.AdsNotificationAttrib;
import de.beckhoff.jni.tcads.AdsNotificationHeader;
import de.beckhoff.jni.tcads.AdsState;
import de.beckhoff.jni.tcads.AdsSymbolEntry;
import de.beckhoff.jni.tcads.AdsVersion;
import de.beckhoff.jni.tcads.AmsAddr;
import de.beckhoff.jni.tcads.AmsNetId;
import de.beckhoff.jni.tcads.CallbackListenerAdsRouter;
import de.beckhoff.jni.tcads.CallbackListenerAdsStatel;