I am using the EasyDAClient to subscribe to multiple items as shown below. When the program is first launched, the EventHandler for easyDAFullProductionClient_ItemChanged is raised for each of the DAItemGroupArguments, which in this particular case, is five (5) times. This occurs even though there has been no change in status of the OPC tags on the OPC server. Is this by design and is there anything that I can do to prevent it from happening?
private void Window_ContentRendered(object sender, EventArgs e)
{
checkForChanges();
}
private void checkForChanges()
{
// Create the OPC Client object
EasyDAClient easyDAFullProductionClient = new EasyDAClient();
// Assign the callback event to the OPC Client object
easyDAFullProductionClient.ItemChanged += new EventHandler<EasyDAItemChangedEventArgs>(this.easyDAFullProductionClient_ItemChanged);
// Create the objects for the subscriptions
DAItemGroupArguments[] opcFullProductionGroup = new DAItemGroupArguments[5];
// All Aspirator PEs - True if quality is good and any position is going to the aspirator
opcFullProductionGroup[0] = new DAItemGroupArguments("04PRDP1S", "OPCServer.WinCC.1", "L1_OVERVIEW/L1_POSITIONS/PUMP_RUN_IND/ASP_NOT_IN_CAN.Out#Value", 10000, null);
// All Spin Pumps Running - True if quality is good and all pumps are running
opcFullProductionGroup[1] = new DAItemGroupArguments("04PRDP1S", "OPCServer.WinCC.1", "L1_OVERVIEW/L1_OVERVIEW/L1_POSITIONS/PUMP_RUN_IND/PUMPS_RUNNING.Out#Value", 10000, null);
// All Extruders Running - True if all extruders are running
opcFullProductionGroup[2] = new DAItemGroupArguments("04PRDP1S", "OPCServer.WinCC.1", "L1_OVERVIEW/L1_EXTRUDERS/EXTRUDERS_RUN/EXTRUDERS_RUNING.Out#Value", 10000, null);
// All Guide Godets are Running
opcFullProductionGroup[3] = new DAItemGroupArguments("04PRDP1S", "OPCServer.WinCC.1", "L1_OVERVIEW/L1_GUIDE_GODETS/GG_LIGHTS/MON.Out#Value", 10000, null);
// Tow Sensor - True if tow is present
opcFullProductionGroup[4] = new DAItemGroupArguments("04PRDP1S", "OPCServer.WinCC.1", "L1_OVERVIEW/L1_SUNFLOWER/TowSensor/MON.Out#Value", 10000, null);
// Subscribe to the items
easyDAFullProductionClient.SubscribeMultipleItems(opcFullProductionGroup);
}
private void easyDAFullProductionClient_ItemChanged(object sender, EasyDAItemChangedEventArgs e)
{
// Show a UI here
}