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.

Slow Update To Listview (Large Amount Of Tags)

More
03 Sep 2019 17:36 #7698 by neilcooley
Hi

Sorry for the late reply. I have tried another SDK and reading the same amount of tags and it displays the results instantly where as OPCLabs takes around 15 seconds to update the listview, its instantaneous when I add around 200 tags but when I add anymore it takes considerable time. Please advise?

Will lambda expressions work better?


Neil

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

More
02 Sep 2019 13:05 #7693 by support
Your code looks precisely as it should be. Aside from possibly tweaking some parameters (not sure about what now), there is nothing to be changed.

What leads you to believe that the speed can be improved by changes on the client side? For example, do you have some other OPC client which gives significantly better response?

Best regards

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

More
30 Aug 2019 14:44 - 30 Aug 2019 15:44 #7687 by neilcooley
Hi
I am wondering if you could tell me how to improve my code so I can read over 1000 elements into a listview in real time.

The OP Server is Rockwell FactoryTalk Gateway.
Tag_Description = "Result " & i.ToString & " LVDT #1 TIR / 2"
Tag_Shortcut = "[L6]Results[1].Result"
Dim itemChild As New BetterListViewItem(New String() {Tag_Description, Tag_Shortcut, "0.0", "n/a", "n/a"})
ListView.Items(0).ChildItems.Add(itemChild)

I then repeat this in a for loop incrementing I, from 1 to 750.

I then use a subscribe method to add the tags to an OPC Group;

        IsSubscribed = True
 
        ' Prepare an array describing what we want to subscribe to and how
        Dim count As Integer = ListView.Items(0).ChildItems.Count
 
        'Dim count As Integer = SetupParameters.Count
        Dim Row_i As Integer = 0
 
        Dim argumentsArray(count - 1) As DAItemGroupArguments
        Row_i = 0
 
        For i As Integer = 0 To count - 1
 
            Dim listViewItem As BetterListViewItem = ListView.Items(0).ChildItems(i)  
 
            If listViewItem.Visible = True Then
                Dim itemId As String = listViewItem.SubItems(1).Text 'Text
                argumentsArray(Row_i) = New DAItemGroupArguments("FactoryTalk Gateway", itemId, 50, listViewItem)  
 
                Row_i += 1
            End If
 
 
            'Next
        Next
 
        ReDim Preserve argumentsArray(Row_i - 1) 'As DAItemGroupArguments
 
        ' Execute the Subscribe operation
        EasyDAClient.SubscribeMultipleItems(argumentsArray)

I then have a callback and update list view function;
Public Sub EasyDAClient_ItemChanged(sender As Object, e As EasyDAItemChangedEventArgs) Handles EasyDAClient.ItemChanged
 
        BeginInvoke(Sub()
 
                        ListView.BeginUpdate()
 
 
                        Dim listViewItem As BetterListViewItem = CType(e.arguments.State, BetterListViewItem)
                        UpdateListViewItem(listViewItem, e.Exception, e.Vtq)
 
                        ListView.EndUpdate()
 
 
                    End Sub)
 
    End Sub
 
    ' Updates ListViewItem (from reading or change notification) with exception and value/timestamp/quality
    Private Shared Sub UpdateListViewItem(ByVal listViewItem As BetterListViewItem, ByVal exception As Exception, ByVal vtq As DAVtq)
        Dim vtqText As String = ""
        Dim exceptionText As String = ""
 
        If (exception Is Nothing) Then
            If vtq.Value Is Nothing Then
                listViewItem.SubItems(2).Text = "0"
                listViewItem.SubItems(3).Text = "No Data"
                listViewItem.SubItems(4).Text = Now()
 
            Else
                listViewItem.SubItems(2).Text = vtq.Value.ToString  ' vtqText
                listViewItem.SubItems(3).Text = Get_Quality_String(vtq.Quality.InternalValue) 
                listViewItem.SubItems(4).Text = vtq.Timestamp.ToString("dd/MM/yy HH:mm:ss.fff")
                'vtqText = vtq.ToString()
            End If
 
        Else
            listViewItem.SubItems(3).Text = exception.Message
        End If
 
    End Sub
 

The values are displayed but not in real time, there is a lag of approximately 10seconds, then it displays, then there’s another lag then it displays.

What am I doing wrong or is there a better way of achieving this with later release? If I reduce the number of tags then it works perfectly.


If you wish I can send the Visual Studio project file if its easier (VB.net).



Neil
Last edit: 30 Aug 2019 15:44 by support. Reason: added formatting

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

Moderators: support
Time to create page: 0.060 seconds