Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

AI Start.vi

Solved!
Go to solution

I want to know how to manipulate AI Start.vi to implement a circular buffer.  I also want to know how the input scan rate of 50 Hz to the VI can output an actual scan rate of 5 Hz.  Is the input scan rate to AI Start.vi the sample rate or the scan rate?

 

Labview 5.1.1, Traditional DAQ

0 Kudos
Message 1 of 4
(3,562 Views)

Hi BME genuis,

 

I noticed that you had posted the same issue on a previous post. I'm still a bit confused as to what algorithm you were using to bring down your samples from 3000 to 300 in your application, but I will try my best to answer your questions.

 

So a scan rate input of 50 Hz means that each channel will be sampled at a rate of 50 Hz. The number of scans to read specifies the number of scans to read from your buffer, where one scan corresponds to 1 sample/channel. So let's say that you were acquiring 4 channels and you read 10 scans, this means you will be reading in 40 samples in total, 10 samples/channel. Therefore, reading in 10 scans does not take an average of 10 readings as you mentioned unless you add an averaging function. Could you send us a snippet of your code so we could have a better idea of how you are programming your application.

 

Also could you clarify exactly what you mean by circular buffer? By default, when you read data and set your buffer size, your acquisition will only use the specified buffer size to store your data. As the buffer is being filled with data, you are also able to read from it every time you call AI Read. The driver will keep on writing onto this buffer in a circular fashion as long as any unread data is not being overwritten.

 

I hope this helps.

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 2 of 4
(3,539 Views)
  Circular buffer as in continuous acquisition via inserting a 0 to the number of scans to acquire input.  I attached the code for the AI Read.vi and subsequent averaging.  My scan rate is 50 Hz and my number of scans to read is 10 and I am scanning 14 channels.  So what is my effective scan rate since I am averaging these 10 scans every .02 seconds?
0 Kudos
Message 3 of 4
(3,444 Views)
Solution
Accepted by topic author BME_genuis

Hi BME genius,

 

Just to clarify, since the true scan rate is set in hardware, this will be set at a constant rate of 50 Hz and will not change. However, since it looks like you are reading in 10 scans for every AI Read and taking an average of these 10 values, your effective sampling rate should be 50Hz/10 = 5Hz. Just make sure that you configured your task for a continuous acquisition since otherwise, you may be missing points in between AI Reads.

 

I hope this helps,

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(3,428 Views)