From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase the code efficiency in a while loop (using PXI5105 digitalizer for sampling outside signal)

Solved!
Go to solution

Theoretically we want the PXI 5105 (digitizer) have 302 recording with each recording have 1260 samples (the recording operation is inside a while loop) in about 30ms , however we found that in each period (30ms), the PXI5105 only carry out about 10 recordings. It is so wired. I am wondering if the operations inside the while loop consume longer time (e.g.  3ms), so that it cannot have 302 records even the PXI 5105 have 60M/s sampling speed. Is this true, you can find my labview  code, and if possible can you give me some suggestion to shorter the time of loop operation.

while loop picture.jpg

 

Please find the enclosed labview code.

0 Kudos
Message 1 of 2
(5,585 Views)
Solution
Accepted by topic author g_l_g_s

Hi g_l_g_s,

 

The PXI-5105 digitizer acquires data at the rate that you specify and stores the data in its onboard memory (up to 512 MB). The data is then sent to your computer when the Multi Fetch Cluster.vi is called. In the VI that you posted, you are only fetching one record during each while loop iteration. If you would like to fetch 302 records you will need to specify 302 records in the Configure Horizontal Timing.vi. For more information about digitizers, you might find the DevZone, here, helpful.

 

For determining the amount of time it takes for each while loop iteration, you might want to consider using the code structure in the Timing Comparison community example, which can be found here.

Tunde S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(5,570 Views)