Showing results for 
Search instead for 
Did you mean: 

case structure calling out to another case

hi, i am fairly new to labview, i was wondering if there is such a command or ways to call out for a case while i am in another case?

i wanted to do something like my case "SearchNoConstants" to call for case "Program"
how can i do something where within "SearchNoConstants, I call out to go to case "Program"
i hope that my explanation is clear...
thanks in advance

Message Edited by krispiekream on 03-19-2008 12:37 PM
Best regards,
Download All
0 Kudos
Message 1 of 6
"i hope that my explanation is clear."

Not really. You cannot another case statement (or portions of it) while you're in another case. What are you trying to "call out"? It seems to me that if it's code that's meant to be used in more than one place, then it should be in a subVI.

Aside comments:
  • It's pointless to drive a case structure from a Boolean in order to output a Boolean. Just wire the Boolean directly!
  • Style guidelines strongly recommend that wires flow left to right. In your case you seem to have constants that are flowing right to left. It's not clear where this is going since you've only posted part of the code.
Message 2 of 6
i want to pass through this command..

Program Rev1=No Parm=Mode Mode=1 N_5kOpt=1 IegmGn=1 Spare=1 ;Program Rev1=No Parm=PressA Offset=0 Gain=7 ;SetIegm Waveform=Sin Freq=10.0 Ampl=4.0 Cycles=5;

how would i do this in my SearchNoConstants case...
i have two vi that i work with and I have no idea how to do it..

Message Edited by krispiekream on 03-19-2008 12:58 PM
Best regards,
Download All
0 Kudos
Message 3 of 6
Well, since I have no idea what your program is supposed to do, and I forgot to take my mind-reading drug this morning, I'm just going to have to take a wild guess...

I'm guessing that the big long string you provided is supposed to into that VI called "Parser". Unfortunately, the way you've coded it the only way that can happen is that you have to get out of that inner loop, since the case that is executed inside the sequence frame that's inside the while loop will always be the same once the loop starts. It's not shown how the while loop stops. Is it supposed to run continuously? My guess is probably not, based on the 2 wires coming out of that "Get Next Value" VI. If you need to change the case item that gets execute you need a state machine in your while loop. You would need to replace the tunnels on the left boundary of the while loop with shift registers so you can change the program "on the fly". I would suggest taking a walk though the NI KnowledgeBase and reading up on state machines.

Of course, that's just a guess. Smiley Wink

Oh, and you've got another one of those pointless "use a Boolean to drive a case structure to output a Boolean" instances in the new screenshot you provided.
Message 4 of 6
Instead of using sequence structures, it might be worth your time to check out State Machines. They let you go from one step to the next in a much better fashion because you can skip a step if you need to, say, parse out a command.
Message 5 of 6
thank you for everyone help..
i figured out for this case.

Best regards,
0 Kudos
Message 6 of 6