Comments (5)
Yes, your issues sounds related. I will answer here and close #56 as duplicate.
Do you use AdsSetLocalAddress()
to set your AdsLib AmsNetId?
Line 71 in 56bc355
Check which AmsNetId your local TwinCAT router would use when you connect using "direct-fb"(TcAdsDll.dll). Either look into the routing table of your TwinCAT server or check the router setting on the client like this:
Then before you open any AdsPort in your AdsLib example. Call AdsSetLocalAddress()
with that AmsNetId
diff --git a/example/example.cpp b/example/example.cpp
index fe893a2..833fa4c 100644
--- a/example/example.cpp
+++ b/example/example.cpp
@@ -180,6 +180,8 @@ void runExample(std::ostream& out)
static const AmsNetId remoteNetId { 192, 168, 0, 231, 1, 1 };
static const char remoteIpV4[] = "ads-server";
+ AdsSetLocalAddress({192, 168, 0, 114, 1, 1});
+
// add local route to your EtherCAT Master
if (AdsAddRoute(remoteNetId, remoteIpV4)) {
out << "Adding ADS route failed, did you specified valid addresses?\n";
For more background see commit c1bfedd and let me know if this didn't fix your issue.
from ads.
Hi, I have the same issue, routes are getting added in both the pc. From the client pc, with the direct fb to ads read there are no issues. However with the library I keep getting 1861.
from ads.
In fact it was working some time back not sure if there is something from network which I can check, but why twincat-3 direct fb for ads read working
from ads.
Hi
Thanks and it did work and resolved my issue.
One more query on the general stuff, is we want to basically integrate it in to our WinCE machine (client is WinCE 6.0) and communicate with the CX device.
But in order to add the static route, is there any other alternative other than installing Twincat on the CE machine, like some software which is not run time but just to add the route.At the end, this static route is a redundant operation as we have the AdsAddroute in some sense.
from ads.
Some background on "ADS routing":
With TwinCAT installed on your system you get a full blown ADS router. Ignoring a lot of details that's just a TCP/IP multiplexer. Having a machine A (your WinCE client) and a machine B (your TwinCAT CX) which wants to communicate with ADS. This is what happens Behind the Scenes:
Your machine A opens a TCP connection to machine B. Over this TCP connection multiple "ADS connections" can be multiplexed. If you have different ADS servers running on your TwinCAT machine. You will have multiple AmsNetIds there. So the component on machine B listening to the TCP socket will need to inspect the incoming ADS packet for its Destination AmsNetId. That component is the TwinCAT ADS router. When the server on machine B wants to reply to a response from machine A. It doesn't know anything about TCP/IP. All it can do is give the response to the TwinCAT ADS router and tell him the destination AmsNetId. The router will then lookup the destination IP in it's routing table. If you would use TwinCAT on machine A. It is very likely that entry was already semi-automatically added. If you don't have TwinCAT on machine A. You need to setup the static route on machine B manually. All tools you need, should be installed already.
What we skipped is, how does the first message from your example arrive at machine B's ADS router? AdsLib was intended to be used for simple but portable (non Windows) applications. That's why there is no real ADS router implemented. All we have is a simple translation table AmsNetId -> IP address. That table is controlled by AdsAddRoute()
. Another thing missing is the local AmsNetId. On TwinCAT systems that AmsNetId is controlled by the router. As we don't have a real router, we derive the AmsNetId from our local IP. That mechanism is not very deterministic, so AdsSetLocalAddress()
was introduced.
- Make sure to assign a deterministic AmsNetId on your AdsLib client ->
AdsSetLocalAddress()
- In your AdsLib client add a route to your TwinCAT system ->
AdsAddRoute()
- On your TwinCAT system add a route for your AdsLib client
from ads.
Related Issues (20)
- Two application running on the same machine that read a variable from the same plc concurrently HOT 8
- Use std::function for callback HOT 1
- ADS-sum command: Read or Write a list of variables with one single ADS-command HOT 1
- impossible to compile under ubuntu 20.04.5 HOT 1
- CMake Error at CMakeLists.txt:40 (install): install TARGETS given target "ads" which does not exist in this directory. HOT 3
- Unreachable PLC Blocks All Other Operations During Timeout Period HOT 2
- Reading route using `adstool`
- Will beckhoff officially launch the golang version of the ADS API HOT 2
- SymbolAccess for Bool HOT 5
- ADS Server HOT 1
- Async WriteReqEx HOT 5
- AdsNotification cycle time deviation HOT 2
- RGB Image over ADS HOT 1
- Port: 30000 already in used as 0x7ffe55930ed0 terminate called after throwing an instance of 'AdsException'
- Passing IP from terminal
- ADS Connection Error With Docker Container HOT 1
- CMake build failing HOT 2
- ADS READ for TwinCAT Motion
- Info: connection closed by remote in sockets.cpp HOT 2
- twincat3 - ubuntu error code 6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ads.