Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx digital trigger hangs on second call

I am having difficulty with the attached vi that I have named bugcheck.vi. When I run this it in the triggered mode it exicutes the Data aquisition.vi one time and then hangs up. I get an error indicating an unnamed task.

If I run the Gen Divide by n Pulse Train-Continuous.vi and the Data aquisition.vi as to seperate vi's they will function correctly. It is only when I combine them into the same vi as I have in bug check.vi do I get the error.

I am inputing a 480Hz pulse train into the ctr0 source. The ctr0 is set up to be a divide by 4 giving me a 120Hz trigger signal that I connect to PFI0 as a trigger for my Data Aquisition.vi.

Why won't these function when combined into a single vi?

Thanks,

John Freeman
0 Kudos
Message 1 of 4
(2,966 Views)
Hey John-

Can you please post your code? And to be clear, this works when you run it in separate VIs, but returns errors when you combine it into one?

gus....
0 Kudos
Message 2 of 4
(2,953 Views)
Gus,

In the original post I attached my llb as part of the post. That is the only way I can see on this Forum to include example code. Sorry if I an missing something. I have attached the code to this reply. Let me know if it can be opened.
0 Kudos
Message 3 of 4
(2,938 Views)
Hey John-

I guess the attachment didn't get uploaded correctly the first time. It opened just fine on your second post though. It looks like the problem with your code is that "Acq DAQ Trig Or Not Trig Rev2.vi" is only creating the task the first time you run the VI, but deletes it at the end. I didn't have a chance to try changing it, but I would suspect that if you changed the program flow so it would explicitly stop the AI task and only clear the task in the highest level VI (BUGCHECK.vi). Let me know if this isn't clear.

I hope this helps!
gus....
0 Kudos
Message 4 of 4
(2,935 Views)