LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why doesn't the graph and array update from DAQ Assistant when run more than once

Solved!
Go to solution
I have a vi that collects data and displays it. When I press the Run button, it collects data as expected. But, if I chang the Samples or Rate, and press the Run button, it collects data at the previous Sample and Rate values. I have the exit the vi and run it again to collect it at the correct Sample and Rate values.
Download All
0 Kudos
Message 1 of 6
(3,280 Views)
Start by getting rid of ALL local variables. I can't see the controls in your image but there does not seem to be any reason to use locals and there are a lot of reasons why you should not.
0 Kudos
Message 2 of 6
(3,274 Views)
I had the Samples and Rate without local variables before with the same problem. I just did that to see if it helped. I also calculate the center point for the cursors and that responds to the changes.
0 Kudos
Message 3 of 6
(3,263 Views)
I don't use the DAQ Assistant so I'm not sure what is going on inside. The task would have to be stopped first before you can change the rate but changing the number of samples should work. It does with an example such as ContAcq&Graph Voltage-Int Clk.
Message 4 of 6
(3,249 Views)
Solution
Accepted by topic author Jack TK

I wired it without DAQ Assistant and everything works as expected. Thanks for all your help. Just curious now as to why DAQ Assistant doesn't work right.

 

Thanks again!

0 Kudos
Message 5 of 6
(3,233 Views)

Hi Jack,

 

After looking at your code I just want to clarify what you were seeing with the DAQ Assistant.  You cannot change the sampling rate or number of samples dynamically while your code is running due to some of the caveats of the DAQ Assistant.  This is explained in a knolwledgebase here and has an example of how to get the desired functionality with the DAQmx VIs.

 

However, you should be able to change the rate and number of samples before you run your VI.  These values will then stick for the entire duration of the execution.  If you completely stop the VI (using your End Program button) you should be able to change the values and start the VI again with new values.  I downloaded your VI and removed the right half which deals with writing to a file, and everything worked as expected.

Eric S.
AE Specialist | Global Support
National Instruments
0 Kudos
Message 6 of 6
(3,181 Views)