Search code examples
c#twincattwincat-adstwincat-ads-.net

Query the configured TwinCAT Static Routes using TwinCAT - ADS API


I am using the Beckhoff.TwinCAT.Ads Version = 6.0235 NuGet package in c#, I want to query the configured Static Routes:

TwinCAT Static Routes

I have tried with TwinCAT.Ads.TcpRouter and TwinCAT.Router namespaces with no success:

  1. Is that possible?
  2. Which class or method from the API should I use?

Expected Result:

ICollection<RouteInfo> or something similar

Thanks in advance for your help, any comment would be very appreciated.

Miguel


Solution

  • Just parse the C:\TwinCAT\3.1\Target\StaticRoutes.xml file. This is the location where the static routes entries you see in the editor are stored.