-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library running on Beckhoff IPC not working #141
Comments
On localhost you have to use the TwinCAT router. You, would need to link against TcAdsLib.dll not AdsLib.dll. Call meson with an environment variable pointing to the TwinCAT TcAdsDll.dll similar to this: Line 82 in 0e0f73f
|
Hello, Have i done something wrong? Andres |
Hmm, if you don't get a valid port from AdsPortOpenEx() maybe you didn't add a TwinCAT route earlier? If you use TcAdsDll directly, does AdsPortOpenEx() work in that case? |
I've added the route earlier and when using a MFC project TcAdsDll works fine. When i try to use WinUI 3 unluckly i get 0 as return value from AdsPortOpen() and AdsPortOpenEx() using directly TcAdsDll, that's why i tryied to use AdsLib library to connect to a plc running in local. (Following "Create a WinUI 3 desktop app for C++/Win32" in https://docs.microsoft.com/en-us/windows/apps/winui/winui3/get-started-winui3-for-desktop) Thank you! |
See #161 for some tweaks I've done to use this lib more easily with TwinCAT router on Windows build. |
Hi,
I've tryied to compile and use this library in a C++/WinRT project for using WinUI 3 API.
TcAdsDll does not work on this enviroment, giving me 0 when calling AdsPortOpen.
I've followed the example provided with this repo and i get it working when i run the app in my developing PC connected to a Beckhoff IPC running a PLC project. Here is the code:
When i try to run the app on the IPC itself i cannot make it working: i can create succesfully the AdsDevice "route" object (following the example) but i get Error 1861 at every call i make.
The changes for the code are on the lines
I also tryed to set the remoteIpV4 to localhost.
Every call i make to interact with route (like route.GetState()) raises an exception giving error 1861.
Is it possible to use this library in a PC running a PLC project? Am i setting something wrong?
Thank you,
Andres
The text was updated successfully, but these errors were encountered: