LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Addressing OPC with Datasocket - Performance Issues

Hi,

   I am addressing OPC Variables using Datasocket. If I send the opc URL directly into an "OPC Read" object, this works fine. If I put this operation in a loop and benchmark the time is takes, the first 3 times will take about 100ms, but after that, each subsiquent read will take about 2000ms. does anyone know why this is, or how to optimise this performance?

Many thanks, Alec

0 Kudos
Message 1 of 4
(2,325 Views)

It is not obvious but you can open the URL using normal Datasocket functions and then you the ref to access the data.

 

Many things can affect the performance but more often than not I have found the utility that lets me configure the data socket server will let me establish an update rate. These usually default to a update rate that makes the server look good but not work to hard. So I suggest you first look at the update rate in the server.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,319 Views)

Hi,

   The server update rate is not the issue. Tanks, I looked into "Opening" and "Closing" a reference to the OPC url, when using this mode of communication, the OPC Read constantly reads at a nice fast speed. For this to work in my application, I need to store these Datasocket references in an object (say a functional global variable). I tried this and it does not work. I have also tried storing the references in a variant array type front panel object, but the end result of this is when I go back to retreive the reference (the ID number given to it by LabVIEW appears the same) it does not work (ie, feeding the reference into a read object only causes the object to time out).

 

   Have you got any ideas how I may better haandle these reference?

 

Cheers, Alec

0 Kudos
Message 3 of 4
(2,315 Views)

Wrap the Datasocket functions in an Action Engine.

 

Init - opens refs to the URLs and caches same in the SR.

 

Read - Uses ref stored in SR to do the read and return the data.

 

...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(2,313 Views)