LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increasing the sampling frequency of a VI code including a while loop

As long as you're using the wait until multiple, you're working with software timing.  In that event, a limitation of 100Hz isn't unexpected.

 

Your spec sheet says you have 2 counters.  You'll want to move away from the wait until multiple and find out how to use those counters to time your tasks.  Without that, you'll never reach the 200kS/s.

 

If you believe it's "unavoidable," you might as well stop trying to reach that level now.  It's not going to happen.  If you want to get higher rates, stop placing that limitation on yourself and find a way to use the counters to get hardware timing.

0 Kudos
Message 11 of 19
(1,548 Views)

Dennis and Natasftw: Thanks for your responses. BTW, Is what you indicated also true for other timing functions such as "Time Delay"? What is the best appraoch to reach the accurate and correct time step as well as high enough sampling rarte by using sample clock or any other timing function? 

 

The revised version of the original vi file has been attached. Any comment is much appreciated. 

0 Kudos
Message 12 of 19
(1,535 Views)
I'm posting from my phone and I can't look at your code but the only way to have an accurate and high sample rate is with the device's internal clock. None of the time functions are applicable. The counter functions of the device are not applicable either.
0 Kudos
Message 13 of 19
(1,523 Views)

Dennis: A bunch of thanks for your quick reply. Unfortunately, no idea how to deploy the device's internal clock to control timing! You may examine the code attached to the previous post at your convenience. 

0 Kudos
Message 14 of 19
(1,513 Views)
Attach an image of the block diagram. You should also browse the functions with context help turned on.
0 Kudos
Message 15 of 19
(1,499 Views)

Dennis: Thanks a lot. The snapshot of the block diagram is attached. 

0 Kudos
Message 16 of 19
(1,489 Views)
You have to find the timing function on the palette and place it after the create channel. It will have inputs for sample rate, number of samples, and perhaps continuous or on-demand sampling. Note that with continuous sampling, you may get an error because the write function takes to much time. Remove the wait in the loop.
Message 17 of 19
(1,479 Views)

Thanks, 

 

In fact, I tried to do so but it did not work, proabably because of the same issue you mentioned. To make sure to get the point , your advice is repetitive writing of the acquired data to the file by using while loop and discontinuous sampling mode, isn't it? 

0 Kudos
Message 18 of 19
(1,475 Views)

@Farzam wrote:

Thanks, 

 

In fact, I tried to do so but it did not work, proabably because of the same issue you mentioned. To make sure to get the point , your advice is repetitive writing of the acquired data to the file by using while loop and discontinuous sampling mode, isn't it? 


Nope.  Use another loop for logging your data.  Take a look at the Producer/Consumer.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 19 of 19
(1,457 Views)