Hi everyone, I'm Levent (LeventSA on GitHub) from NetYazilim in Turkey. I've been writing software for over thirty years, and the part I enjoy most has always been getting a computer to talk to a piece of hardware and making something useful out of it. I'm building a data collection system for a factory, reading its Beckhoff controllers with plc4go.
What drew me to PLC4X is how much it covers from one design: more than a dozen protocols behind a single API, five language bindings, one .mspec per protocol to generate them from. We read Siemens and Modbus in the same plant, so that one API is why I chose plc4go - and the model generated from ads.mspec parsed the TwinCAT 2 tables unchanged, so nothing below touches the spec. The ADS driver assumes TwinCAT 3 and cannot connect to a TwinCAT 2 device at all. That is #1424, open since February 2024, and the three symptoms reported there are all accounted for in what I have: INT16 where the driver expects INT, symbol names that only match in upper case, and a nil pointer panic. I have it working against three TwinCAT 2.11 controllers, from a CX9020 with 38 symbols to a plant PC with over 170,000 readable tags, and would like to contribute that back. Introducing it here first, as the contributing guide asks. It is not one change but three, so I would send three small PRs against develop, smallest first, each with its own measurements: - a browse query with no dot in it panics the driver (a one character fix) - a reply larger than the peek buffer is classified as a fatal transport error, which kills the connection on any device with a large symbol table - TwinCAT 2 support itself, in plc4go/internal/ads only, with no .mspec change and no regenerated code There is a fourth change behind the tag count above: a browse of "*" lists the symbols a device reports and "**" expands them into readable tags. That one is a feature rather than a fix, so I'd rather offer it separately once the three above are settled. Unless someone objects, I'll open the first one later this week and let it be reviewed before sending the next. I can follow these through, and the controllers are in a running plant I have access to. #1424 says TwinCAT 2 has gone uncovered mostly for lack of such a device, so if anything else in the ADS driver needs checking against real TwinCAT 2 hardware, I'm happy to run it. One note on process, as the contributing guide requires. English is not my first language and I learned it mostly from reading technical documentation, so I used Claude as an assistant here, for the language and for parts of the work, as I will also disclose in each PR. The design decisions, the measurements on real hardware and the validation against a reference tool are mine, and I have reviewed every line I am proposing. Plain, direct review comments are welcome. Indirect phrasing is harder for me to read correctly, so please just say what needs to change. Thanks, Levent
