Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB X User Event using the Analog Input Trigger

Solved!
Go to solution

Hello everyone,

 

I am the proud owner of a USB X Series 6356 Multifunction DAQ.  I purchased this device so that I can use the analog input trigger to acquire a signal of high data rate for about a second.

 

The signal I am trying to catch is infrequent and fast.  So I have to use a timeout of -1 in the example software to have the desired result with little to no latency between an acquisition and re-arm.

 

I was thinking, boy it sure would be nice if I could have a user event to trigger my LabVIEW code that I have data ready to be collected and processed.

 

I have looked through many examples, and have tried many scenarios of registering events to no success.  Is there a simple way to have an event execute on an analog trigger?

 

I have attached a sample with the disabled code is what I desire.  Do I have to do something funky with internal routings?

 

Thanks!

0 Kudos
Message 1 of 6
(3,472 Views)

JoeC,

 

I've made a few modifications to your VI that I think will get you on your way.  I only use 1 channel as I don't have a simultaneous sampling device at my disposal at the moment.  However, the number of channels used really shouldn't matter.  The big issue you had is that you were not starting the task outside of of the event structure.  As such, hardware never started the acquisition and as a result you never got an event.  I also used the done event to trigger my read.  When doing a reference trigger, your device will constantly be transferring data to the host.  I wanted to make sure that you weren't getting an event until valid samples have been acquired.

 

Hope that helps,
Dan

0 Kudos
Message 2 of 6
(3,456 Views)

Thanks, I will give it a shot.

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

I tried it, an event does trigger, but then the event loop just keeps running.  I am thinking a trouble ticket may be in order, after all it is a new device.

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

Joe,

 

What is your desired behavior?  I assumed you wanted the event loop to continue to run in order to capture subsequent trigger conditions.  If this is not desired, you can change the 'false' constant wired from the 'Done' event case to a 'true' constant, and your loop will stop.

 

Dan

0 Kudos
Message 5 of 6
(3,437 Views)
Solution
Accepted by topic author JoeC

I gave up on the event structure, but was a very useful exercise.

 

What I ended up doing was setting the timeout to -1, and the VI sits nicely until a trigger occurs.  The problem with this is how to get out of this condition to exit the software.  I eventually just used the DAQmx Control Task to abort the "-1"/wait forever for a trigger state.

 

Polling just seems so primitive...Smiley Wink

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