NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
g_l_g_s
Posts: 14
0 Kudos
Accepted Solution

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

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.

Member
Tunde_S
Posts: 74
0 Kudos

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

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
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page