05-27-2009 01:42 PM - edited 05-27-2009 01:46 PM
Hi all
My task is: 3 Analog inputs
01 Analog output
01 or 02 ouputs using counter, which continuously out put train of pulses.
I don't understand why I couldn't stop my program (can not stop while loop) by pressing knob "stop". Program only stops when knob on the task bar of Labview is pressed or after error occurs(see picture please).
[IMG]http://i221.photobucket.com/albums/dd262/russian24h/errormessage.jpg[/IMG]
What do I have to do now?
Thank so much!
MC
Solved! Go to Solution.
05-28-2009 10:04 AM - edited 05-28-2009 10:08 AM
nguyenman,
I have a wide variety of suggestions for your code. Most of them can be summed up by looking at any of our example programs and following the good programming practice shown there.
1) Create, Setup and Clear both the tasks and the channels outside of the while loop. Each of these are things that only need to be done once instead you are introducing a lot of extra overhead and complexity by restarting everything each time.
2) Combine your errors so that you don't have to monitor 2 different lines and 3 is easier.
3) Route the Error? line of your error cluster to a or symbol that also recieves input from the stop button. So either an error or the button being pressed will stop the loop.
These suggestions combined with looking at this document that discusses the difference between the Wait Until Done and Is task done? I believe you want to use Is task done?
05-29-2009 03:57 AM
05-29-2009 04:15 AM
HI Jason_D
Thank for your very useful advices.
I did as you said, it's seem better but other error occurs as I attached previous massage.
Do I have wrong ideal?
Thank again
MC
06-01-2009 10:05 AM
nguyenman,
As this KnowledgeBase Article indicates you must have your top task configured for Continuous Samples else you will overrun your buffer.