12-10-2013 02:46 PM
When running a LabVIEW program, periodically the program is stopped in the middle and the Clear Task function was not able to execute. Of course when the next LabVIEW program is run, I get an error. Is there a way to clear all tasks on a DAQ or CAN in the beginning of a LabVIEW program in order to make sure that the program you are running doesn't run into an issue since the previous task wasn't cleared properly? I was hoping for a simple drop into my program. Any help would be appreciated!
Solved! Go to Solution.
12-10-2013 03:01 PM
The best practice is to make sure all task are cleared properly when a program exits. Don't ever stop a program with the abort button on the tool bar as that will gaurantee that you will have tasks left in limbo. Make sure you use a stop button on the front panel so you can close all tasks properly. Other than that, can you give a specific example of what kind of tasks you're trying to clear?
12-10-2013 03:12 PM
You should be able to issue device resets. This will abort any running tasks and establish a known state.
12-10-2013 03:13 PM
If all the users would use the stop button, my life would be easy 🙂 The most common is using the DAQ to read a voltage, for example, in my attachment I am reading a voltage from a PCB. I was just hoping there was a way to ensure the next program runs when another user messes it up.
12-10-2013 03:16 PM
//You should be able to issue device resets. This will abort any running tasks and establish a known state.//
How do I do this?
12-10-2013 03:23 PM
Its buried on the DAQmx palattes under "Dev Config"
12-10-2013 03:30 PM
@ncm wrote:
If all the users would use the stop button, my life would be easy 🙂 The most common is using the DAQ to read a voltage, for example, in my attachment I am reading a voltage from a PCB. I was just hoping there was a way to ensure the next program runs when another user messes it up.
Users should have no way to exit except the stop button or the window close button. You can handle the window close event so things actually get cleaned up and the window doesn't close. The abort button should not be visible to users.
12-10-2013 03:42 PM
@kbbersch wrote:
@ncm wrote:
If all the users would use the stop button, my life would be easy 🙂 The most common is using the DAQ to read a voltage, for example, in my attachment I am reading a voltage from a PCB. I was just hoping there was a way to ensure the next program runs when another user messes it up.
Users should have no way to exit except the stop button or the window close button. You can handle the window close event so things actually get cleaned up and the window doesn't close. The abort button should not be visible to users.
Agree 100%. The application should not allow the user to exit in a manner that will leave things in an unknown state.
12-10-2013 03:51 PM
Sounds like yet another case of "Everythings fine as long as the users don't use it."
Managing users in a lab enviornment can get really fun. Good luck.
12-10-2013 05:27 PM
I've spent most of my career managing users in a lab environment. That's WHY I never let a user exit in an uncontrolled manner.