Hi Mauro,
What is most likely happening is the NewDataAvailable tag is getting set to 0 by MII, then set to 1 by the PLC, and all of this occurs within the Update Rate you have specified for the OPC UA Agent. Here is an example:
Update rate set to 1 sec
- At second x PCo sees tag ==1, previous value was 0
- PCo notification fires and executes MII transaction
- At sec x+1, no tag change
- MII sets tag=0
- PLC sets tag=1
- At sec x+2 NO TAG CHANGE as tag transition from 1 to 0 to 1 occurred within the 1 second update interval.
Effectively you are defining a sampling interval. By theorem, if you want to capture all change values your sample rate should be 2x the change rate of the value.
You can change the Agent Update Rate to a smaller interval, but there is a practical lower limit of this rate, determined by how quickly the OPC Server can read the tag, and to a lesser extend by the Network latency and throughput. If your requested Update rate is faster than the OPC Server can read the tag, it will read the tag at a rate determined by the OPC Server which will be SLOWER than the Agent Update Rate. So if you set Update rate to 20 mSec, and 50mSec is the read rate limit determined by the OPC Server, tag updates to PCo will only occur at 50mSec intervals or more.
Simplest fix may be to put a timer in the PLC that delays setting NewDataAvailable to 1 after seeing it set to 0, to allow time for the OPC server to see the tag change and notify PCo.
Regards, Steve