Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

SubscribeMultipleItems EventHandler is raised upon subscription

More
09 Oct 2013 18:47 #1466 by support
Yes, this is by design. It is also in sync with how OPC specs actually require servers to behave (to send a first update after an OPC item has been added to an OPC group, and similar cases).

Can you please explain a little more about the use case where this behavior is not desired?

Please Log in or Create an account to join the conversation.

More
09 Oct 2013 18:41 #1464 by Flintstone
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
}

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.048 seconds