LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Software Triggering of DAQmx N-Sample Acquisition using DAQ Assistant

Solved!
Go to solution

Hello!

 

I'm still quite new to LabVIEW and am working on connecting all the dots. I'd like to acquire a finite number of analog data samples from a CompactDAQ system when triggered from an internal software boolean event (like a VI button press). I've followed examples to set up the acquisition with the DAQ Assistant, which works fine. But I haven't figured out how I can use a software trigger, though I do see how hardware triggers are set up in the Triggering tab within the DAQ Assistant.

 

I'm sure this must be very simple; perhaps I'm just ignorant of the code pattern used for this sort of thing. Also, I might soon find I need to move beyond the DAQ Assistant for some of what I'd like to do, so any pointers to good references or tutorials on DAQmx programming are welcome.

 

Thanks!

Ryan

 

0 Kudos
Message 1 of 6
(3,207 Views)
Solution
Accepted by RyanBiggs
You can simply put the acquisition inside a value change event for the Boolean control.
Message 2 of 6
(3,204 Views)

Great, thanks Dennis. This is exactly the sort of obvious-once-you-understand-it sort of solution I was expecting. I'm reading up on Event structures now and will accept your answer as soon as I get it working!

 

0 Kudos
Message 3 of 6
(3,198 Views)

One more silly question: how can I cause the code in the Event structure to trigger only on a low-to-high transition for the control and not any value change?

0 Kudos
Message 4 of 6
(3,189 Views)

You will have to put the code you want to run into a case structure.  Make the case based on your new control value.  Yes, this all goes inside of the event case.

 

EDIT:  Wait a minute.  skip what I just said.  What you really want is to have a button with a Mechanical Action set to Latch When Released.  Put the terminal inside of it's value change event case.  The way latching buttons work is they reset when the terminal is read.  So by putting the terminal inside of the event case, the terminal will be read and therefore reset.  So you won't have to worry about if the button is true or false.  You just care that it was pressed and it will be reset when the event case is ran.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(3,185 Views)

Fantastic -- I'm backed out of LabVIEW at the moment to work on the system's RAID, but will play with this once I finish! Looks like the Latch When Released action is the cleanest technique for this demo, but the case structure technique may come in handy in the future.

0 Kudos
Message 6 of 6
(3,175 Views)