03-23-2010 02:05 PM
Attached is a VI that attempts to drive a timed loop with a NI 6608 card pulse train. My timed loop never appears to run more than one cycle. No errors are reported. I suspect it is because I am not setting up correctly with NI-DAQ. Any help would be most appreciated.
WB
Solved! Go to Solution.
03-24-2010 07:40 AM
03-25-2010 04:42 PM
03-25-2010 04:48 PM
Your loop doesn't "tick once and hang" it loops forever. You have a false constant wired to "stop if true" thus it'll run forever. You wont get any error out since you wire it to ... nothing.
03-25-2010 04:57 PM
Perhaps I do not understand the timed loop. I wire false to the stop icon to allow the loop to tick again on the next timed loop source tick. To wire true to the stop icon, would stop the loop after the first tick. Is this not how the timed loop works?
Thanks for looking at this.
WB
03-26-2010 03:51 AM
Yes, wiring false will allow the loop to continue to run. Forever. 🙂
Use the Highlight execution (the light bulb in toolbar) to see how your program works, i'm pretty sure it'll get to the loop and stay there. You can also remember the values in wires (the bulb beside it) to see what's really being sent. Since you dont feed the output node the error it'll just "vanish".
(I looked at the vi at home yesterday) If memory serves the loop itself did absolutely nothing, just wait.
/Y
03-26-2010 09:15 AM
I have confirmed the failure using the debugger on many occasions. The timed loop "i" counter never rises above zero. The error line never shows an error. The loop ticks once (setting "i" to zero and the error to "no error") and suspends. Any code following the timed loop (not shown in the attachment), does not execute.
I believe the problem is a misunderstanding about NI-DAQ counters and generating signals. The first signal gets through, after the requested 1 second delay, and all others are suppressed.
WB
03-26-2010 12:06 PM
Hi WB,
Would it be possible to post a screenshot with highlight execution enabled, showing the loop state in the block diagram?
Have you also verified that the Timed Loop inherently invokes the DAQmx Task by directly measuring the counter output?
Though the documentation explicitly states that the Timed structure will enable the task, the behavior you describe seems to indicate that the timed structure is waiting on an active clock signal. The event case behaves as expected by virtue of the DAQmx Task beginning.
Also, could you also post your version of LabVIEW, and the hardware used for this application; such that, we may do additional testing if necessary?
Thanks,
Patrick Corcoran
Application Engineering Specialist | Control
National Instruments
03-26-2010 12:29 PM
I am running LabVIEW 2009 SP1 with the LabVIEW RT module (SP1). I am running DAQmx 9.0.2. I am using a PXI 1042Q chassis with a NI 6608 card installed in slot 2.
Thus far I have not been able to read the counter output using either the event structure or the timed loop. I agree with you that the timed loop appears to be waiting on an active clock signal. Please note the timed loop does execute once (confirmed with the debugger).
Execution highlight is attached.
Thanks.
03-26-2010 01:54 PM
Hi Wb,
Taking a closer look at the Timed Loop, I can see that the period dt value is set to 1000. This period is scaled based on the units of the timing source. In this case, the clock contains 0.5 second pulses. Altering the dt to a value of 2 allowed me to see the timed structure iterate as expected. See the image below for further detail:
Hope this helps. Let me know if this does not behave that same way on your system.
Cheers!
Patrick Corcoran
Application Engineering Specialist | Control
National Instruments