Skip to content

Pyads integration with modifications by Patrick#288

Open
stlehmann wants to merge 6 commits intoBeckhoff:masterfrom
stlehmann:pyads-integration-from-patrick
Open

Pyads integration with modifications by Patrick#288
stlehmann wants to merge 6 commits intoBeckhoff:masterfrom
stlehmann:pyads-integration-from-patrick

Conversation

@stlehmann
Copy link
Copy Markdown

This is a modified version of #285 that was proposed by @pbruenn to resolve #284. It replaces #285.

pbruenn and others added 6 commits April 2, 2026 08:32
We’re seeing increasing demand for a shared library version of the
standalone AdsLib. Here we go and mark the external C functions, so we
can build a shared library in the next step.

Suggested-by: Stefan Lehmann <stlm@posteo.de>
Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>
More and more users want a shared library of the standalone version.
Here we go and finally add it to our build.

Suggested-by: Stefan Lehmann <stlm@posteo.de>
Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>
In my opinion, the "struct AdsNotificationHeader" in the TwinCAT SDK is
broken. It relies on "#pragma pack" and forces unaligned access on
64-bit machines.
A long time ago, I decided to fix it by reordering the structure,
which is only used on the client side and is not sent "over the wire".

However, projects like pyADS[1], which want to dynamically choose
whether to use the standalone AdsLib or the TwinCAT router, needed to
patch this.

Let's give them a compile-time option to do so, and use it ourselves
when we build a shared library, which is most likely used "in parallel"
with the TwinCAT variant.

[1] https://github.com/stlehmann/pyads

Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>
@pbruenn
Copy link
Copy Markdown
Member

pbruenn commented Apr 24, 2026

Thats good news. I took your version and just moved the wrapper from standalone to the generic code, because compiled with TcAdsDll we actually have these functions, too. I wonder if we even need them in the dynamically linked version. However, thats seems the clean approach. So could you double check https://github.com/Beckhoff/ADS/tree/patrickbr/for-stlehmann-pyads-integration again and if its working I will merge it and publish a new version which includes some other minor fixes aswell. 6ddad87

EDIT: just wanted to mention @stlehmann to force a notification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patches to integrate adslib directly into pyads

2 participants