PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI-5122 Fetch vs. Continusous Acq

Hello all,

I am using LV 8.2, XP, PXI 5122.  Currently I have a program written to acquire a defined number of records (# of samples approx. 2000/record), do some computation and then display the data.  I was working off of the NI-SCOPE multi-record example, which collects data, and displays, then stops.  The program is working nicely, but I am having a little trouble with the next itteration of the program.  Now that I am able to capture one set of the data, I would like to be able to do this continusously such that the data capture and process do not stop after 1 set of records has been captured but this process only stops when the user hits a stop button.  I have tried several things, such as adding a comit vi. before the loop, and have attaced my vi.s and any help would be great.  I also ran the vi. analyzer and one of the main errors I am getting is that when I made my default settings this included storing all of the data in my graph arrays.  This is a waste of memory and I was wondering how do I reset these graph arrays to 0 so that the total size of the vi only includes the actual vi and not the raw data. Thanks in advance.  I coud only attach 3 out of the 4 vi.s  The missing one is not important only a global variable. 

Azazel
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 1 of 6
(4,146 Views)
Hi Azazel,

For continuous acquisition that can be stopped by the user, it is recommended to refer to the shipping example "niScope EX Fetch Forever.vi".  This example demonstrates using continuous acquisition to fetch an infinite record of data (or at least until you press stop).   It configures and starts one acquisition that is never triggered.  This is accomplished by configuring a software trigger and never sending the software trigger.  Therefore, the digitizer will continuously acquire data into its onboard memory until Abort or Close is called.

The loop in the VI continuously fetches data from onboard memory into the computer's memory using DMA transfers. If the sampling rate is low, the computer can fetch all the data from the digitizer, so data is never overwritten.  However, at faster sampling rates, the computer will not be able to fetch the data before it is overwritten by new data.  This results in a "data overwritten" error.  The maximum sampling rate that you can achieve will be system dependent, but you do have an advantage in using a PXI chassis especially if you also have an embedded controller.  Take a look at this example and let us know if you have any other questions about it.

Regards,
Andrew W
National Instruments
0 Kudos
Message 2 of 6
(4,132 Views)
The example fetch forever looks like it is on the right track, but the software trigger will not help in my case.  For my app.  I require each record, which consists of a pre-defined number of points, to be triggered by an external signal.  Therefor in the fetch forever example it looks like the PXI chassis recieves one software trigger and then acquires continuously, where as I need to fetch a predefinied number of samples process this data, display the data and then start the process over until the user presses stop.  The Fetch in Chunks example vi, looks even closer to what I require, but I do not exactly understand what it is doing as it uses pre-triggers and than re-aligns the data it acquires.  Will this accomplish what I require?  Can you recommend any help files to explain the pre-trigger.  The reason I am asking these questions rather than just trying the vi.s is that our PXI chassis is a hot commondity in my lab and I only get a certain number of hours a week to play with it so I always need to have written vi.s before I get to the lab to make efficient use of my time.

Thanks for you help,

Azazal
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 3 of 6
(4,120 Views)
Hi Azazel,

I think what you are trying to have is a continuous multi-record acquisition with your external signal serving as a record advance trigger.  Unfortunately this is not possible because the NI-SCOPE driver does not currently allow for continuous multi-record acquisitions.  For acquiring a defined number of samples in a record and performing this continuously, the only recommendation I have at this point is to look at the example "niScope EX Configured Acquisition.vi".  This fully configures the device and fetches on each iteration of the while loop, and this is very similar to how the NI-SCOPE Soft Front Panel functions.  You can configure a digital start trigger in this VI such that once one record has been triggered and fetched, the device would reconfigure and wait for another trigger.

Regards,
Andrew W
National Instruments
0 Kudos
Message 4 of 6
(4,111 Views)
I do not know if this makes a difference but I do not need it to be continous.  ie.  The data acquisition can be taken, then paused while the calculation is done, then display, then continue the cycle.  I can accomplish this by putting a while loop around my entire "main" vi from above, but upon each ittereation of the loop the PXI chassis will be re-configured which is very slow.  I would just like to set up the parameters for acquisition then have the PXI-5122 acquire data based on those parameters.  I noticed you didn't mention about the "NIScope fetch in chunks.vi" so does this mean that will not accomplish what I am trying to do?  I have lab time tomorrow so is you or anyone else has thoughts I would love to hear them and I will update this post with the results from my fetch in chunks vi.

Thanks,

Azazel
Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 5 of 6
(4,110 Views)
The "niScope EX Fetch in Chunks" example sets up an acquisition of 1 record that contains a number of samples that you specify.  The maximum number of samples allowed is limited by the available onboard memory of the device.  Since you have an external trigger that is intended to separate groups of samples, this VI isn't quite what you need since only one start trigger is used at the beginning of the acquisition.  In addition, the acquisition will complete once all of the samples for that 1 record have been acquired.

Regards,
Andrew
0 Kudos
Message 6 of 6
(4,104 Views)