I came across a race condition working on one of my project.
I have a memory say Quantity.
And I have two opc tags Amount1 and Amount2 subtract the value from Quantity and write the result back to Quantity.
Amount1 and Amount2 race for reading the current value of Quantity and I end up getting unexpected values.
A simple way to avoid this I thought, was to create a expression tag that sums up Amount1 and Amount2 and then subtract the sum from Quantity.
However, expression tags do not evaluate if the either of Amount1 or Amount2 doesn’t change.
I have instances where the new value for both Amount1 and Amount2 is the same as previous and want to accommodate for such scenarios.
Any advise on how to resolve this?