You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old September 16th, 2015, 12:18 PM   #1
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,944
RSLinx OPC Read with VB.NET Extremely Slow

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
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old September 20th, 2015, 10:22 PM   #2
Archie
Member
United States

Archie is offline
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,944
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.
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
RSLinx OPC Topic Runs only on Secondary Server??? lunenburger LIVE PLC Questions And Answers 4 June 2nd, 2015 03:03 PM
Question about RSLinx OPC servers TConnolly LIVE PLC Questions And Answers 2 October 6th, 2010 02:40 AM
RSLinx Remote OPC with VB paragmangale LIVE PLC Questions And Answers 0 October 23rd, 2009 08:16 AM
MP 277 communication with RSLinx OPC Server arun_mallah LIVE PLC Questions And Answers 3 June 25th, 2009 06:32 AM
RSLinx problem registering definitions from PIUNSOL.INI Koos LIVE PLC Questions And Answers 0 January 14th, 2008 12:23 AM


All times are GMT -4. The time now is 08:38 AM.


.