Find the PLC in the Network

How to add route for searching Beckhoff PLC

ADS

There are two methods to add  ADS route. If we don’t add the ADS route  then our PLC/PLC can’t communicate.

Method 01:

If you are developer this would be preferable way via visual studio as shown in the following image.


Choose Target will offer another dialog where we press on “Search Ethernet”  and this will give us the following dialog. If you have used the device previously then the first dialog will offer you an option to select that device.


Method 2:

Basically this is same like the verification process of Method 1. If we don’t have the Visual Studio environment then we can use this method. 

Click on the show hidden icon (small triangle) on bottom right corner and find the TwinCAT icon.

Press on the TwinCAT icon  Router | Edit Route

This will provide a dialog as shown in the following image.

 

If you press on the Add button that will open a dialog as shown in the method 1. The same process can be applied to complete the method.After adding the route our program can communicate with the PLC and we can read write any variable to the PLC.

We shall add a video tutorial soon here, so please visit us again

TIPs:

If you have a problem pinging the remote device

=>Check the Windows Firewall, disable it if you are in the internal network

=>Enable the ICMP port for the ping request, now you should be able to ping or connect a remote desktop, etc.

 

The Automation Device Specification (ADS) describes a device-independent and fieldbus-independent interface governing the type of access to ADS devices. The TwinCAT system architecture allows the individual modules of the software (e.g. TwinCAT PLC, TwinCAT NC, …) to be treated as independent devices: For every task there is a software module (“Server” or “Client”).

The messages between these objects are exchanged through a consistent ADS interface by the “message router”. This manages and distributes all the messages in the system and over the TCP/IP connections. TwinCAT message routers exist on every TwinCAT PC and on every Beckhoff BCxxxx Bus Controller.

This allows all TwinCAT server and client programs to exchange commands and data. 

ADS routes are used for communication on both sides by the respective ADS applications. ADS library (provided by Beckhoff) is used to communicate between PC (a TwinCAT device) with the Beckhoff PLC (another TwinCAT device). The ADS library wraps TCP/IP protocol so we don’t need to do anything with the communication.

We need to know the IP address of the target PLC device. If we know this will give us quick setup, if we don’t know the IP address then we can try Broadcast Search option. Even if we want to use this option we need to make sure that the PLC has the same network part. If you don’t know the IP address you can set the IP address and get the by directly connecting the monitor to the PLC and check it.

Put the IP address (not the AMS Net Id) in the edit box near the button Enter Host Name and press on the button. This will give the connection information of the PLC.

Select the found device and press on the IP Address radio button and Add Route (it will ask a password of the PLC). Press Close and OK. Done!

We can verify if the route has been added by opening little icon in the right hand corner of the PC and by opening the TwinCAT icon.

If we press on the icon then Router  then edit route will provide a info. If our PLC is visible there then it has been added correctly.

For network related issue please visit hemelix.com/network/

TIPS:

The visual studio may mess up some time then it may be difficult to add a route, in this case, we need to follow these tips.

01: Clean the route from the PLC and the PC

02: Rebuild the project for the target (for x86 PLC build it for x86)

03: Also check in which computer HMI/SCADA is running if HMI/SCADA can’t connect over ADS

04: If you are using for example other than Beckhoff computer and if the device ADMIN log in name other than Administrator then for routing add the same login name (other than Administrator)

Download the sample from the link given above.

Next, let’s try to understand persistent data https://www.hemelix.com/plc/structured-text-mqtt/

Ask questions related to Hemelix sample code and design at Google group https://groups.google.com/g/hemelix