Releases: libplctag/libplctag
v2.6.6 - fixes for ARM builds and reconnecting after PLC outage
Many thanks, again, to @wegel for finding a problem with reconnection and providing a fix and test! Contents of this release:
- fixes for ARM 64-bit builds as reported by user @chanhowcheng.
- fixes for reconnecting to a PLC after an outage as reported by @wegel and @mikecflood. @wegel proposed a nice PR with some fixes and a good test program. I ended up solving this in a different way to also include fixing non-auto sync tags and expanded the test program. Thanks!
- Fix base glibc version on Debian/Ubuntu systems. User "2gd4who" found this. I backleveled the build systems to use Ubuntu 22.04 instead of 24.04 and the glibc version problem seems to be fixed. Debian does not have the latest glibc version yet.
Thanks for using libplctag!
v2.6.5 - MinGW as a tier-1 compiler, fixes for 2.6.4
This big change in this release is for MinGW. It is now a tier-1 supported compiler. The CI system tests builds with MinGW the same as with MSVC on Windows. On x86 and x64, the CI uses MinGW to build libplctag, all the examples and runs all tests that can be run using the ab_server simulator.
There are some fixes for 2.6.4:
- From user wegel, changes in how the refactored CMake configs reference directories. This helps with using libplctag in another Git project.
- Re-enable the install clauses in the config. This broke packaging for the brew package management system. Thanks to user daeho-ro for finding that!
The examples are now fully statically linked on Linux. Apple has decided to make it very difficult to make a fully static executable on macOS, so the examples there are linked with libplctag statically.
32-bit ARM Windows binaries are still broken. I have spent days trying to figure out how to make it work. It now looks like I might need to lean on LLVM/Clang instead of MinGW or MSVC. It is still possible to build your own binaries if you have such a system. I am able to build them with no problem on my own Windows machine. But the configuration of the GitHub CI runners seems to be different and for some reason I am not able to fully install all the needed components to get MSVC to generate 32-bit ARM binaries.
Note that the names of the binary packages below will start changing to incorporate the compiler when there are multiple compilers used for a platform. I have not made the binaries created by MinGW into tagged binaries attached to a release as there are already equivalent binaries from MSVC.
v2.6.4 - finally! see notes for fixes
This release has a lot in it. First many thanks to the contributors who did all the hard work: Heath, wegel, Dominik and ptsOSL! I think I caught all of you. If I missed someone, please tell me!
This contains:
- Smarter handling for OMRON. Better support for multi-request packets. To really finish this we will need to add some level of tag metadata retrieval to the OMRON code.
- ab_server changes (mostly thanks to contributors listed above!):
- Multithreading!
- Index handling now mirrors what real Rockwell PLCs do.
- Fixes for double free and use after free issues.
- More sanity checks for packets. Incoming packets are more carefully checked.
- A fix for 497 that was found by user EchoHowardLam-GTS. This started a lot of refactoring and rethinking.
- A huge refactor of how CMake config is set up. Most of it is broken out into individual files and is much, much easier to understand. But it is not all finished.
- The example binaries are now linked statically to libplctag to make those executables easier to run. I am aiming for fully static linking eventually but getting this release out had priority.
- Reorganization of the source tree into more meaningful subdirectories. This and the CMake refactoring go together. This is part of a longer process to refactor out common elements and reduce code duplication.
- Many compiler warnings fixed. At least with Clang and GCC warnings. MSVC is fairly happy now too. There are still some warnings. Over the next couple of releases I aim to have zero compiler warnings.
- The base release configuration has changed to MinSizeRel in CMake. This is a build configuration that optimizes for binary size (smaller). Very few, if any, parts of libplctag are CPU bound. Having small code is better for users that are working with smaller devices and lower memory requirements.
Known issues:
- MinGW is not working. This will be coming in another drop. Hopefully 2.6.5.
- Changes on the GitHub CI runners have made it much, much harder to build binaries for 32-bit ARM Windows. I have spent too many days delaying the release trying to track this down. So ARM 32-bit builds for Windows are removed for now. File an issue if you really need 32-bit ARM Windows binaries.
- The Zip files are much larger because the examples are mostly statically linked.
- The contributed CLI tool is currently not being built. That will come as soon as I get MinGW working. It has suffered some bit-rot and needs to be updated to avoid a lot of compiler warnings and potentially unsafe code.
- The Windows x86 32-bit build was accidentally set to 64-bit. It will be replaced with release 2.6.5.
Going forward there will be more refactoring. There are many areas where code can be combined and/or simplified. I will continue to simplify the CMake use so that it can be much more generic and use the defaults most of the time. The end goal is to make feature additions and bug fixes take much less time.
v2.6.4-r2 - Fixes for OMRON, ab_server and more sanity checks
This release has a lot in it. First many thanks to the contributors who did all the hard work: Heath, wegel, Dominik and ptsOSL! I think I caught all of you. If I missed someone, please tell me!
This contains:
- Smarter handling for OMRON. Better support for multi-request packets. To really finish this we will need to add some level of tag metadata retrieval to the OMRON code.
- ab_server changes:
- Multithreading!
- Handle multiple indexes (as well as just one) correctly! At least I think so...
- Fixes for double free and use after free issues.
- More sanity checks for packets. There are probably more coming in the future, but this is a very good start.
- (Updated) A fix for #497 that was found by user EchoHowardLam-GTS. Hopefully it is fixed...
This is not a full release yet! Please download it and use it for testing but do not put it into production at this time! If you find any problems, please let me know immediate via a GitHub issue!
v2.6.3 Merge in more Omron updates from user ptsOSL, other fixes
Trying something new here where I try to do better commit messages in Git and then use git log to generate most of the release message...
Merge into release (#491)
* Make file number optional if input or output file. Fix #481. Support I:1 and O:2 etc.
* Added support for a numeric subelement. Fix #479. (#483). Should allow sub-elements so that you can get to the IO files and their individual data.
* Fix #486. (#487). String size changes (larger) failed on Omron because it does not reserve the maximum string size in the data it sends to the library. Now when you call plc_tag_set_string() it will try to resize the tag buffer. Fixed with #488.
* Added atomic flag and checks to aid in making all sessions terminate when the library is shutting down. Fix #450.
* plc_tag_set_string() feature additions (#488). Setting string can change tag data buffer size. And added flag, allow_field_resize, to suppress change. Needed because the change for adjusting the buffer size could break code that is not aware of it.
* Added msp response size check before adding new requests to msp with allow_packing=1 and fragmented reads disabled (#489). This should allow more requests to be bundled together for Omron PLCs. This is a work in progress and Phil has done a lot of work here.
---------
Co-authored-by: Phil Smith
v2.6.2
This release is mostly little fixes, particularly for PLC/5, SLC and MicroLogix.
What's Changed
- Added more guard checks to the internals of the library.
- Added deprecation warning to tag_rw. It will be going away as all new work and features are in tag_rw2.
- Added support for raw tags. The tag_rw2 tool supports raw tags now. This makes it much, much easier to do exploration of new PLCs and to find out what data comes back on certain CIP calls.
- Fix up how printable characters are identified. ASCII is smarter than I thought. This is in tag_rw2 when dumping out results as single bytes.
- Make file number optional if input or output file on PLC/5, SLC and MicroLogix. Fix #481.
- Added support for a numeric subelement. Fix #479. This should allow you to access the I and O files beyond the first element.
Full Changelog: v2.6.1...v2.6.2
The raw tags in tag_rw2 are going to really help in our quest to support Omron PLCs better. Here's an example of what you can do:
tag_rw2 --type=raw "--tag=protocol=ab-eip&gateway=10.206.1.40&path=1,0&plc=ControlLogix&name=@raw" --write=0x55,0x03,0x20,0x6b,0x25,0x00,0x00,0x00,0x01,0x00,0x01,0x00
This sends the CIP service 0x55 to the 0x6b class. It asks for attribute 1 for all instances of that class. This is part of pulling back information when listing tags. The binary values in the write argument are sent as is to the PLC. The size of the tag is automatically adjusted to fit the request and the returned response.
There are two changes from the usual use of tag_rw2 here. The first is that the type is "raw" rather than uint8 or sint32 etc. This type tells the tool that it needs to not interpret any of the request or response but instead to just pass it through to the PLC. The second is that the tag name is that of a raw tag.
You can get this release in the releases page.
v2.6.1 - Changes for future Omron work
This release has the Omron code split from the Rockwell code. Right now it is just a simple copy so you may notice that the library size has increased due to the duplicate code. Over time, this will be refactored and the code size will come back down. Over time it became clear that Omron PLCs need to be treated separately from Rockwell PLCs. There are too many small (and large) differences.
This release contains contributions by a record number of people. Thanks to all who provided PRs, testing and information! Specifically:
Thanks to @MountainKing91, @timyhac, @jshan0120 and @ptsOSL for working on Omron. There is still a lot to do, but progress is being made on tag listing and making sure that reads and writes of all the atomic types work on Omron PLCs. The work on tag listing is being done by @timyhac and @MountainKing91 over in the libplctag.NET repository. More people with time to test would be welcome!
@jshan0120 contributed additions to the ab_server simulator to add support for BOOL tags. BOOL arrays are not handled correctly yet and they are yet another area where Rockwell and Omron differ significantly. More additions to the simulator are coming in a future release from @jshan0120 as there is already a PR queued up!
@ptsOSL and @jshan0120 noted that both Omron and the simulator are not happy when tags with single byte element sizes are written. The old behavior of the library was to pad all writes to a multiple of two bytes in length. @ptsOSL contributed code to configure the padding amount as part of work towards supporting fragmented reads and writes with Omron. Note that Rockwell PLCs (Logix-class) seem to ignore an extra byte of padding (but not two or three!).
The default now is to not pad at all. This passes all my tests with my ControlLogix PLCs. Please make sure that you check your own before you roll this release into production!
v2.6.0 - many fixes and new API for tag type information
This release has a number of contributions from library users. Thanks!
- Fix for #401. Calling plc_tag_shutdown() did not clean up all the resources.
- Fix for #404. Create events were sometimes dropped when using async tag handle creation.
- Fix for #424. Having the sanitizers always included in the debug builds was a problem for some users. I also ran into this with the latest version of valgrind on Apple Silicon. Thanks to user Thomas V. for contributing this!
- Fix for #463. ControlNet has a slightly smaller maximum packet size than Compact/ControlLogix PLCs directly accessed via Ethernet. This fix changes the default size from 508 bytes to 504 bytes.
- Fix #252. A new API function,
plc_tag_get_byte_array_attribute()
, and a supporting attribute that allows an application to get the raw type bytes that the PLC sends back when a tag is read. For atomic types like DINT, this gives you an exact type. For things like UDTs, it is not exactly a type ID. A hashed handle is returned but it is not guaranteed to be unique. This has been requested for years. See issue 252. This also starts a new way of naming attributes that have multiple parts. The bytes of the raw type can be found using the attributeraw_tag_type_bytes
. The type buffer length can be retrieved using the attributeraw_tag_type_bytes.length
. There is a test program, test_tag_type_attribute.c, showing the use of this. Note that due to the new API call, this will be version 2.6.0. - a new test program,
test_tag_type_attribute.c
, has been added to the examples to show use of the new attribute and the kinds of error handling you can expect. - Updates to the tool tag_rw2. It now has the type
metadata
to print out the raw tag type information and a few other things like the number of elements and the element size. As time goes on, I will expand this. If I can ever figure out how to get the PLC tag definition information for one tag at a time, I will probably create some sort of metadata tag.
Omron support is still not at the level of Rockwell, but this release takes the library a few steps closer to that goal. User @ptsOSL is working on more changes to make use of multi-request packets easier with Omron. Omron does not support packet fragmentation the way that Rockwell does. It has its own special way to do things.
v2.5.6 - Fixes for #401, #404, #424 and #463
At long last I am starting to catch up a bit.
This release has a number of contributions from library users. Thanks!
- Fix for #401. Calling plc_tag_shutdown() did not clean up all the resources.
- Fix for #404. Create events were sometimes dropped when using async tag handle creation.
- Fix for #424. Having the sanitizers always included in the debug builds was a problem for some users. I also ran into this with the latest version of valgrind on Apple Silicon. Thanks to user Thomas V. for contributing this!
- Hopefully a fix for #463. ControlNet has a slightly smaller maximum packet size than Compact/ControlLogix PLCs directly accessed via Ethernet. This fix changes the default size from 508 bytes to 504 bytes.
There are a number of other things that are in this release that do not have much to do with the library but are related to problems with the GitHub CI infrastructure. Those seem to be fixed now.
Another library user has been working away at making Omron behavior much better. I think this is getting very close and I will probably have a test release out sometime in the next few days. All my tests pass so it does not seem to break any existing functionality.
v2.5.5 fixes Modbus teardown and missing events with async tag creation
Thanks to user @nc-koko for surfacing these problems.
- Events were being missed on tag creation when using asynchronous mode. Specifically the created event was missing.
- Shutdown was not fully cleaning up internal library Modbus resources in some circumstances under Windows.
- Thanks to @timyhac for experimenting on the shutdown problem. I think we might still have some work to do there with the combination of the core library, Windows and .Net, but it is a lot better.
Please double check that you are getting all the events you think you should get after upgrading. And, please let me know if you see duplicate events! I did not see any in my testing, but absence of evidence is not evidence of absence.