Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Daq scan rate vs. sampling rate

How do you have a 50 Hz DAQ Scan Rate and only acquire data at 5 Hz?  Why would you want to run DAQ at a rate that is faster than what you are actually recording?  What would the code look like to do this downshift?
0 Kudos
Message 1 of 6
(4,601 Views)

Let me explain myself a little better:

 

I have two loops running in parallel.  One loop is the Acquisition Loop.  It has two cases that flows between the two cases at a rate of 50 Hz.  The first case reads the analog input data and the second case adds the data to a temporary storage data Q. 

 

The other loop extracts the data from the data Q to form an array with 5 Hz data.  It records this 5 Hz data at the end of a minute and it includes 300 data points spread over the minute.  How does it extract at the end of a minute 300 data points from 3000 data points?  Wouldnt it get the last 300 data points from data Q and not the 300 data points spread evenly to reflect a minute of data? It should basically filter the 50 Hz data to 5 Hz data.

 

 

0 Kudos
Message 2 of 6
(4,560 Views)

Hi,

 

What are the functions that you are using to extract the 300 data points from the 3000 data points?  Is this an example program that you are using?  Would it be possible to post your code or a screenshot of the section so that we can get a better idea of what VIs you are using.

 

Thanks,
Raajit L
National Instruments
0 Kudos
Message 3 of 6
(4,517 Views)

My goal is to get 5 Hz data from AI read.vi and add that data to a Q I made also at a rate of 5 Hz.  In the main loop I then want to extract the Q at a rate of 5 Hz in blocks of a minute. 

 

I am using State Machine code to force cases to run when things like a minute is over or I have enough data for a minute.  I determined that the 50 Hz rate the DAQ is running at is averaged with 10 samples to yield the desired 5 Hz rate.  Now, I am trying to figure out what my scan rate and my sample rate is.  I know the scan rate input to the AI Read.vi in the Acquisition Loop is 50 Hz.  Is that the sample rate or the scan rate?  Keep in mind I have 24 channels on my scan list. 

 

 

0 Kudos
Message 4 of 6
(4,505 Views)

I am assuming you are using the Traditional DAQ VIs.  Could you please tell me what version of the DAQ driver you are using?  The AI Read has the following parameters.

 

InputdeviceNumberi16assigned by Measurement & Automation Explorer
 chani16analog input channel number
 gaini16gain setting for the channel
Outputreading i16*the integer result of the A/D conversion

 

There are a couple of ways in which you can set up the scan and the sample rate.  There is the DAQ_op function that you can use or the SCAN_op function as well.  The SCAN_op function has the option to set both the sample rate and the scan rate.  Here are the parameters for that.

 

DirectionNameTypeDescription
InputdeviceNumberi16assigned by Measurement & Automation Explorer
 numChansi16number of channels
 chans[i16]list of channels
 gains[i16]list of gain settings
 countu32number of samples
 sampleRatef64desired sample rate in pts/s
 scanRatef64desired scan rate in scans/s
Input/Outputbuffer[i16]Conversion samples returned

 

As you can see, you have control over the scan and the sample rate.  Are you using one of these functions in your code?  How are you controlling the scan and the sample rate? 

 

Regards,

Raajit L
National Instruments
0 Kudos
Message 5 of 6
(4,479 Views)

I am using Traditional DAQ (6.8.1) and Labview 5.1.1.

 

My AI Read has different paraments from the ones you mentioned.  There is a scan rate input of 50 to my AI Start.  I set number of scans to read to 10 in AI Read.  My buffer size is 30,000. 

0 Kudos
Message 6 of 6
(4,474 Views)