Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital start and stop trigger with HW restart

Solved!
Go to solution

Hi,

 

I'm trying to write a program which will continuously read samples based on the rise and fall of a digital trigger.  I want the measurement to start on the rising edge of the trigger and stop on the falling edge of the trigger.  I want the data that is read to be retained and then appended with the next set of data as the trigger rises again.  I have read the "Digital start and stop trigger" tutorial and can use the reference trigger to stop the measurement process, and I have looked at the "Acq&Graph Voltage - Int Clk - HW Trig Restarts" example that comes with LabVIEW and I can get both of these working separately with my application.  I am getting quite confused however trying to put the two together (see attachment).

 

If I put a "Start.vi" icon inside the while loop then I get a "you can't do this while the measurement is still running" type error.  If I put it outside the loop then the process only runs once.  I have tried putting a case structure in loop to restart only if necessary but this produced another error the source of which eludes me.  Is there a standard way to do this and can if so can someone point me in the direction of an example?

 

Cheers,

Glen

0 Kudos
Message 1 of 3
(2,952 Views)
Solution
Accepted by GlenS

I think in this situation it would be best to use a Pause Trigger.  You could use the pause trigger to stop the acquistion when the trigger was low and start it when the trigger was high.  In this way, you will only sample during the length of your trigger pulse.  I've attached a screenshot of a VI that shows this principle in action.

 

Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
Message 2 of 3
(2,941 Views)

Thankyou for that!  Works perfectly.

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