fisothemes / LabVIEW-TwinCAT-ADS

Easy to use unofficial LabVIEW TwinCAT ADS API for communicating with Beckhoff PLCs via ADS. Features include Invoking Rpc Methods, Reading/Writing of PLC variables (including all Standard, Time, Strings, WStrings, Structs composed of the aforementioned, Nested STRUCTs and Multi-dimensional Arrays of the aforementioned datatypes) and more!
MIT License
12 stars 1 forks source link

Improper reading/writing/Invoking of REFERENCE TO types. #3

Closed fisothemes closed 7 months ago

fisothemes commented 1 year ago

Reading symbols of type REFERENCE TO STRING and REFERENCE TO WSTRING fails unit test.

fisothemes commented 1 year ago

After investigating the issue I found I wasn't sizing the buffer correctly for reference types. This means the issue doesn't just extend to references to string types, it's for all reference types. I was just lucky with numeric types as they're the same size or smaller than the pointer storing the reference so their contents fixt in the buffer.

Will apply the fix for all read/write and invoke VIs, write some unit tests and then create a pre-release.

fisothemes commented 7 months ago

Fixed on 1.2.5.13