RSLinx OPC Read with VB.NET Extremely Slow

Archie

Member
Join Date
May 2002
Location
Orangeburg, SC
Posts
1,944
I was working on some bench mark tests for different drivers and once I got to RSLinx I am getting a really slow read time. It is taking over 2 seconds to read 100 DINT tags from a CompactLogix. Compare this to a range of 45-75ms for other drivers.

What I am wondering is whether I am not performing the read in the most efficient way. My objective is to synchronously read 100 DINT tags. (Actually 1000, but RSLinx does not seem to read more than 120)

Here is the way I am reading the values:

Open the connection on application start:
Code:
    Private OPCServ As Opc.Da.Server
    Private fact As New OpcCom.Factory

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        '********************************************
        '* Connect to the OPC Server
        '********************************************
        OPCServ = New Opc.Da.Server(fact, Nothing)
        OPCServ.Url = New Opc.URL("opcda://localhost/RSLinx OPC Server")
        OPCServ.Connect()
    End Sub

Perform the read on a button click:
Code:
    Private Sub ReadButton_Click(sender As Object, e As EventArgs) Handles ReadButton.Click
        '********************************************
        '* Create the item array to read
        '********************************************
        Dim items(0) As Opc.Da.Item
        items(0) = New Opc.Da.Item
        items(0).ItemName = "[IOTest]DINTArray,L100"

        '********************************************
        '* Start the stopwatch to time the duration
        '********************************************
        Dim sw As New Stopwatch
        sw.Start()

        '********************************************
        '* Synchronously Read the values
        '********************************************
        Dim values() As Opc.Da.ItemValue = OPCServ.Read(items)

        '********************************************
        '* Stop the timer
        '********************************************
        sw.Stop()

        '********************************************
        '* Report the result
        '********************************************
        If values(0).Quality = Opc.Da.Quality.Good Then
            MsgBox("Read time=" & sw.ElapsedMilliseconds & " ms")
        Else
            MsgBox("Read Failed")
        End If
    End Sub
 
I did figure out something with this. I created a subscription to another variable and that made the synchronous reads drop down to about 200ms. Apparently the first read goes through a lot of initialization. If there are no subscriptions that continuously read, that initialization is done every time a synchronous read is done.
 

Similar Topics

Hey Friends. I am currently trying to write approximately 700 tags from FtView13 to an Logix Emulate 5000. I am using rslinx DDE/OPC to create an...
Replies
0
Views
390
Hello All, I know it is possibile to access data from a PLC directly to excel using a OPC link through RSLinx...
Replies
2
Views
1,738
Hello All, I am going to try and lay out my situation as good as I can. Scenario: We have sites in different location across US that's running...
Replies
4
Views
2,940
Hey! In my previous queries on how to handle an OPC server like RSLinx in the ArchestrA IDE galaxy, I have succeeded and the answer was to just...
Replies
0
Views
1,799
Hey everyone!. I would like to know how to use a third-party data server other than Wonderware, such as RSLinx server to integrate it into the...
Replies
3
Views
1,576
Back
Top Bottom