High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

difficulty triggering scope to collect waveform

I have a 6602 counter board which I use to generate instrument triggers at 10 Hz.  I also have PXI 5112 board and a PXI 6070E board which I want to use to collect waveforms and are digitally triggered by the 6602.  I have attached my latest program for your viewing.  My problem is that I can only collect a single waveform with the current program.  I can make the 5112 board collect every waveform generated in my experiment by moving the "niScope initialize acquisition.vi" into the while loop, but this isn't smart programming. 
 
I am also having difficulty with the 6070E board.  I can use this board successfully to capture waveforms if (and only if) I initialize and stop the DAQmx Read.vi each iteration of the while loop.  Once again, I don't believe that this is smart programming. 
 
I look forward to any recommendations which you may have.  Thanks.
-Darrin
 
0 Kudos
Message 1 of 6
(7,347 Views)
Hi Darren1,
 
You need to set the "number of records" parameter on the "Configure Horizontal Timing.vi" in order to acquire multiple triggered waveforms.
 
As for DAQmx, I don't believe there is an option for acquiring multiple triggered waveforms built in to the API.  What I have seen done in the past is to set up a retriggerable pulse train and use that as your sample clock.  That way, you will acquire a set amount of data for each trigger that is received.
 
I hope this helps.
 
Regards,
Sean Close
Product Support Engineer: High Speed Digitizers
0 Kudos
Message 2 of 6
(7,342 Views)
I do appreciate your quick response but unfortunately, it did not fix my problem.  I probably did not describe my problem correctly.  I one again have attached the program for your viewing.   What I want to do is the following: 
I use the 6602 board to generate triggers (at 10 Hz) to my pulsed experiment.  As a result of the experiment, I collect various waveforms (mass spectra, optical decay signals, etc.).  I want to use simultaneously both the 5112 scope board and the 6070e board to sample these waveforms at 10 Hz but I cannot.  As the vi is currently programed, the 6070e board samples the wavefroms at 10 Hz without problem; the 5112 board will only sample a single waveform.  I can fix this by moving the "niScope Initiate Acquisition.vi" into the while loop.  If I do this, then both boards will acquire and sample waveforms, however, the whole program slows down and I am only able to sample every other waveform (or in other words, the internal while loop executes at ~5 Hz).  Basically, this results in me throwing half of my data and experimental time away. 
 
I am certain that this problem is do to my inexperience with LabView programming and that there must be an intellignet method to program this vi without slowing it to a crawl.  I look forward to your response.  THX.
-Darrin
 
0 Kudos
Message 3 of 6
(7,333 Views)
Hello,

I believe that Sean’s suggestion is what you are looking for.  By setting up a multi-record acquisition with NI-Scope you are able to perform a retriggerable analog input.  In your loop it looks like you want to read back a single record at a time.  You can do this by setting the Fetch Record Number and Fetch Number of Records property node and then reading with the Fetch single waveform VI.

This will allow you to trigger of several waveform spaced close together without needing to re-initiate the acquisition which takes longer.  I hope this helps,

Jesse O
Applications Engineering
National Instruments

Message Edited by Jesse O on 07-12-2007 01:34 PM

Jesse O. | National Instruments R&D
0 Kudos
Message 4 of 6
(7,314 Views)
Thanks.  That certainly did help.  Please allow me to ask another question that is related to our discussion.  I have found it necessary to keep Window Task Manager open while programming in LabView.  Every so often, I'll run the vi and monitor CPU usage in task manager.  If the usage goes above 75% and remains while the vi runs, the program will inevitably crash and I have to figure how to program so that the vi runs efficiently.  Usually I can identify the problem (like generating a huge array), however, I sometimes have no idea as to why the vi does this (like when programming counters or the scope and I find that using a "check status.vi" fixes the inefficiency).  But then again, I would imagine that repeatedly checking the status would make the program inefficient.  Do you know of a tutoral which addresses this issue? 
-Darrin

0 Kudos
Message 5 of 6
(7,289 Views)

Hi Darrin,

I would suggest putting a wait(ms).vi in your code. Without a wait timer, the code executes as fast as possible, and this can bog down even the fastest dual core processors. Even a wait period of 1ms will help significantly. Another suggestion would be to use the VI Profiler (Tools >> Profile >> Performance and Memory) to narrow down what is using the most bandwidth.

David L.
Systems Engineering
National Instruments
0 Kudos
Message 6 of 6
(7,273 Views)