LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling Frequency Issue

Hi,

I was trying to acquire data from 2 analog input channels with this VI, but my sampling frequency was a lot slower than the desired 500Hz, would any one take a look at my VI and tell me where I did wrong?

also, how can I change the data format from


1,    1.2340   2.3450

to

1,    1.2340,  2.3450



Thanks.
0 Kudos
Message 1 of 7
(3,222 Views)
I cannot help with the DAQ issue but on the file format issue: Connect a comma constant to the Delimiter input of the Array to Spreadsheet function (middle of the top).

Lynn
0 Kudos
Message 2 of 7
(3,211 Views)
What hardware are you using?  Is your card capable of sampling that slow ???

Message Edited by esa_paranoid on 04-24-2006 03:14 PM

Ryan

LV 7.1
0 Kudos
Message 3 of 7
(3,205 Views)
One comment, dont make and close a task every loop, this will slow down your acquisition.  Try putting just the task start and read functions in the loop. 
 
 It looks like your sample rate is set for 500Hz so I dont know why you would be seeing different.  What makes you believe it was lower than that?

Brian

Message Edited by BrianPack on 04-24-2006 03:15 PM

0 Kudos
Message 4 of 7
(3,204 Views)
Thanks for the delimiter advice, it worked beautifully.
0 Kudos
Message 5 of 7
(3,196 Views)
Hi BrianPack,

I got an error message right away after I pulled the DAQmx icons out of my WHILE LOOP.  Did I do something wrong?

Here is the error message I got.



Error-200479  occruued at DAQmx Start Task.vi:6

Specified operation cannot be performed while the task is running.

Task Name:_unnamedTask<2F06>




hellolv
0 Kudos
Message 6 of 7
(3,194 Views)

HI hellolv-

You should also move the DAQmx Start outside (i.e. before entering) the While loop.  I would also suggest switching the DAQmx Read from a single point instance to a multiple point instance.  For example, it is much more efficient to read using the single channel>>multiple sample version twice per second with samples to read=250 than to read a single point 500 times per second. 

You can be certain that the DAQ board is acquiring at ~500Hz because you set up a hardware-timed task, but you can't be sure that your loop can run 500 times per second to return the data from the buffer at 500 samples per second.

Hopefully this helps-

 

Tom W
National Instruments
0 Kudos
Message 7 of 7
(3,181 Views)