twincattwincat-ads

Running TwinCAT 3 ADS Only (without XAR)


I have a working C project which communicates with local or remote TwinCAT 3 systems using ADS C API (online examples work well too).

However, we are now trying to deploy the program to a different machine which only has TwinCAT ADS installed (as explained here under "Installation of TwinCAT 3 ADS only"). We have added routes on both machines. To simplify testing, we even disabled the firewall completely on both the ADS machine and the runtime machine. But I am still unable to get the data back to the application.

The error I am getting from the ADS is 10051, which is basically a Winsock error:

Network is unreachable. A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.

However, I am pretty sure the routes are valid. They were added using a broadcast search, and I can see in Wireshark that both systems are exchanging ADS Read/Write requests constantly (if I remove the route on any of the PCs, the exchange stops).

One detail is that the ADS-only system is not in start mode, i.e. I am unable to put it to "Start", although this is perhaps normal since there is no runtime there?

My questions are:


Solution

  • I can answer part of that properly - no the ADS only system does not need to be (and cannot be) in RUN.

    Are you sure the connection has been made from both ends? sometimes one server will have the connection registered, the other won't.

    The other thing to check is whether you have other entries in either ADS routes list with the same IP or ADS addresses (I imagine your development PLC may have multiple entries). I have seen this get confused before and had to remove the clashing entries before it would work.