LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview freezes, and stops responding each 10th run or so?

We have a fairly complicated labview program that most of the time runs normally, but once every 5th to 10th restart or so the program freezes so much that it cannot be stopped even by pressing the red stop button "abort execution", I have to use ctrl-alt-del to shut down the program. I heard something like this can occur if you have loops without time delay, so I included such in all loops.

The program is a forever loop of a stacked sequence 1-5, and the last thing that happens in one run is a button that finishes a loop in the 5th sequence. When I press this button is stays in the "on" position, and everything is stuck.
 
We run labview 8.2 on winXP, and the program is not compiled, but run in the development system.
 
Any ideas? Why does it only happen sometimes?
 
Ola
0 Kudos
Message 1 of 11
(3,492 Views)
Go ahead and attach it and we can take a look at it.
0 Kudos
Message 2 of 11
(3,475 Views)

Ah, this meets some problems... since is important code for us I cannot send it as it is. If I find time I can take away some parts and then sent it to the forums for comments.

I thought that maybe the problem that the whole labview program gets stuck is a common problem, with at general solution.

 

Ola

0 Kudos
Message 3 of 11
(3,454 Views)

Sorry Ola but LabVIEW getting stuck is not a common problem to LabVIEW but it is common for people just starting out in LV. Just as a suggestion use a statemachine type of coding style instead of a sequence structure they are much more robust and more easily upgradeable, you can also just put it in a while loop and link the error in and error out clustes together and then you code will run sequentially also. If you think it is the button that is giving you problems try changing the mechanical action. We cannot help you much more without some more info. What version of LV are you using?

Please post a simplified version of your code.  




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 11
(3,445 Views)

"I thought that maybe the problem that the whole labview program gets stuck is a common problem, with at general solution."

There is a general technque for dealing with this kind of problem.

The "tools" palette has stopsign and "p" in a yellow circle that you can use to set breakpoints and look at values during execution.  They can be used to figure out which frame you're hanging up in, and then where within the frame, and then why.

0 Kudos
Message 5 of 11
(3,427 Views)
Joe, how would I program state-machine like in labview? If I understand correctly, I have a number of states like 1=init, 2. read data from user, 3. write to db, 4. close db and at relevant times change the state like (if enterdDataOK then state=3 else state=2) etc.
 
My idea to realise this is to have a state variable, and  a case structure that takes care of each state. It is then easy to change freely between the states, not only in sequence.
The case structure lies in a loop to make it run.
 
Am I on the right track here?
 
Ola
0 Kudos
Message 6 of 11
(3,400 Views)
yes you are and there are many examples of a state machines on the forum. Many people like to use just strings to go into the case structure but I myself love to use type def enums that way when you want to add a case al you have to do is update the enum and it will update everything. Have a look at the examples on the forum and in the example finder to find some examples of state machines. 



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 7 of 11
(3,392 Views)
Here is one I just threw together. It is not neat and clean just a quick and dirty to show the basics. have a look and if you have any questions let me know



Joe.
"NOTHING IS EVER EASY"
Message 8 of 11
(3,385 Views)
Thanks for the example code, its just what I needed!
 
It is also interesting to see that during the run of this example the program cannot be stopped, and I cannot change the button state. Is there an easy way to make the example more receptive? Not to criticise your code, just that I want to learn more about how to not freeze labview!
0 Kudos
Message 9 of 11
(3,373 Views)

As I said it is just a rough example are you saying that you want to be able to stop it at anytime?

once you get the state machine set up you can make it run however you want. You can break out of any state. In the example I used for loops and you cannot get out of these until they are complete. But in yours you can use while loops with some conditions to break out of them. Do a search on the forums for more on the statemachine type.

Message Edited by Jhoskins on 11-13-2006 11:26 AM




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 10 of 11
(3,362 Views)