ix-ax / axsharp

[This repository is for active development.] AX# binds SIMATIC AX based projects with .NET ecosystem.
https://ix-ax.github.io/axsharp/
MIT License
48 stars 11 forks source link

[BUG] ITwinObject.PlainToOnlineAsync() adds object properties to cyclic R/W #262

Closed kuh0005 closed 8 months ago

kuh0005 commented 9 months ago

Describe the bug

When calling the PlainToOnlineAsync() method, values are set over the nested primitive values into the Cyclic variable. Subsequently, the entire object is written to the controller using await this.WriteAsync(). In the implementation of the Cyclic method, periodicWriteSet() is also added, which causes that after the first upload to the controller, the write is duplicated by a periodic write as well.

 public virtual T Cyclic
 { ...
     set
     {
         if (HasWriteAccess())
         {
             CyclicToWrite = value;
             _cyclic = value;
             base.Parent.GetConnector()?.AddToPeriodicWriteSet(this);
         }
     }
 }
PTKu commented 9 months ago

already addressed in #261 @kuh0005 AXOpen (on https://github.com/ix-ax/AXOpen/pull/257) should be updated, test it and let me know.