libplctag / libplctag.NET

A .NET wrapper for libplctag.
https://libplctag.github.io/
Mozilla Public License 2.0
194 stars 50 forks source link

Array tag notification on change #367

Closed Primabase closed 2 months ago

Primabase commented 3 months ago

Hi,

it's possible to be notified when an array tag will change? I've tried to modify the example ExampleNotifyChanged.cs adding then property ArrayDimensions.

Thanks.

timyhac commented 3 months ago

The library doesn't do anything to provide value change detection - you'll need to write some code to somehow compare previous values to current values.

The most generic way would be to read the buffer into a byte array, run a hashing function, and then store and compare the hash, but of course there are issues with this - hash collisions being one of them.