PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Retriggering a software trigger using a PXI-4462

I have a PXI-4462 data acquisition card that is mounted in a PXI-1036 chassi.  Three of the four input channels are being used.  The first channel is a reference voltage signal for comparison.  A software trigger is set on this channel.  The other two channels are connected to voltage signals as well.  I have the DAQmx Timing SampQuant.SampMode property set for continuous samples.  I also have a Start Task VI set outside a while loop, and I'm reading the acquired signal using the DAQmx Read inside the while loop.  I am continuously acquiring 61440 samples from each channel at a sample rate of 61440 samples.  This sample rate and number of samples can be changed by the user.  I was originally having a problem getting this code to run, but since making futher modifications the code runs and, for the first acquisition,acquires data at the correct level based on the trigger set, but the starting acquisition point drifts further away from the trigger point I originally set after the first acquisition.  It seem like the trigger is only being used for the first acquisition.  I was looking at some of the retriggering examples available using the example finder, and I downloaded a retriggering example from the ni website but it does not support the PXI-4462.  I tried resetting the trigger inside the while loop after I start the task but this generates an error.  Is there a way I can retrigger after each acquisition to eliminate this problem?
 
Thanks!
0 Kudos
Message 1 of 3
(3,019 Views)

Hey Megaman,

Sounds like you're pretty close to solving the problem.  Also, thanks for providing such a high level of detail!  Because you described the issue so thoroughly, it is much easier to answer your questions.

To start with, the PXI-4462 is not capable of doing a hardware-timed trigger re-arm.  Thus, to re-trigger each aquisition, you will simply need to stop and restart the task for each iteration of the while loop.  FYI, this is in contrast to our high-speed digitizers (PXI-5122 for example), which are capbable of re-arming the start trigger in hardware.  In your case specifically, the sequence of function calls will something like the following:

1) DAQmx Create Task

2) DAQmx Configure Timing

3) DAQmx Configure Trigger

...start of while loop...

4) DAQmx Start Task

5) DAQmx Read

6) DAQmx Stop

....end of while loop...

Notice that it is only necessary to configure the start trigger once, before the while loop.  Also, notice that the trigger can be re-armed simply by stopping and restarting the loop.  In fact, I imagine that the error you reported was occuring when trying to configure the trigger while the loop is already running - which would be an expected error.

In conclusion, all you need to do to re-arm the trigger is to start the DAQmx task at the beginning of the while loop, and stop the task at the end.  I think this should solve the issue, but certainly let me know if you have any further questions!

Regards,

David Hall | Applications Engineering | National Instruments

0 Kudos
Message 2 of 3
(3,001 Views)

Thanks for your reply!  I am already implimenting of the steps you mentioned in the e-mail. I noticed when I run the VI in continuous mode and start and stop the task each time it slows down the data aquisition, but as you said it does retrigger every single time.  I have set up the progrqam to allow the user to select between finite sampling and continous sampling since there are advantages to both.  Your reply confirms that I'm doing everything the way I should and that my program should and does run smoothly and efficiently.  Thanks again for all your help.  It is greatly appreciated.

 

0 Kudos
Message 3 of 3
(2,993 Views)