08-15-2008 01:33 PM
08-21-2008 07:45 AM
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.
08-26-2008 09:39 AM
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,
08-27-2008 07:57 AM
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.
08-29-2008 07:28 AM
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.
Input | deviceNumber | i16 | assigned by Measurement & Automation Explorer |
chan | i16 | analog input channel number | |
gain | i16 | gain setting for the channel | |
Output | reading | 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.
Direction | Name | Type | Description |
---|---|---|---|
Input | deviceNumber | i16 | assigned by Measurement & Automation Explorer |
numChans | i16 | number of channels | |
chans | [i16] | list of channels | |
gains | [i16] | list of gain settings | |
count | u32 | number of samples | |
sampleRate | f64 | desired sample rate in pts/s | |
scanRate | f64 | desired scan rate in scans/s | |
Input/Output | buffer | [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,
08-29-2008 08:21 AM
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.