LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced ?? Control Reference Update - Too slow.

I have a main VI which controls a bunch of SubVIs. Each of these subVIs get data from the DAq and generate the plots and intensity graphs. I use a control reference to display these plots and graphs on my main VI. This is really slow. When I compare the speed at which the main VI is updated and the subVI is updated, there is a significant difference. Is this usually the case or am i missing something ?

Thx


Kudos are the best way to say thanks 🙂
0 Kudos
Message 1 of 6
(3,284 Views)
This is certainly not always the case.  I have graphs doing the same thing in a number of programs I've written, where a subvi is gathering data and plotting it, but referencing that plot in the main vi, and I have never seen a performance hit.  There's a chance that it's something else in your code that's causing the slowdown.

Try posting your code and maybe someone can find the issue.
0 Kudos
Message 2 of 6
(3,278 Views)

There could be many reasons.

  1. How much data is in your indicators (XxY dimensions in your intensity graphs, chart history lenght, etc)?
  2. How many indicators do you have?
  3. Are there overlapping objects on your front panel?
  4. What are the loop rates in the various VIs? What are the data rates?
  5. What is youre definition of "slow". (milliseconds? seconds? minutes? ...?)
  6. What is a "significant difference"? (factor of 2? 10? 1000?)
  7. Were you messing with priority settings in any of the VIs?
  8. What is the CPU usage during running?
  9. What is the memory usage?
  10. ...

Updating via references is always more expensive. It would help if you could post your code. 🙂

0 Kudos
Message 3 of 6
(3,270 Views)
Here is the llb of my code..

Kudos are the best way to say thanks 🙂
0 Kudos
Message 4 of 6
(3,259 Views)
Note Altenbach's #4, which was also my initial guess. The caller has a delay of 20 ms. The subVI has no delay I can see (but I don't have the DAQ VIs).

___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(3,251 Views)
I agree with tst, your PP VI runs at unlimited speed for no good reason. You should pace it with a small delay so it will release the control to other processes after each iteration.
 
Also your DAQ part seems inefficient. Why do you configure the DAQ task from scratch, acquire, and close at every iteration? This is way too much work. You should flatten this out to the PP vi. Configure outside the loop on the left and close outside the loop on the right. Place only the ACQ part inside the loop.
 
Also, place the real terminal of the graph inside the loop and clear it once at the beginning using a local variable. A local variable is always more expensive and less efficient.
 
I don't understand why you need a timeout event in the main VI, it does not do anything except spin the loop, right? Just delete the timeout event.
 
0 Kudos
Message 6 of 6
(3,244 Views)