From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-02-2011 02:32 PM - edited 04-02-2011 02:36 PM
I created a program to read the input of
analogs channels and store the data into an Excel file. The program working so
far, however, the problem is, whenever I need to update the DAQ Assistant
Parameters (Sample Rate and Number of Sample), I need to turn off the program
(by pressing the "STOP" Abort Execution Icon) and then enter the
desired values, then run the program again.
Sample Rate and Number of Sample are controlled by numeric input control. My
question is, how would I implement a "real-time" update button to set
the new number of sample and sample rate of the DAQ while DAQ is running? As I am new to LabVIEW (2 days experience), an explanation with a sample VI would be much helpful.
Solved! Go to Solution.
04-02-2011 02:35 PM
You could use the lower level DAQmx functions as in the numerous shipping examples (Help>Find Examples) but you cannot change these parameters on the fly. You have to stop the running task before you can change the sample rate.
04-03-2011 02:09 AM - edited 04-03-2011 02:11 AM
I have another small question, for my problem, please reference for earlier attachment. When the program first run, I press "ON", the programs starts to acquire the signal with Sample Rate and Number of Sample I provided, when I releases the button (ON->OFF), the program stops sampling=> perfectly fine. The problem happen when I turn on the program again with new parameters of Sample Rate and Number of Sample: Although the program starts to acquire the data, it does not run with new parameters. I can use the "Abort Execution" to stop program, enter new parameters, and start the program again but this is so annoying.
Please help me
04-03-2011 02:52 PM
No. As far as I know, you are not stopping the task. The DAQ Assistant hides so much and I never use it. Look at the low level functions a a state machine where you can stop and start a new task.
04-03-2011 03:53 PM
In addition to what Dennis said, many NI-DAQmx devices support changing the sample rate while the task is running. I don't know of a document that lists which devices support this, but E Series and M Series support it for AO and X Series supports it for AI, AO, and DIO. There is a shipping example called "Cont Gen Voltage Wfm-Int Clk-Variable Rate.vi" which demonstrates this feature for AO, but basically it involves setting the SampClk.Rate property while the task is running.
Brad
04-03-2011 04:21 PM
After 2 hours of reading and trying , I got the stuff work. Thank you very much. It is kind of difficult as I do not have much experience (3 days) and yes, I can update the stuff in "almost real-time"
Again, I am very much appreciated Dennis Kutson and Brad K for all the suggestion.