r/PLC • u/not-a-washingmachine • 9d ago
Engineering Question PyAds with html interface or Beckhoff HMI with html hosts?
I am currently working on a project which requires a lot of html, js and css elements like the canvas element for displaying robot positions and adjusting timelines. At the moment i am using the twincat hmi server with visual studio code to write what is basically a website with the lay-out: twincat .view with a .htmlhost and then the page written in there.
The only thing i am using the twincat hmi for is the live view (needed because of the framework) and the ads communication.
Are there any benefits to using the twincat hmi server with twincat plc or would a PyAds server with twincat plc work just as well? Are there any future support issues to take into account?
From what i'm seeing, PyAds would be just fine as we are not using any beckhoff HMI elements like buttons/graphs, but only the htmlhost to run the code. But i feel like i'm missing something in regards to benefits the twincat server would have over a PyAds server.
Can anybody tell me what other support i would be missing?
1
u/Bright-Outcome-7068 2d ago
You're not missing something huge, but the trade-off is really about who owns the plumbing. The HMI server is doing more than just showing your page — it's handling the live connection to the runtime, the symbol subscriptions, reconnection when the runtime restarts, and the user and session side of things, all as one supported package that moves with the rest of the system.
A Python ADS client can absolutely do the data part — reading and writing variables, and subscribing to changes — so for a mostly custom canvas page it can feel like the lighter option. What you'd be taking on yourself is the stuff around it: keeping the connection alive and reconnecting cleanly, handling type conversions and missed updates, and anything around security and who can reach the runtime from where. None of that's impossible, it's just code you'll own and debug at 2am when something's flaky, rather than something that ships with the platform.
For future support, that's the bit I'd weigh most. The HMI server is vendor-supported and moves with the platform, while the Python library is community-maintained, so if something breaks after an update you're relying on the community or your own fix. I'm not certain how that plays out for your exact setup, so I'd keep the interface between your page and the data layer thin — one small module that talks to the runtime — so you can swap the transport later without rewriting the page.
If it were me and the page was staying this custom, I'd lean toward the Python route, but only if you're happy owning that connection layer.
Are you planning to run this on the same machine as the runtime, or on a separate machine that has to reach it over the network?
1
u/HummingServoSir 8d ago edited 8d ago
Hi! I don't know about twincat, but depending on what you want to achieve and the project scope, maybe you can give this a try and do everything on python with fastapi or similar: https://github.com/odycat/odycat With it you can code the automation part (commanding the ethercat slaves) in python too (Disclosure: I'm the author of the project)