I was able to read a single variable.
Now I want to go one step further and I extended my code with lines to periodically read multiple (=4) variables.
See below.
To application will not run it comes with a error-message at the line indicated.
What is missing?
THe application also eats most of the CPU-power if I run it in debug moden onder VS2013.
Imports OpcLabs.EasyOpc.DataAccess
Imports OpcLabs.EasyOpc.DataAccess.Generic
Imports OpcLabs.EasyOpc.DataAccess.OperationModel
Imports System.Threading
Public Class Form1
Public TotalItems As Integer
Public NumberOfGroups As Integer
Public ItemsInGroup As Integer
Public itemDescriptors() As DAItemDescriptor
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim OPCTags(0 To 4) As String
Dim Index As Integer
OPCTags(0) = "Simulation.Random"
OPCTags(1) = "Trends.Ramp (1 min)"
OPCTags(2) = "Trends.Sine (1 min)"
OPCTags(3) = "Simulation.Register_I4"
OPCTags(4) = "Dummy"
NumberOfGroups = 1
ItemsInGroup = 4
Index = 0
' Create an array of item descriptors for all items
TotalItems = NumberOfGroups * ItemsInGroup
Dim itemDescriptors = New DAItemDescriptor(TotalItems - 1) {}
For iLoop As Integer = 0 To NumberOfGroups - 1
For iItem As Integer = 0 To ItemsInGroup - 1
itemDescriptors(Index) = New DAItemDescriptor(String.Format(OPCTags(iItem), iLoop + 1, iItem + 1))
Index = Index + 1
Next iItem
Next iLoop
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim successCount As Integer = 0
TextBox1.Text = EasyDAClient1.ReadItemValue("", "OPCLabs.KitServer.2", "Trends.Ramp (1 min)")
' Perform the OPC read
'' THE NEXT LINE GENETRATES the ERROR ''
Dim vtqResults() As DAVtqResult = EasyDAClient1.ReadMultipleItems("OPCLabs.KitServer.2", itemDescriptors)
' Count successful results (totalling to previous value)
For iItem As Integer = 0 To ItemsInGroup - 1
Debug.Assert(vtqResults(iItem) IsNot Nothing)
If vtqResults(iItem).Succeeded Then
successCount = successCount + 1
End If
Next iItem
End Sub
End Class