I've got a Beckhoff CX9020 module with the following informations (as seen in General Tab in the CX Configuration Tool):
System Information:
TwinCAT:
Now I have installed TwinCAT 3, but can't establish a working Connection.
The questions:
First of all you have to establish route to the controller. General idea is to right-click "TwinCAT" icon in the tray, select "router" and then "edit routes". Then add your controller by IP or by searching.
Assuming you use C# for your application:
You should use Twincat.Ads command yourClient.Connect(5.39.55.247.1.1,851)
Where the address is of the controller with ".1.1" and the port is the ADS port.
To get the port you should double click the controller in the PLC part of the project and look at the port there. Default of first PLC is 851.
When you have using TwinCAT.Ads;
just add
tcClient = new TcAdsClient();
tcClient.Connect(5.39.55.247.1.1,851);
to the code.
You can find good examples on the Beckhoff site for C# and for other languages.