LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is tag access slower in DSC 2009?

I recently upgraded my application from LV/DSC 7.1 to 2009.  The application reads about 50 tags from an OPC server on every iteration of a loop.  I updated the application to use the newer DSC routines, with shared variables interfacing to the OPC server.  In the old version the loop time was <1 second, which was acceptable.  Now the loop time is >4 seconds, and it seems that each variable takes ~100 ms to read.  This is way too slow.

 

Interestingly, if I read the same variable 50 times in a row it's extremely quick.  The problem seems to be reading 50 different variables.

 

The OPC server is identical.  The only thing that's changed is the version of DSC (and, of course, the DSC routines used to interface with the OPC server).  What can I do to speed this up??

 

Thanks,

Charlie

0 Kudos
Message 1 of 4
(3,087 Views)

Charlie

 

 

So the slow down you are seeing is expected, in the last 5 years as DSC has become more robust and stable. How are you reading from your variables, can you post your VI or at least a screenshot. One thing to check is make sure your error wires are connected LV can function faster if the execution order is predetermined.

 

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

I have not personally seen the mutation of LV 7.1 to LV 2009 so I can only speculate.

 

Is the updated code reading from the shared varibles using shared variable nodes or is sub-VI used?

 

Switching over to Datasocket reads helped in my app (open once and use ref to do the reads).

 

I fear the mutated code is opening reading and then closing the datasokcets.

 

Again, just speculating.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 4
(3,036 Views)
IN LV2009 a new NSV API was released which conforms to the standard Open/R/W/Close methodology.  It is possible that older code cached the DS refnums for you were the new NSV API requires you to explicitly open it yourself.  I know for a fact that if you are constantly opening the refnum it will be very slow.
0 Kudos
Message 4 of 4
(3,021 Views)