LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i get labview 7.1 to acquire data at a faster rate than the DAQ Assistant allows?

when i send a simple voltage waveform to the input board and record the output from the DAQ Assistant it does not reproduce the signal. I think it is sampling the signal too slowly. Any tips on how I can alter it so that it reads faster thus reprodue my signal?
0 Kudos
Message 1 of 4
(2,740 Views)
Hello.

From what I saw, it looks like you are reading one sample from each channel each time the loop iterates, and you have a 5ms delay in the loop. Which means that you are sampling your channels once every 5ms.

If you need to sample 1 sample at a time, and process each sample individually, then you have to do it "software-timed", and the fastest rate that you can achieve is 1kHz (sample every millisecond). To do this, you would reduce the constant of the wait function to 1 instead of 5.

However, if you do not need to process each sample individually, you can set your acquisition to be hardware-timed, and achieve much greater sampling rates. To do this, in the "task timing" tab of the DAQ Assistant, select "Continuous" and set the sampling rate and the number of samples to read with each iteration of the loop. You will then get an array of samples, instead of the single sample you are getting now.

Hope this helps,

Alejandro
Message 2 of 4
(2,729 Views)
hi,
thank you, i'v altered my progam as you suggested and it worked for the first input signal on its own. however when i changes all the inputs to read in continously the program didn't work. I tried to log all the input data which showed that it took inputs for the first input for the first second, took inputs from the second input for the second second and no more. Any suggestions?
ThANKS
0 Kudos
Message 3 of 4
(2,716 Views)
Hi.

Several comments: first, when you do a hardware-timed acquisition, by setting the sampling rate and number of samples to read, as you have done, you do not need to include the "Wait Until Next ms Multiple" since the loop rate is determined by sampling rate divided by number of samples to read.

Second, with the modification of the parameters the DAQ Assistant node is now outputting 100 samples each time it iterates, but your code contains a "Convert from Dynamic Data" terminal that converts this into a single sample. So, only the first sample is taken, and the other 99 are discarded.

If you want to process ONE SAMPLE AT A TIME, you need to set the number of samples to read to 1 in the DAQ Assistant, and hope that your computer can do all the processing you have in the loop in 1ms. Applications that typically require you to process one sample at a time, are those in which you have a control loop, and you have to set an output depending on some processing of one or several inputs. This seems to be the case in your program.

To ensure that your computer is being able to keep up with the loop rate you are trying to achieve, you should monitor the error output of all of your DAQ nodes, and probably stop the loop if there has been an error (by getting the boolean element of the error cluster, and connecting it to an OR terminal to stop the loop). If it is too slow, you must try to make the code inside the loop as efficient as possible. If you cannot get it to be fast enough, then you may need to use LabVIEW Real-Time, which executes LabVIEW code on computer processors without the Windows operating system.

If your application allows processing of several samples at a time, then you must set the "Convert from Dynamic Data" terminal to output a 1-D array, and modify your code to process an array instead of a single sample.

Good luck with your application. It seems interesting.

Alejandro
0 Kudos
Message 4 of 4
(2,685 Views)