Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Why can not stop program (USB 6251, Labview8.5)

Solved!
Go to solution

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

Message Edited by nguyenmanhcuong on 05-27-2009 01:46 PM
0 Kudos
Message 1 of 5
(3,333 Views)

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?

Message Edited by Jason_D on 05-28-2009 10:08 AM
Sincerely,
Jason Daming
Applications Engineer
National Instruments
http://www.ni.com/support
Message 2 of 5
(3,310 Views)
Thank
Download All
0 Kudos
Message 3 of 5
(3,285 Views)

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

0 Kudos
Message 4 of 5
(3,273 Views)
Solution
Accepted by topic author nguyenmanhcuong

nguyenman,

 

As this KnowledgeBase Article indicates you must have your top task configured for Continuous Samples else you will overrun your buffer.

Sincerely,
Jason Daming
Applications Engineer
National Instruments
http://www.ni.com/support
Message 5 of 5
(3,247 Views)