Comments (5)
ADSIGRP_SUMUP_DELDEVNOTE
is not implemented in AdsLib, and I guess it isn't in TwinCAT, too.
To reduce wait time you could set the port timeout to 0 and ignore the AdsSyncDelDeviceNotificationReqEx
error code (would be ADSERR_CLIENT_SYNCTIMEOUT
)
AdsSyncSetTimeoutEx(local_port, 0);
for (auto h: handles) {
AdsSyncDelDeviceNotificationReqEx(local_port, &target, h);
}
Or if you just want to clean up the easy way, make sure you allocated all notifications from the same local_port, and just close the port. The cleanup code will take care and delete the notifications for you.
AdsSyncSetTimeoutEx(local_port_notifications, 0);
AdsPortCloseEx(local_port_notifications);
But keep in mind there is a TCP connection in the background (I expect you are not working on localhost). So make sure the AdsDelRoute()
is not called to early, or the EtherCAT Master might not get all AdsDelDevNotificationRequests.
from ads.
Thanks for the response.
It looks to me like calling AdsDelRoute shouldn't be a worry as long as it's done on the same thread as AdsPortCloseEx.
Calling AdsPortCloseEx will definitely clean up all of the handles properly, but it looks like it still does that synchronously by walking the notifications opened on a port, telling it's dispatcher to erase them, which individually calls DeleteNotification to send the relevent DELNOTE AmsRequest on the AmsConnection for that dispatcher.
Do you know where I could submit a bug report/feature request for the SUMUP_DELDEVNOTE support in the twincat server itself?
from ads.
You are right about the cleanup sequence. Setting the timeout to 0 would just simulate "asynchronous" closing, by not waiting for the response. In that case you can be sure that the operating systems sockets write() was called, but you can't be sure the data was already send to the wire. So if you call AdsPortCloseEx()
to early, it would shutdown the socket before the whole buffer was send.
I am not sure about your use case but maybe std::async(AdsPortCloseEx, local_port)
fits better, if you just don't want to wait inside your main thread.
In general your local support office would handle TwinCAT bug reports and feature requests. The product manager for TwinCAT ADS is Sven Oberschmidt, he would have answered your question here, but currently he is on vacation.
from ads.
Thanks. I missed the implication yesterday and this seems like it definitely mitigates my problem substantially, though you are correct that it does mean that I need to be careful about cleaning up routes.
Might I also suggest then that in AmsPort::Open or AmsPort::Close you reset the port's timeout to Default.
As to support, I've had really great experiences in the past working with Beckhoff's field technicians, but emailing support.usa@beckhoff has rarely gotten me results. I think it was 2 years ago that I got in touch about bugs in this sample that are still there today:
Specifically, the release handles packet should be using index group 0xf006 rather than 0xf020, and the return code checks that follow are referencing the return code buffer from the original handle acquisition response rather than the release response (pBuffRes rather than pBuffRelRes).
from ads.
I re-triggered your bug report in the TC2 example, too.
from ads.
Related Issues (20)
- How to Dynamically Read Struct Symbols and Obtain Subsymbol Values Using the Beckhoff ADS Library in C# HOT 1
- Ping an AMS NetId HOT 7
- 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
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.