Case Structure - multiple selectors, single exit

I tried searching for an anwser to my question but I could not find one.
I'm creating an interface for my graduation project (using LabVIEW 7.1) and I will be using several subpanel's, at this point I'm trying to create a selection method. During the design of the interface the users gave preference to buttons for switching between the different subpanels (there is a total of 4 buttons). And a subpanel is chosen based on a numeric value (I have taken the code from the viewer.vi example).
Now I'm trying to work out some sort of case structure starting from the 4 buttons and resulting in a single numeric value. The idea being that when button 1 is pressed, subpanel 1 is active and every other panel is not. So far I haven't found a working one, especially because of the single numeric value I want to have.
If the anwser is somewhere on this board then you have my apologies and I would appreciate a link to it.
If something is not clear: feel free to ask questions.

That's why a radio button control is better. It automatically allows only one button to be active. Clicking a new one will turn the others off.
Try it! Just place any number of booleans (any style) inside the radio button control. The output will be a single number. If you wire it to a case structure, you'll get the control label for each as case name.
(you can also allow or disallow "no selection", etc.)
LabVIEW Champion . Do more with less code and in less time .
Attachments:
RadioButtons.vi ‏10 KB

Similar Messages

  • Broken Arrow with Case Structure Input Selector

    Generally We get a broken arrow when a case structure 
    is wired incorrectly to its case selector .
    I found that even after this is fixed, the arrow remains broken.
    however when you click on the broken arrow, the VI 
    starts to execute instead of highlighting the error.
    Seems like a compiler Issue.
    I want to know if anyone has faced this issue.
    I am currently using LV 8.6
    Regards,
    Sundar.

    SUNDAR.N wrote:
    Generally We get a broken arrow when a case structure 
    is wired incorrectly to its case selector .
    I found that even after this is fixed, the arrow remains broken.
    however when you click on the broken arrow, the VI 
    starts to execute instead of highlighting the error.
    Seems like a compiler Issue.
    I want to know if anyone has faced this issue.
    I am currently using LV 8.6
    Regards,
    Sundar.
    I can confirm that. I HAve seen it with type defs as well as LVOOP classes.
    I have never been able to reproduce it on demand but it always seesm to be associated with situations where a type or class definition was changed. I think I have seen this issue on and off from LV 8.2 thru LV 8.6.
    Ben
    Message Edited by Ben on 07-31-2009 06:59 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Regular expression in case structure

    Hi there you LabVIEW grooves!
    I think it would be quite pleasant if a real RegExp could be written directly inside case structure's selectors, when using a string input.
    For me that would save a great deal of coding, increase my code readability significantly, and in general - will finally encourage me to implement what I really intended in the first place rather than settling with what I can write in a reasonable time.
    This can be extremely useful for decisions based on free-written input user data.
    Hope to get a lobby on this one - maybe we can influence the next version!!!

    The right place would be to submit your request to the product suggestion center:
    http://digital.ni.com/public.nsf/allkb/EDA7C01C684ACB6286256FF0000238D5
    Good luck!
    LabVIEW Champion . Do more with less code and in less time .

  • How can I have multiple inputs into the selector terminal of a case structure

    Hi everyone
    I have a question on how to wire multiple inputs in to the selector terminal of a case structure. 
    Currently, I have three switches, each switch determines different case. So if I switch the switch 1 is on, the numeric indicator will show 1. If the switch 2 is on, the numeric indicator will show 2, so on and so forth. However, the selector terminal will not allow me to wire multiply inputs into the case structure, I tried Bundle by Name, Bundle and Array to Cluster, but they did not work. I set the case structure with 3 cases, they are 1, 2 and 3.
    Could someone help me please. I have attach an image and the VI of the work I did so far.
    I have another question, is there a function which can toggle other switches to off when there is a switch has been toggled on.
    Thank you very much
    Tommy
    Attachments:
    Trial - Case Structure.vi ‏7 KB

    Tommy, attached find a cheeseball way of doing this that has given me a LOT of mileage over the years.  IT lends itself nicely to a couple of really good practices that NI recommend, but I have given you the bare-bones to "see under the hood".  
    The recommended practices:
    1. You can make this a nice tight sub-vi where you can put it into a core library of routines that you'll use over the years, even extending the logic to look only for changes, etc.
    2.  If you are thinking about Front Panel design considerations, you'll want to use arrays of controls where possible, as that's a nice neat way of containerizing your switch for both the FP and Block Diagram.
    Have fun.  I have TONS of these types of things, so feel free to PM me if you have any other needs.
    Wes
    Wes Ramm, Cyth UK
    CLD, CPLI
    Attachments:
    Boolean Switch Logic.vi ‏11 KB

  • Why does Labview insert quotations in the case structure selector box?

    I was building a case structure with an array of strings.  So, I copied the strings from the array on the FRONT PANEL directly into the SELECTOR LABEL.  My 3 strings have the form; to me, these are 5- character strings with spaces, or 7 characters if you count the spaces as string characters 
    A, B, C   
    A, B, D
    A, B, E
    So, when I copied and pasted them directly into the selector box A, B, C appeared as "A", "B", "C" and A, B, D appeared as "A", "B", "C" and then I got an error for selector values not unique.  Why didn't it appear as "A, B, C"?
    Why did it transform the string I pasted and insert the quotation marks?  I used no quotation marks in my array.  Does the selector label interpret commas as functional characters that require quotation marks??
    Thanks,
    Dave 

    dav2010 wrote:
    I was building a case structure with an array of strings.  So, I copied the strings from the array on the FRONT PANEL directly into the SELECTOR LABEL.  My 3 strings have the form; to me, these are 5- character strings with spaces, or 7 characters if you count the spaces as string characters 
    A, B, C   
    A, B, D
    A, B, E
    So, when I copied and pasted them directly into the selector box A, B, C appeared as "A", "B", "C" and A, B, D appeared as "A", "B", "C" and then I got an error for selector values not unique.  Why didn't it appear as "A, B, C"?
    Why did it transform the string I pasted and insert the quotation marks?  I used no quotation marks in my array.  Does the selector label interpret commas as functional characters that require quotation marks??
    Thanks,
    Dave 
    Actually in CASE STRUCTURE, any frame can have multiple values as 'Case Selector value' and these are separated by a comma. Also if you choose to operate a CASE STRUCTURE using string, it will automatically prefixs & suffixs quotes (") to that string.
    But you can enter  "A, B, C" manually and it will remain as it is. But if you copy and paste A, B, C, the CASE STRUCTURE will automatically change it to "A", "B", "C".
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • How to implement Case Structure for multiple inputs to Pic Ring?

    So I have a reasonably simple program which I am almost completeed with. Basically the data of an array is read and then is indexed and a new array is created from the indexed data. And then I use Match Pattern to see if elements in the new array match certain words. And if they do then a number value is allocated to a Pic Ring at the end. And depending on the final number value the Pic Ring changes from one pic to another.
    However, I have the problem that I will be using multiple Match Pattern functions to compare elements in the final array, but I can't attach multiple Match Patterns and their subsequent logic statements to a single Pic Ring, only one. I've been trying to work this out by implementing a Case Structure or Event Structure. But the Event Structure isn't working and with the Case Structure, it is very messy with multiple True/False Case Structures inside of each other. Anyway, hopefully this all makes some sense. I'm attaching the VI program to this post. Thanks.
    Attachments:
    ArrayTest2.vi ‏495 KB
    ArrayTest2.vi ‏495 KB

    Obviously, you can only display one picture.  So then the question becomes which picture to show.  Therefore, you will have to create some sort of preference of one pattern over another.
    I would use a FOR loop so that you can loop through your available patters and their possible results.  Use the Conditional Terminal on the FOR loop so that you can stop the loop on the first match.  Then you just wire up the selected value for the ring outside of the loop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do i output multiple arrays from a case structure to create one larger array

    I currently have a vi that has one hardware input that i needed to take a measurement then be moved and take a similar measurement at a different point.  To accomplish this i used a while loop inside a case structure.  The while loop takes the measurement  and finds the numbers i need while the case structure is changed per the new measurement location.  I want to take the data points i have created in each case and output them into a single table.  I assumed to do this the best way would be to get the data from each case into its own built array and build a larger array but I cant get the information out of the case structure so that it all inputs at different places.
    thanks for your help
    Attachments:
    Array.vi ‏30 KB

    Hi Ross,
    attached you will find a solution for your table building problem.
    I would suggest thinking about program design - having the same case content in several cases doesn't make sense. I also would not want my user to press several stop buttons depending on choosen measurement...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Array.vi ‏45 KB

  • Problem with multiple sub-panels through Enum case structure: "The VI is not in a state compatible with this operation"

    Hello,
    I am using LabVIEW 8.0 and I am attempting to create a sub-panel that displays the front panel of a sub-vi depending on the selection made by the user via the Enum dropdown menu.  I have wired the Enum to a case structure and applied identical coding to each individual case structure except for obviously changing the sub-vi source.  However, I receive an error "The VI is not in a state compatible with this operation."  I was able to successfully make a single sub-vi work within a sub-panel using a true/false case structure and the exact same coding.  However, now that I am using an Enum box wired to a case structure, I receive this error.  I have attached my block diagram as well.  Could anyone assist me as to where it is that I am going wrong?
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    enum subpanels.JPG ‏22 KB

    torm wrote:
    I have attached my block diagram as well
    I only see a picture. Can you attach the VI instead? At what point do you close the reference?
    torm wrote:
    I have wired the Enum to a case structure and applied identical coding to each individual case structure except for obviously changing the sub-vi source.
    Well, if the code is identical except for the source, only the source should be inside the case, right? Why duplicate code?
    LabVIEW Champion . Do more with less code and in less time .

  • Before the selector value reach a Case structure I need to stop it until a push button is pressed. How to do?

    Before the selector value reach a Case structure I need to stop it until a push button is pressed. How to do?

    altenbach wrote:
    UliB wrote:
    simply wire your selector value through a while loop. Stop the loop with your button. After the loop stops, the value will go on to the case structure.
    Hmmmm.....
    Hello altenbach,
    roflol .
    Thank you for the link to 'A Field Guide To LabVIEW Objects - Selfish Loop'. I'll keep that in mind, when answering other questions with while loops.
    Uli

  • Can a case structure execute multiple cases?

    So I have a VI set up with a mutiple option case structure to select which input a voltage is read from (there are 32 options). Now that I have it made, I realize that sometimes I may want to read from multiple inputs at once.. Is there an easy way to change my setup so that it executes multiple cases at a time? Right now my control is a slider to choose the case. What would be a good front panel control choice to be able to select multiple options? Thanks
    Solved!
    Go to Solution.

    You can build an array of your options and loop through the required cases. As mentioned, a case can only perform 1 case per loop.
    A good front panel control would be a cluster or an array of booleans (e.g. a tick box per option), easy to loop through.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Multiple boolean values to be used in case structure

    Hi,
    I am trying to implement a case structure with multiple boolean cases and am having trouble with that. What I want to do here is : I have a set of 5 values, each of them being "true" or "false". For each "true" value, I have a certain set of steps to be executed. The "false" of each can be ignored. Ideally, I would like to have a case structure for the 5 "true" cases. I am not sure how to go about wiring these boolean outputs to my case structure. Also am using LabView 6.1.
    Any ideas?
    Thanks,
    Sukanya
    Solved!
    Go to Solution.

    Additional comments regarding code:
    It is a mistake to configure the serial port inside the loop. This is a waste of time and resources. Configure outside, read in the loop, and close outside after the loop is done. The flushing of the buffer would be part of the "configure outside".
    The default values of the controls for the VISA Configure Serial Port VI are such that the termination character for reads is enabled, and the character is set to a linefeed. This means the VISA Read will read until it sees a linefeed or reaches the value wired to its byte count input. Thus, the VISA Bytes at Serial Port isn't really necessary.
    You should not rely on the settings in the LabVIEW option for automatic error handling. You should explicitly handle errors in your code. Thus, you probably want to stop the loop on an error and provide a dialog via the Simple Error Handler.

  • Case Structure to Obtain 1 Single Measurement

    Hi All -
    I'm using for DAQ Assistants to measure 4 different voltage signals.  I want to zero them with the click of a button so I am using a case structure and when I click an "OK" button it takes 1 single measurement from each of the 4 signals.  I then want to keep this value and use it in calculations elsewhere in my code.  Do you know how to store that one value and obtain it for use elsewhere?
    Thanks!

    You can store them in a feedback node or shift register.
    (Please show us your code so we can give more detailed advice.)
    LabVIEW Champion . Do more with less code and in less time .

  • Case structure with two selectors

    Hi all
    Once again I'm wondering...
    ...if it is possible to wire more than one value to a case structure. I'm just working on a project and came to a point where I have to nest case structures. I have two enums and depending on both enums I set a value.
    How would it be to have more selectors so that the following code extract could be "drawn" with just one case structure?
    enum X1 = {manual, auto}
    enum X2 = {red, green}
    if(X1 == manual && X2 == red)
    else if(X1 == auto && X2 == red)
    Maybe something useful for new LV versions, if it does not exist yet.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

    @David - Great solution. I might remember it one day .
    @Shane - You could have given me at least "en stutz" . Well, I see your point, but in every textual language exists this possibility. Although your argument is acceptable (the compound enum), I prefer to have enums without combinations. Ok, maybe the values would make some sense, but I like it better if they are separate. In addition, what should I do if one input is an enum and the other a boolean? And now don't say "use DavidCrawford's solution" .
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How do I delay 1 of many outputs exiting a case structure?

    I have a system here which is sort of a finite state machine, using digital I/O, I am monitoring a series of digital inputs which in turn form a binary number which is the input to a case structure. Depending on the binary string (number) that is read by the case structure, a particular series of boolean constants (T or F) exit through the case structure which are then used as my digital outputs (in my case they are controlling a series of relays). Basically, I have a condition where I would like one of the relays to be time delayed when switching in one direction, but not in the other. The problem is that when I do delay this bit, it also delays all of the bits coming from the case structure.
    i.e. all the relays are delayed. How can I delay just one of them?

    Well, I can't think of a really easy way. You could generate a delayed pulse on a counter output, instead of using a digital line. Otherwise you will need to keep track of the delay time in your loop somehow. The timing is only going to be as accurate (deterministic) as your loop rate, and will be operating system dependant. You may have some jitter. Attached is an example of a software delayed boolean indicator. Download both VIs.
    -Jim
    Attachments:
    delayed_relay.vi ‏30 KB
    boolean_trigger.vi ‏14 KB

  • Enter and exit a case structure

    I'm currently building a control.  I have a condition for three booleans to become true to enter a case structure as true.  One of the conditions is a temporary increase in temperature. I want to stay in the case structure after the temperature becomes false but both of the other booleans stay true. Is there a way to do this or should I be using some other technique?
    Thanks,
    Colt

    I think this guy is running into the same misconception I and many of my classmates ran into about LabVIEW back in the day.  When your code enters the True Case, it will complete the True Case and immediately exit the True Case to complete whatever other tasks that may be outside of the Case Structure (assuming it didn't already do them). Then, the while loop (you must have a while loop) will move on to the next iteration, meaning it will do it all over again.
    Now, if you know already know and understand how code works in general (about iterations) then do forgive me.  I've edited a lot of student code and have seen this very mistake.  A misunderstanding of the fact that code reiterates and will do it all over again if not told to do something else.  Typically the mistake is made with Event Structures.  I know it doesn't make much sense to not understand that...but trust me, it makes sense to those who don't understand.  ha

Maybe you are looking for