LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx "Done" event not triggering event structure

I would like the user to be able to abort my daqmx task by pressing a button.

 

I am attempting to use the method in this VI:

https://decibel.ni.com/content/docs/DOC-15815

 

It utilizes an event structure with the daqmx Control Task VI to abort.

 

The example VI above works for me, on my system with my USB-6356 device, as expected.

 

When I attempt to incorporate the same method into my VI it does not--despite having an identical arrangement, so far as I can tell.

 

I believe that my problem lies with the event structure, and the dynamic registration.  I am unfamiliar with this and must be using it incorrectly.

 

I have attached my VI, though it is cumbersome.  The code which I am struggling with is in the "Acquire" case.  As far as I can tell, I am doing exactly the same this in this particular case as in the example mentioned.  Yet in the example, the event structure completes, or aborts, whatever you want to call it, right after the "Wait Until Done" VI executes.  In my own VI, the "Wait Until Done" and "Clear Task" VIs execute, but the event structure does not register it.

 

Here are my specific questions: is there anything extra or special that one must do in order for the Task to properly trigger a "Done" event and pass through the event structure?  At what point is the daqmx task "Done"? 

 

thanks,

Matt

 

0 Kudos
Message 1 of 6
(2,686 Views)

I notice two things quickly.

 

First, the example shows the code to abort the task taking place inside the event related to the Done.  In your code, that event is empty while all the code takes place in the Abort Button value change event.  Why did you make this change to their software?

 

Additionally, I found two Event Structures in the cases I looked at briefly.  You want to avoid having multiple event structures.  The original example certainly didn't do this.

0 Kudos
Message 2 of 6
(2,675 Views)

Many USB DAQs dont support all (if any) daq events, double check how yours work.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 6
(2,639 Views)

natasftw,

My event structure is identical to theirs; what you are seeing are the two different cases that exist in the event structure.  In both the example and the VI, there is a <task out>: Done and a "Dynamic Event": Value Change.  In the dynamic event case, I have my abort button and relevant code--this I believe is the code you were referring to, which you thought I was missing...  Regarding my multiple event structures, they should operate completely independently as they respond to different events.

0 Kudos
Message 4 of 6
(2,612 Views)

Yamaeda,

That might have been the answer, except that the example case works properly with the USB DAQ that I am using (which is a USB-636). thanks for the idea though

0 Kudos
Message 5 of 6
(2,610 Views)

Okay I figured it out: the event must be registered before the task is started.

 

When I connected the error stream to the event registration, the error popped up and explained it to me (I should have had my error stream connected through it in the first place).

 

I do appreciate the help everyone, thank you.

 

Matt

0 Kudos
Message 6 of 6
(2,594 Views)