![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() 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 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 |
![]() |
![]() |
#2 |
Member
![]() ![]() 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 |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
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 |