LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

VI running slow

Solved!
Go to solution
Highlighted

I am using a NI 9234 Daq .

I have 4 channels configured using standard Daqmx VI’s not the express Daq assistant VI as it will not allow me to add a control for the sensitivity.

The issue I am having is that the VI runs slow when you look at the acceleration display you see segments that match the loop iteration but the FFT Graph looks fine.

Attached is my VI please have a look and see if I am missing something.

Thank you

 

0 Kudos
Message 1 of 3
(1,108 Views)
Solution
Accepted by topic author n3ow
10-13-2016 06:00 AM

Hi So a few quick observations.

 

1.  You are performing your task creation inside the loop every iteration. Do this before your loop.

2.  You stop the task every iteration in the loop. Do this outside the loop

3.  Inside your loop should be only your read function.

4.  You are analyzing data every loop iteration.  Look into producer consumer architecture.

 

Good luck.

Regards,

Matt
Message 2 of 3
(1,080 Views)
Solution
Accepted by topic author n3ow
10-13-2016 06:00 AM
  • What's that array-to-cluster-unbundle dance? Just use index array resized to four outputs.
  • Why do you think you need to create and destroy all these channels with every iteration of the upper loop?
  • Your "record data" loop is one shot if "record" is false when the program starts and the loop will stop after the first iteration. Once that loop stops the queue will build up forever because there is no consumer. Since the queue size is unlimited (-1), you will eventually run out of memory.

LabVIEW Champion Do more with less code and in less time
Message 3 of 3
(1,078 Views)