Hi,
I'm using MII 14.0 and Pco 2.3 to work on a B&R PLC.
I use MII to collect production data from a PLC using a PCo OPC-UA agent, and to save it to a DB.
PLC and MII share a boolean flag tag "NewDataAvailable" to cooperate on data exchange.
When the PLC has new data, it publishes it to a MII-visible area and sets the "NewDataAvailable" flag to 1.
Then, MII reads data from PLC, makes some logic on it, saves it to a DB, and re-sets the "NewDataAvailable" flag to 0.
I have developed a version of the project on Query Mode, i.e., MII periodically (every 1 second) asks the PLC if any new data is available, and, if the answer is positive (flag to 1), it collects data, etc. It works fine, but I don't like such a static approach.
I have tried to develop a version of the project using Notification Process. At PCo level, I have defined an agent notification with a trigger on flag "NewDataAvailable" ==1 expression, onTrue mode. The trigger destination is my MII transaction collecting data, saving it and setting flag back to 0 as last step.
If PLC has lot of data on a queue, it can reset flag to 1 in few ms.
I like this approach because it is dynamic: PLC acts as a master triggering MII operation only when required.
Here is my problem.
For some reason, when I activate the agent with the notification, the trigger works fine only for 2-3 times, and then it stops.
The flag is set too 1, but the trigger does not react.
I have a feeling that if the flag is re-setted to 1 by the PLC while the MII transaction has not been completely released yet , the trigger misses the true/false/true transition, and so it does not react any longer.
Is there anybody with a specific experience on this subject?
What is the best approach to manage dynamically data exchange between a PLC and MII?
I'm rather new on MII so I wonder if I'm missing some basic piece of information.
Thanks in advance for any kind suggestion.
Mauro