LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Wait Until Done Requires an Additional Clock Cycle to Complete... HOW?

Quick question...

 

I found this article "DAQmx Wait Until Done Requires an Additional Clock Cycle to Complete" which describes my problem perfectly.  The solution offered is:  "The DAQmx Wait Until Done VI requires a single clock pulse in order to execute. If you are performing a finite acquisition/generation and plan to use an external clock with the DAQmx Wait Until Done VI, you will need to provide one additional sample clock pulse beyond the number of samples for the acquisition/generation operation". 

 

My question is, how the heck do you do that?

 

The attached VI works, but will skip the first data set, record the next, skip the next, etc.  I have to guess it's because the next trigger gives it that 1 clock cycle required.

 

How can I include one extra clock cycle to satisfy the "Wait Until Done" funciton, so this will record every set of data?  This is where the hang up is -- I watch it in highlight execution...

 

Muchos Gracias!

0 Kudos
Message 1 of 8
(3,756 Views)

So, maybe it's not the "Wait Until Done" VI.  I found an old post where an NI rep suggested using an "Is Task Complete" inside a while loop with the True condition stopping the loop. 

 

I tried this and it STILL skips every other cycle. 

 

What are the conditions for task to be complete?  The required number of samples are gathered, right?  There's 15 seconds between triggers, so PLENTY of time to gather 6 seconds worth of data, clear the task, and re-initialize the task, right?

 

What's the hold up? 

 

Is there any visibility into the task to see if if recognizing the triggers, how many samples are collected, etc.?  I looked through the DAQmx property nodes, but didn't see anything useful.

 

Hmmm...  This needs to be more intuitive...

0 Kudos
Message 2 of 8
(3,719 Views)

I must have something wrong in my 2015 installation -- when I open the Block Diagram of your VI and try to look at the False case of your upper loop, my LabVIEW locks up (and I can't see the False case).  The lower loop is strange -- it looks like a State Machine with numbers instead of named States, but I don't see it's purpose.

 

What are you really trying to do?  I've never had to use the Wait Until Done function, but then I'm probably not trying to do what you are trying to do.  Are you taking data continually (i.e. "take data at 10 Hz until I say to stop"), taking bursts of data periodically ("Take 10 samples at 10 Hz every 10 seconds"), or what?

 

Meanwhile, I'll see if I can open another DAQmx program to check my LabVIEW installation ...

 

Bob Schor

0 Kudos
Message 3 of 8
(3,711 Views)

Yes, I understand the State Machine is funky.  Not sure what happened there, but for some reason when I wired the enum constant directly to the case selector, the names show up, but when I wire it through the shift register, it changes them to integer.

 

The lower loop is under construction, so don't pay much attention to that...

 

I think I figured it out, though!!

 

All my fault.  I had the reference trigger set too high -- there were not enough samples available between triggers, so the Wait Until Done was doing it's job -- waiting for the 5000 pre-reference trigger samples I asked for.

 

I realized this by taking out the reference trigger.  Recorded every weld.  Then I put it back at 500 samples -- works every time. 

 

Stupid mistake.  I'm sorry.

 

I'm still curious about the original question -- how to add a sample clock cycle, but the urgency is gone.

0 Kudos
Message 4 of 8
(3,705 Views)

Might as well throw in the program.

 

Thanks to everyone for reading.  Sorry for freaking out -- my inexperience is stressful.  Getting there slowly, however.

0 Kudos
Message 5 of 8
(3,701 Views)

I'll post the false case so you can see what I mean, in case it's my code that's corrupted and preventing you from viewing...

0 Kudos
Message 6 of 8
(3,692 Views)

Dear Bob_Schor

 

To answer your other questions:

 

Trying to collect a snapshot of weld process data (about 5 seconds worth) and save to a unique file name. 

 

Machine cycles ever 15 seconds or so, but sometims it could sit idle for an hour.

 

Lower loop is the user interface.  Opens the last file (or any file selected) and scales the data, does some analysis, and displays it.

 

Back on track now, but I'll post the finished product when it's done.

 

Thanks for your interest!

0 Kudos
Message 7 of 8
(3,685 Views)

Thanks, and glad you found your own problem!  As to why I couldn't open your VI fully, I might not have installed the Device Drivers for 2015 (I've got 2014 already installed).  So I did that, they installed, but I still "hang" on opening your Block Diagram.  When I open the VI, it opens the Front Panel just fine.  Switching to Block Diagram, I get the "Windows 7 Wait Wheel" turning for 2 seconds or so.  If I then click on the "Show me the False Case" triangle, the Wait flag comes back on and doesn't go away (for at least a minute).

 

Oops -- I wrote this while opening your VI.  After I wrote the last paragraph, I went back to the VI and --- the False case is now open!  I can now switch back and for with no trouble.  Weird.  I'm going to close your VI, stop LabVIEW, and repeat this process -- I predict that it will now open just fine, no delays ...  [I'm about to try this ...]

 

Well, wrong again -- still have the Wait when trying to view the False case, but it does eventually appear (about 1-2 minutes later).

 

Bob Schor

0 Kudos
Message 8 of 8
(3,668 Views)