private void _SubscribeMultipleItems(IList opcSubscriptions) { // Set up the subscription arguments for the tags. DAItemGroupArguments[] itemGroupArguments = new DAItemGroupArguments[opcSubscriptions.Count()]; int index = 0; foreach (OPCSubscription opcSubscription in opcSubscriptions) { if (!this.eLynxServerFramework.Running) { break; } // override configuration for OpcAnalyzer this.Server = ""; opcSubscription.ServerClass = "OpcTestLab.OpcAnalyzer.1"; if (opcSubscription.PercentDeadband.HasValue) { itemGroupArguments[index++] = new DAItemGroupArguments(this.Server ?? "", opcSubscription.ServerClass, opcSubscription.ItemID, opcSubscription.DataType, opcSubscription.RequestedUpdateRateMilliseconds, opcSubscription.PercentDeadband.Value, null); } else if (opcSubscription.DataType != null) { itemGroupArguments[index++] = new DAItemGroupArguments(this.Server ?? "", opcSubscription.ServerClass, opcSubscription.ItemID, opcSubscription.DataType, opcSubscription.RequestedUpdateRateMilliseconds, null); } else { itemGroupArguments[index++] = new DAItemGroupArguments(this.Server ?? "", opcSubscription.ServerClass, opcSubscription.ItemID, opcSubscription.RequestedUpdateRateMilliseconds, null); } } // Get the list of handles that were subscribed to when subscribing to the items. The handles are in the same order that the // subscriptions were added above. //OpcLabs.EasyOpc.HandleResult[] subscriptionHandles = this.EasyDA.SubscribeMultipleItems(itemGroupArguments); try { int[] subscriptionHandles = this.EasyDA.SubscribeMultipleItems(itemGroupArguments); // Now set the subscription handles in the OPCSubscription objects so we can un-subscribe later if needed. index = 0; foreach (OPCSubscription opcSubscription in opcSubscriptions) { // Save the subscription handle. //opcSubscription.SubscriptionHandle = subscriptionHandles[index++].Handle; opcSubscription.SubscriptionHandle = subscriptionHandles[index++]; opcSubscription.Subscribed = true; //this.eLynxServerFramework.LogInformation(string.Format("Subscribing to {0}", opcSubscription.ToString())); } } catch (Exception subException) { int xxxxx = 1; //throw subException; } }