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.
OPC UA .NET C# - pass callback when subscribing multiple items
Either upgrade QuickOPC, or use the approach from the code I provided to achieve the same.
Best regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Which QuickOPC version are you using?
Regards
Please Log in or Create an account to join the conversation.
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.OperationModel;
"Error CS1061 'EasyUAClient' does not contain a definition for 'SubscribeMultipleDataChanges' and no accessible extension method 'SubscribeMultipleDataChanges' accepting a first argument of type 'EasyUAClient' could be found (are you missing a using directive or an assembly reference?)
Please Log in or Create an account to join the conversation.
you are probably looking for the SubscribeMultipleDataChanges extension method: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...scribeMultipleDataChanges.html .
The other way to do this is to use the DataChangeCallback property ( opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...uments~DataChangeCallback.html ) in each of the the EasyUAMonitoredArguments passed to the SubscribeMultipleMonitoredItems method.
This is what, internally, the SubscribeMultipleDataChanges does anyway. Its implementation (the code is simplified) looks like this:
static public int[] SubscribeMultipleDataChanges(
this IEasyUAClient client,
UAMonitoredItemArguments[] monitoredItemArgumentsArray,
EasyUADataChangeNotificationEventHandler dataChangeCallback)
{
return client.SubscribeMultipleMonitoredItems(monitoredItemArgumentsArray
.Select(arguments => new EasyUAMonitoredItemArguments(dataChangeCallback, arguments)).ToArray());
}
Best regards/S pozdravem
Please Log in or Create an account to join the conversation.
OPC DA Example:
easyDAClient1.SubscribeMultipleItems(items.ToArray(), (_, e) => {
if (e.Vtq != null && e.Vtq.HasValue)
{
String tag = e.Arguments.ItemDescriptor.ItemId.ToString();
object value = e.Vtq.Value;
itemChanged(tag, value);
}
});
OPC UA Example:
easyUAClient1.SubscribeMultipleMonitoredItems(items.ToArray());
Please Log in or Create an account to join the conversation.