05-19-2010 11:15 AM
05-19-2010 12:09 PM
Once you go down the path of the dark side (sequence structure), forever will it change your destiny. Please use a state machine. I have attached a template for you to get started. Anything you wanted to put in sequence locals should go into the Local Variables cluster. Just copy your code from each frame and place it into a case in the case structure. Easy to do, won't take long, and you will be very thankful the first time you need to modify your code. Don't say it will never need mods. we have all said that at one time or another, and we have all been wrong.
05-19-2010 02:12 PM
05-19-2010 02:32 PM
"Once you go down the path of the dark side (sequence structure), forever will it change your destiny." by Tbob
Thats just awesome Tbob, haha
May the force be with you,
Christian
05-19-2010 02:34 PM
05-19-2010 04:40 PM
Christian_M wrote:"Once you go down the path of the dark side (sequence structure), forever will it change your destiny." by Tbob
Thats just awesome Tbob, haha
May the force be with you,
Christian
I thought the dark side was local variables. No, wait, it's global variables. No, wait, it's Express VIs. No, wait, it's the GOTO statement. No, wait, it's actually the NI boards (at least according to LAVA).
The dark side is so much more fun.
05-19-2010 05:06 PM
05-20-2010 02:19 AM
@smercurio_fc: The dark side of the force is a path way to many abilities (locals, globals, ....forums) some consider to be unnatural (The Emporer in Episode III)
Christian
05-20-2010 06:44 AM
@all:
Ok, I will modify my VI and replace the huge stacked sequence with a state machine, although my current VI works quite well and although I have no problem with hundreds of local variables.
I will probably understand you better, as soon as I have some experience with state machines.
Thanks for your help!
05-20-2010 07:16 AM
johanneshoer wrote:
although I have no problem with hundreds of local variables.
You think you have no problem with hundreds of Local variables..
Bouahhh aahhh ahhhh ahhhh aahhhhhhhh... 😄
If you have more than 1 Local Variable, you may be sufferring from Localitis. Hundreds?? You are either brave or nuts. Well... the or is probably more of an AND.. 😉
Locals have this way of biting you in the back of your pants when you least expect it. And debugging becomes a complete nightmare.
If you're going to fix the code, why fix half of it. Go all the way.. Get rid of Locals.