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-20-2010 09:01 AM
I am working on a VI where I am currently using a timed loop to acquire voltage and thermocouple data with NI 9219 and NI 9211 modules. I have 1 task set up and am writing all of the data to a file. When I set the timing loop to acquire data at intervals greater than 1 second (ie period = 1000 w/ a 1 kHz timing source) everything seems to work fine. However, if I decrease the period to say 500 ms, it doesn't work properly. I am not getting 2 samples per second of data. I have attached a screenshot of my vi for reference.
Has anyone else seen any problems like this? It seems fairly straightforward, but I can't figure out what I am missing.
Thanks in advance,
Taylor
04-20-2010 09:09 AM
The array building and graphing is taking too much time so...
Search this site for "Producer/Consumer" design pattern ( it seperates the DAQ from the acumulate and display work) to run regularly.
Ben
04-20-2010 09:28 AM
Okay, I just removed everything from the loop with the exception of the DAQmx read to get rid of all overhead. When I stop the loop, I write out the last data point and the increment number. It is still not timing correctly (ie if I let it run for 10 seconds at a sampling rate of 5 S/s, it should have incremented 50 times but instead it only incremented 8 times).
-Taylor
04-20-2010 09:31 AM
Please post a new image.
Ben
04-20-2010 09:46 AM
04-20-2010 09:59 AM
It is unusual that DAQ can't keep up with a twice a second single point read, so I thought you would get away with it. Apparently "not on your machine". So switch over to hardware timed acquistion and let the clock on the board do the measurements instead of relying on software timing.
Ben
04-20-2010 10:50 AM
That is working properly now. Thanks for the advice.
One more question, is there any way to control the acquisition rate from the VI or only in the Measurements and Instrumentation Explorer?
04-20-2010 10:57 AM
I THINK you can right-click on your task control and choose "generate code...". The resulting sub-VIs (the one for configuration) should be setting the sample rate. make it a control, put it on the icon connector and then you will be able to specify the sample rate via your code when it starts.
Ben
04-21-2010 08:45 AM
04-23-2010 09:15 AM
Hello Taylor,
After looking over your code and looking into you hardware, the max sampling speed of the 9211 is 14 S/s and the 9219 max sampling speed is 100 S/s. In order to get a better idea of your system, are you running in real time system or a windows environment? If you are running in a realtime environment, you would need to change your timing source to the 1 MHz clock in order to sample at a higher speed. If you are in a windows enviroment, I would suggest to change your sampling to continuous with a desired sampling rate. It looks like you have created the task in MAX so you can change the sampling rate under Time Settings section.
JimS.