LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing data from Sub VI's with out much memory use

Hi,
      I have three threads in my program. In the first thread I am reading the data every 5 msec using the Daqmx function and writing it to a sub VI. In the other two threads I am reading the data from that sub VI and clearing it and these two threads are running with 1 sec loop time.
           This process is taking lot of processor time and slowing my application. I replaced the sub VI with a reference node and this also didnot help much. Is there an alternate way to address this issue other than using queues?
 
thank you,
 
Mudda.
0 Kudos
Message 1 of 3
(2,557 Views)
Your explanation is a little confusing. I think you use the word thread where you mean to use loops or something. As a matter of fact: if you are using a reference to get the data out of your subvi, you are actually using the user interface thread. That is not a good idea and will definitely slow down performance. references into subvi's are a very cool feature, but don't use it for data intensive procedures.

BTW. if you have 3 independent loops in your code, it is definitely possible that they will run in differnt threads, but Labview does that all automatically.

In the past I noticed great CPU load issues when trying to read DAQ samples when they were not read by the hardware yet (software running ahead of the hardware). I suggest you have your code monitor  the  hardware FIFO buffer before you read the data into Labviiew.  It is also possible that you get performance issues when you have no waits in a certian loop, causing it to run as fast a CPU-possible
0 Kudos
Message 2 of 3
(2,538 Views)
I should read the questions better..
How about using an array and a local variable?
calling subvi's very fast and often also gives you a little performance hit.
Another issue may be this: if your subvi takes a lot of time to execute in one of the loops, it may not be ready to execute in another. I would dispose of the subvi.

0 Kudos
Message 3 of 3
(2,535 Views)