LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use one interface with a case structure?

I need to put a case structure over my existing code, but when I do it I have to put almost the exact same code in the false part of the statement and it makes it have the same interface twice on the front panel. I am using Labview 8.5.Thanks
0 Kudos
Message 1 of 8
(2,518 Views)
Drop your case structure over everything except the controls & indicators, wiring them in/out, and only duplicate the code in each case.
Message Edited by jcarmody on 05-20-2009 10:35 AM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 8
(2,516 Views)
My original post wasnt that clear. I am going to have a case structure over a for loop over another case structure. Inside the second case structure is the code with some of the interface. The for loop is going to be iterating the code to set most of the instrument to a default setting. So I need a case structure to turn off the for loop. The only thing wrong with putting most of the interface items outside of the case structure is that the indicators are changed to arrays because of the indexing of the for loop. I cant seem to get around that if I have my items outside, but if I have everything inside of the for loop my interface doesnt have to change.
0 Kudos
Message 3 of 8
(2,509 Views)

Kazkek wrote: 

[...] the indicators are changed to arrays because of the indexing of the for loop. I cant seem to get around that [...]


You get around that by right-clicking on the output tunnel and selecting "Disable Indexing".

 

Perhaps you could post your code?  There may be a better solution.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 8
(2,497 Views)

disabling that may work

 

here is my code

 

Basically as it is now the for loop would go around what there is and then the case structure around that to have it like an on/off switch.

0 Kudos
Message 5 of 8
(2,489 Views)
Oh and also the for loop would be changing the channels of the scanner to set the default values.
0 Kudos
Message 6 of 8
(2,487 Views)
I added the structures, but I think I don't understand your goal.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 8
(2,463 Views)

also you may want to put a while loop around every thing as it will be a driver for your application.

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 8 of 8
(2,443 Views)