aah31 Posted June 11, 2010 Report Share Posted June 11, 2010 All, Is there a way in LabVIEW 2009 to have a VI call itself while it is running, and start over? Thanks, Anthony Quote Link to comment
asbo Posted June 11, 2010 Report Share Posted June 11, 2010 Can you clarify what you mean by 'start over'? Quote Link to comment
Ton Plomp Posted June 11, 2010 Report Share Posted June 11, 2010 If you mean by recursive that a function calls itself, you can set a VI to be 'reentrant'(vi properties->execution), now you can drop a VI on it's own block diagram. Ton Quote Link to comment
aah31 Posted June 11, 2010 Author Report Share Posted June 11, 2010 Say perhaps I have a device that errors out and I want to start the main VI over to re-initialized devices, can this happen during the middle of the main VI? Quote Link to comment
Ton Plomp Posted June 11, 2010 Report Share Posted June 11, 2010 (edited) Say perhaps I have a device that errors out and I want to start the main VI over to re-initialized devices, can this happen during the middle of the main VI? Ah, that has nothing to do with recursive-ness. You shcould use a state machine that starts a 're-init' state upon certain errors. Ton Edited June 11, 2010 by Ton Plomp Quote Link to comment
TG Posted July 7, 2010 Report Share Posted July 7, 2010 Say perhaps I have a device that errors out and I want to start the main VI over to re-initialized devices, can this happen during the middle of the main VI? Yes it can Using a state machine with exception handling built in would solve your problem though there would be some time in learning how to make one (or get one) and then learning how to use it. Quote Link to comment
Wire Warrior Posted July 7, 2010 Report Share Posted July 7, 2010 If you want to check out a really versatile state machine design, look at the JKI state machine template found at http://www.jkisoft.com/state-machine/. I really like this template and there are videos, tutorials, and examples that explain its operation. Jason Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.