LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture one time event using PCI 6132

The desire here is to capture a one time event by means of an analog signal as the trigger source.

 

I would like for the system to wait until the trigger event occurs and then provide me with samples for before and after the event.  I know I could use the pre-trigger setup but the only information I found on your website that comes close to achieving this is

 

https://forums.ni.com/t5/Example-Code/Archived-NI-DAQmx-Continuous-Analog-Input-with-Both-Start-and/...

https://download.ni.com/pub/devzone/epd/200306.vi

 

But there is a flaw with this code when it comes to using the PCI 6132 card.  Instead of waiting for the event it tries to read the card before the event, and when this is attempted it waits only a few seconds and the program stops due to an error.

 

Does anyone have a way to fix this problem.

 

Thanks,

 

 

Hector Soto

 

 

PS

Application:

We have a shock tube, which is used to produce a pressure shock within it.  We have 3 sensors positioned at different distances from the initial shock.  One is place at the build up pressure stage to monitor the pressure and to provide the falling edge trigger signal; it is also placed near the material which will be used to create the shock.  The other two are place near the end but separated by some distance of each other along the tube. See image. 

The idea here is to observe the pressure lag as the shock travels down the tube, so by placing the sensor at a know distance from the initial shock or from when the shock passes by one sensor first and then the second one we can determine the pressure lag.

Since there is no way to know when the material used to create the shock is going to burst, it is important to wait for the bursting of the material and yet acquire samples which occured before the burst.

 

0 Kudos
Message 1 of 2
(2,547 Views)

I found the solution to the problem it was the timeout on the DAQmx Read.

 

If you set it to -1 it waits indefinitely for the trigger event. 

 

I modified 200306.vi and deleted the parts which were not needed.  See vi attachment.

For this application there is no need to read the buffer continuously until the event occurs, because it seems that the card is continuously acquiring data but saving only the samples which are equal to the pre-trigger samples number, until the trigger event.  After the event it saves the rest of the samples for read.

 

It works beautifully.  I get my event always at the same position in the samples count or time, without worrying about when the event occurs.

0 Kudos
Message 2 of 2
(2,543 Views)