05-01-2006 09:35 AM
05-01-2006 10:18 AM
05-02-2006 11:37 AM
hellolv,
I have taken a look at your program, and I have made a few modifications.
I have found a couple problems with the code.
First, you are performing your DAQmx read in two positions inside your
while loop. This means that for every loop iteration you read in two
samples (not one). This makes the logic you use to stop the loop
incorrect because it assumes that one sample per loop iteration is read.
I have modified the VI so that only 1 DAQmx read is used. I also changed
how many samples you pass to the DAQmx timing. In this application it only
takes 120 seconds to acquire 60 000 samples (at 500 Hz).
Next, the interval between samples should be constant. The DAQmx device
will acquire data at the specified sampling rate and store the data in the PC
buffer. The graph will display data based upon waveform data type.
This data type only has a t0 (start time), dt (period between each sample), and
the data. I do not know how the graph would display data points that are
not spaced equally based upon only having this data. If you still see this in the code I posted,
can you please explain what you are seeing?
05-02-2006 11:54 AM
05-02-2006 12:00 PM
05-02-2006 12:02 PM
05-02-2006 12:44 PM
hellolv,
I have modified the VI one more time to help demonstrate that it is working
correctly. In the first application I posted, the task has started (and
data was being converted) while the save dialog box is visible. In the
new version I posted, I added several more sequence steps and now the task is started
only after you specify which file to use.
I have confirmed that this code does take 30 seconds to run for 30 seconds of
data. I have also added a few other items to your front panel. The
first is the actual rate data is acquired at. For example if you specify
503 Hz you might get 503.005Hz. The second is the approximate time the
task took to execute.
I hope after looking through this code you understand what you were seeing
before. I believe you probably started your timing after you pressed the
ok/save button in the save dialog box, when in fact the task was already
started at this point.
Regards,
Jesse O.
Applications Engineering
National Instruments
05-02-2006 02:34 PM