Simplification Needed: Multiple buttons with similar execution

Hello,
A vi I am currently working on needs many buttons on the front panel. However, the execution for each is quite simple and similar all throughout.The following figure shows the buttons on the left and right side of the Case Structure. Inside the Case Structure, the same commands remain essentially the same except with the change of a number as the input of the Zaber Write vi (in this case it is a 2). Does anyone have a better idea for me to execute these functions in a more compact way? 
Thank you.
Alfredo
Solved!
Go to Solution.

It depends if your buttons are switch action (any combination of buttons can be true: 2^N possible cases)
or latch action (only zero or one can be true: N+1 possible outcomes).
Here is code for both cases as shown.
(If you want some weird, nonconsecutive case numbers, you can index into a lookup table before going to the case structure.)
Overall, your code shows some very odd programming style that makes little sense. Can you attach the actual program?
Message Edited by altenbach on 10-17-2009 02:29 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
multiBooleans.png ‏12 KB

Similar Messages

  • Actionlistener - for multiple buttons with similar functionality

    Hi, all:
    I'm working on a calculator program and want to know how to go about making a generic ActionListener for all the functions (i.e. +,-,*,/) so that I don't have to write separate inner classes for each function (i.e. + button, - button, etc.).
    I think this generic class should be created within a method that takes parameters. The parameters are then used within the inner class.
    What I need to know specifically is whether it's possible to pass a string operator symbol (e.g. "+" or "-") as a parameter in the following context:
    class buttonListener implements ActionListener
    public void actionPerformed(ActionEvent e)
    intField1Val + intFieldVal2;
    in this case, the "+" would be the parameter that would change depending on the values provided to the method.
    Can this be done??
    I'd also appreciate any other feedback you can give m,e on this problem (i.e. how to set up the method...basic structure??)
    Thanks!!

    Hi there,
    One way to do this is as follows:
    Button plus = new Button("+");
    Button minus = new Button("-");
    public void actionPerformed(ActionEvent e) {
    String componentHit = e.getActionCommand();
    if (componentHit == "+") {
    doAddMeth(); // implemented elsewhere
    else
    if (componentHit == "-") {
    doSubMeth(); // implemented elsewhere
    ~Bill

  • Set multiple buttons emphasized = true

    Hi, I have a Panel and added many Buttons in it as Children.
    I would like to set multiple buttons with emphasized = true. I
    found, however, if I set one Button emphasized = true, it will set
    all other Buttons emphasized = false automatically. Why?
    Thanks,
    ff

    Hi
    By default emphasized is false for each button.
    for every button add emphasized="true"
    If it not works post the sample code.

  • How do I use edge commons composition loader to load multiple compositions with a next and back button?

    I am working on an interactive book and have set up each page as a separate composition in edge.
    I am using  the edge commons JS library to load multiple compositions into a main composition.
    You can see how this works here: Edge Commons - Extension Library for Edge Animate and Edge Reflow | EdgeDocks.com
    The way the edge commons tutorial is set up requires a button for each composition i want to load. I am interested in loading multiple compositions with a "next" and "back" button, and a "swipe left, "swipe right" gesture on the content symbol that each composition is loaded into. I also need the swipe features on the content symbol not to interfere with the interactive elements on the loaded composition.
    Please suggest a solution that will work without adding additional scripts beyond edge commons and jquery.

    Sort of. I'm using this code inside an action for a button symbol. But it doesn't work perfectly. Trying to debug it.
    Let me know if you have any luck.
    //Check to see if pageCounter already exists
    if (typeof EC.pageCounter === 'undefined') {
      // it doesn't exist so initialize it to first page
        EC.pageCounter = 2;
    //check if the page is only 1 digit -- patch for single digit
    if (EC.pageCounter < 9) {
       // it is, so we need to pad a 0 on the front.
      EC.pageCounterString = "0" + EC.pageCounter;
      //e.g.  01 ...09,11,12,13....115,222352,,....
    else {
      EC.pageCounterString = EC.pageCounter;
    EC.loadComposition(EC.pageCounterString + "/publish/web/" + EC.pageCounterString + ".html", sym.$("container"));
    EC.pageCounter = EC.pageCounter + 1;
    //TODO for back  -1

  • I have multiple devices with the same cerificate, once I have a an exception for one, FF denys access to the others. I cannot change the certificates, I need to stop FF blocking them.

    I have multiple devices with the same cerificate, once I have an exception for one, FF denys access to the others. I cannot change the certificates, I need to stop FF blocking them.
    == This happened ==
    Every time Firefox opened
    == I attempt to access a web front end on an IBM SVC device

    You can't use the same certificate more than once.
    See also [[Certificate contains the same serial number as another certificate]]

  • I need a calendar with multiple alert times for events; Advice please?

    1. I need to be able to set multiple alert times (e.g. 24 hours before, and 2 hours before)
    2. I need a good clear Month view, with text that can be enlarged (I am disabled)
    3. It needs to sync with standard iCloud calendar data (I use Week Calendar on my iPhone and iPad - great!)
    4. I do not want BusyCal, thanks (the developer point-blank refuses to fix the Alarm window to remember it's width, and refuses point-blank to wrap the alarm title text onto two line when it is long - although they do wrap text in the calendar itself, just not in the alarm window, go figure)

    Hey I have same problem. No PCMCIA No PCIe No USB converter are usefull
    I recommend you to use IBM Thinkpad Laptop with DockStation (adv Mini Dock 2504-10U)
    This Dock Sattion have real RS232 port

  • Need help on creating a button with additional drop down menu

    Hi,
    I need to have a button with additional menu as we see in IE, please help me how can i do that. I want the button to be displayed normally with an additional arrow on the right side when clicked on it shows pop up menu. Please let me know if the solution has already there in the forum. I searched and couldn't get one .. :(

    Hey there buddy.
    Try this:
    http://www.koders.com/java/fid20361AB8C305DE9B9110DE90F2154FC43AA0E57C.aspx
    Jason.

  • How prevent simultaneous execution of multiple button threads?

    My AS 3 program has multiple buttons. Users can select one and then immediately select another and this causes 2 threads that collide.  Once one button is executing, I want the other buttons to ignore clicks.
    I've tried using a lock:Boolean to indicate a button is being processed.  Each button checks lock.  My logic is such that when the AS 3 processor detects a locked condition, it abandons execution of that button.  However, surprisingly, it abandons execution only termporarily ... once the the boolean is unlocked, AS 3 comes back and executes the button.
    The problems are twofold:  1)  the first time the 2nd button attempts to execute (by checking lock), when it returns (from checking lock) and attempts to pick up processing where it left off, it seems to forget where it was and does not utlimately complete its task(s); possibly variables have been altered, it is difficult to say.  That is, AS 3 is unable to successfully pickup where it left off on the first button.
    2) the second problem is that AS 3 incorrectly returns to button 2 after the lock condition is cleared.  It persists and will execute that button.
    Can anyone tell me how once one button is selected, the others can be locked out and won't execute??  Multiple threads from these buttons is a problem.
    Thanks in advance.
    Steve @ U Iowa

    dmennenoh - OK.  The downside to that type of solution is that each button has to "know" which other buttons are on the stage at that time, but, yes, that should work.  Do you think turning their visibility off would or would not be as effective as removing the event listeners?  I'm thinking turning visiblity on or off is simpler and simpler to manage.  Thanks for your help.

  • Created multiple websites with iwebsites, now need to save multiple domains

    I have created multiple websites with iwebsites on iweb 06, now I want to save these sites so in case there is any problems when I upgrade to 08. How do I do this?

    Hello Paul,
    You need to locate the Domain files for each website. You should find these under your account (the house icon in the finder)/Library/Application Support/iWeb.
    Vonz.

  • Is it possible to make a button with multiple paths?

    Hello and good day Everyone
    I want to make a flash game with a map leading to various places for example school or beach like this http://www.yotreat.com/sites/default/files/190-160_1286.jpg
    if the player goes to the school she will find the teacher, and if the player goes to the beach se will find the coach.
    How can I make the player (for example) talks to the teacher at school, returns to the main map, and goes to the beach to talk with the coach, yet if she goes to the school again, the dialogue with the teacher won't be the same with first dialogue?
    =>>> Is it possible to make a button with different paths to go? As if you've watched frame A, then you push the same button again it will take you to frame B??? <<<=
    Sorry for my confusing description... I hope you get the idea >,<
    Im so desperate... I've been searching for articles about this since yesterday and I still can't find one to solve this problem of mine.
    Making games is my dream... I've made some very simple games, but I want to try a new level of difficulty
    Please help me? (>o<

    Thank you for the advice, sir Ned Murphy!
    Yes, I try to use variables now, but face another problem with it... would you please tell me what's wrong with my script?
    Here, in label: "School" I type:
    on (release) {
    if (point = 0){
    gotoAndStop("dialogue1");
    else if (point = 10){
    gotoAndStop("dialogue2");
    else {
    gotoAndStop("dialogue3");
    (it's only a testing, so I only use these 4 labels)
    and in label: "dialogue1", "dialogue2",and "dialogue3" I type:
    on (release) {point += 10;}
    on (release) {
    _root.gotoAndStop("school");
    The result when I test movie:
    1. At "School" (shows point=0), I click the button,
    2. then occurs "dialogue2" (shows point=10), I click the button,
    3. then back at "school" (shows point=20), I click the button,
    4. then occurs "dialogue2" again (shows point=10)
    even the first shot is wrong
    point=0 should be the entrance to "dialogue1", but all I can get is "dialogue2"...
    Please tell me what's wrong with my script, sir Ned Murphy,
    Thank you very  much
    Regards,
    Tami

  • Working with multiple buttons on a jsp form....!

    Hi guys...!
    I have a jsp form, which has 3 buttons (submit, update, cancel), and I also have a java Servlet that processes that form.
    In my java Servlet, i have a method called submitData(). I also want to have a method called updateData(), which will be called when the user clicks on the update button.
    These are the codes in my jsp form:
    <SCRIPT language="JavaScript" type="text/javascript">
                   function submitFunction (i) {
                        if (i==1) {
                             document.theForm.action="/MyWebApp/FormServlet";
                        if (i==2) {
                             document.theForm.action="/MyBugWebApp/FormServlet";
                        if (i==3) {
                             document.theForm.action="/MyWebApp/DisplayForm.jsp";
                        document.theForm.submit()
              </SCRIPT>
    <form name="theForm">
    <input type="button" value="Submit" onClick="submitFunction(1)"></input>
    <input type="reset" value="Reset"></input>
    <input type="button" value="Cancel" onClick="submitFunction(3)"></input>
    <input type="button" value="Update" onClick="sumbitFunction(2)"></input>
    </form>
    As u can see, both the submit and the update button use the same java servlet file. But inside that java servlet file, I want to have methods that will be called inside my doPost() method when the user clicks on update or submit.
    I've tried to pass a value through the httpRequest but it doesn't work... This is what I did.
    In my javaScript, I added this value in the action attribute:
    document.theForm.action="/MyWebApp/FormServlet?id=submit";
    document.theForm.action="/MyWebApp/FormServlet?id=update";
    I did that because I wanted to be able to retrieve the value of the "id" in my servlet and check which type of action was sent and then call the appropriate function in my servlet.
    But, it doesn't work. It returns "null" as the value for "id"
    Does anyone know how to do this task??...or what am I doing wrong in my code???
    Thanks...

    So there are really two solutions to this:
    1) Use <input type="submit" instead of buttons. Give all three buttons the same name but different values. Then the button used to submit will be added to the list of parameters.
    2) Add a hidden input to the form, and when the form determines which button was pushed, set a different value for the hidden input field. For example of both, take a look at this code:
    <html>
      <head>
        <script type="text/javascript">
          function formSubmit(i)
            var toSubmit = document.getElementById("myForm")
            if (i == 1) toSubmit.doThis.value="one"
            if (i == 2) toSubmit.doThis.value="two"
            if (i == 3) toSubmit.doThis.value="three"
            toSubmit.submit()
        </script>
      </head>
      <body>
        <form id="myForm" action="" method="get">
          <input type="hidden" name="doThis" /><br />
          <input type="submit" name="whatToDo" onclick="formSubmit(1)" value="Submit" />
          <input type="submit" name="whatToDo" onclick="formSubmit(2)" value="Cancel" />
          <input type="submit" name="whatToDo" onclick="formSubmit(3)" value="Update" />
        </form>
      </body>
    </html>For method one, if the servlet did:
    String whatToDo = request.getParameter("whatToDo");
    if ("Submit".equals(whatToDo)) {
      //doSubmit();
    } else if ("Update".equals(whatToDo)) {
      //doUpdate();
    } else if ("Cancel".equals(whatToDo)) {
      //doCancel();
    } else if ("Reset".equals(whatToDo)) {
      /doReset();
    } else {
      //error situation
    }Or you could instead look at the hidden value:
    String doThis = request.getParameter("doThis");
    if ("1".equals(doThis)) { ... }I personally like the submit button with the same names and different values, since the second method breaks if the user has javascript disabled.

  • Buttons with multiple actions doesn't work in v32.1

    We had buttons in our previously published folios that bring one multi-state object to first state and second MSO to other state which depends on which button is pressed. It works in app v32.0 and lower, but it doesn't work longer after trying to update our app to v32.1.
    If there is no more possible to have buttons with more than one action, I think we should be warned in What's New in Relaese v32.1 notes. Because it's not happen we consider it as a bug. Can someone please tell us whether this is a permanent change to button functionality in DPS folios or if it is happen by mistake?

    Hello Michelle,
    I was wondering if you were able to see my post today about problems with MSO's and whether you were able to get any solutions for the previous posts on this thread?
    I have been in contact with the Adobe support team with regards to the problems I am having with the App I've created  and sent the App and some sample indesign files for them to look over. They have been really unhelpful and just given me this as the response:
    I have also researched about this issue and would like to inform you that there are several changes which have been incorporated in iOS 8.
    So apps which are created and working with iOS 7 might not work with iOS 8. This is an expected behavior.
    You would have to create the app again with compatibility settings with iOS 8 and then release an update for the same.
    So altogether there has to be another to be app created for iOS 8.
    As we are already 2 weeks over deadline, due to problems with iOS 8, and out of budget to cover the extra work we have had to do so far problem solving these issues, I really hoped for something better than this response.
    Are Adobe really not looking into a fix for this? Is the only solution to limit the interactivity and functionality of DPS apps so they work within the new restrictions of iOS 8?
    Any help would be really gratefully received.
    many thanks,
    Chrissy

  • Cp6: How to stop a slide with multiple buttons in a non-linear presentation?

    Hello,
    I would be most thankful for a solution to this issue, as I haven't managed to find one yet in this forum.
    The presentation is non-linear, which means that the first slide is a kind of menu from which you can choose another slide to explore, and always return to the first one.
    Each slide has several buttons that activate various audio files, and there is an arrow button in the lower right corner to jump to the first slide.
    The problem is that the slide does not stop after some audio buttons are clicked, and continues onto the following slide (instead of pausing until the arrow button is clicked). When I click a few buttons and listen to the audio, eventually the slide automatically continues to the next slide.
    I have tried:
    adding a click box on top of that button with ''pause project until user clicks'
    changing all the buttons to Timing -> Pause after ...
    changing only the arrow button to Timing -> Pause after ...
    and don't want to make the time of the slide unnecessarily long
    Any ideas?
    Thanks in advance,
    best
    Agi

    Hi Lilybiri,
    Thank you so much for you reply, and the video instruction. Indeed, I had simple actions for the video, and now I have replaced these with advanced actions it is working fine - yey! It's a pity though that such a simple action requires such a convoluted way, especially because my presentation will be full of short audio files (= loads of scripts). I see that you are an expert in using Captivate, so this is still probably the easiest way to resolve the problem.
    Anyway, I guess my situation is exceptional, because I am using Cp for an online artwork
    Thanks again!
    Agi

  • Multiple Speakers with Airport Express

    Since the release of iTunes sometime back in feb/mar, I'm so happy to be able to stream music through multiple speakers in different rooms in my house. However, since I installed the latest iTunesSetup dated 2006-06-28 release v6.05, I am unable to play to more than 1 set of speakers, sometimes even only limited to "My Computer". The error message was something like 'could not access the speaker'.
    I've also doublechecked latest firmware and there was none released after http://www.apple.com/support/downloads/airportexpressfirmwareupdate63forwindows. html
    I don't see anyone here with similar problems since there seems to be none posted after Jun 28 on this issue.
    Can any expert help?

    http://docs.info.apple.com/article.html?artnum=303157
    # Click the Firewall tab.
    # Click the Advanced button.
    # Make sure that the option to "Block UDP Traffic" is not selected.
    Thks so much for the reply! My PCs are behind the router and the firewall is not on in this case. I do use the zonealarm normally for other PCs.
    As far as I know, on XPProSP2 we can unblock UDP traffic and normally need to specify which ports though, not universal unblock.
    Any other clues?

  • Submit multiple forms with java

    Hello,
    I have a problem when I am submitting multiple forms with the javascript document.form1.submit();.
    I shall explain what my problem is. I have made a JSP that contains some forms. In the forms I post values to external sites. so the action from the forms are http://www.example.com/employee/login. I post my username and password to this external link so I have logged in. So I do this for 20 different sites. so 20 different actions in 20 different forms on one JSP.
    Now I have made one button that submit all of this forms. I do this with the javascript document.form1.submit();
    document.form2.submit();
    etc.
    But this is not consistent and I wan't a sollutions in Java so I am sure that all the forms wil execute. Because now he post only some forms and some not. So i want a solid sollution. Can anyone help me.
    Thanks in advance,
    Henk

    I had a similar situation a few years ago, where I needed to close sessions that my application had opened with different servers.
    The way I did it was with a secondary browser window, which my "primary" window would control. I had a JavaScript routine that would set the URL of the secondary window, loop with a timer and check the state of that window until the request had completed, then send the next URL, until I had "fired off" URLs to close all of my sessions.
    If this sounds like something you'd be interested in doing, let me know and I can post the code here.
    James W. Anderson
    The Coca-Cola Company

Maybe you are looking for

  • How do I get a user guide for I-Pad2?

    How do I get an I-Pad2 user guide?

  • Tcode to see Prev Maint order in PP

    Hi, PP WC is used in Eq Master. Prev Maint order is created with sys condition as 0 as per scheduling 1.In which Tcode i've to see whether this WC is blocked for the period as per Maint order 2. In which Tcode i've to see Prev Maint order in PP Kindl

  • Wine: Unhandled page fault

    I've had this error with a few apps in the past and have just come across it again when trying to run safari. wine: Unhandled page fault on read access to 0x00000008 at address 0x99bada (thread 0009), starting debugger... Unhandled exception: page fa

  • Why won't my Mp4 files/movies go on my ipod touch 4g?

    i been trying all day to add a mp4 file to my itunes library and i click file>add file to library>open "file name" it dosen't show up and it's a in a mp4 file format but it won't show up in my itunes library i tired many times and it hasen't show up

  • Aperture 3 Issues:  "Apple" Raw Preset Override, Viewing, + Flickr

    I have created a RAW preset for my Canon camera and asked Aperture to save it as my default. However, each time I load aperture, the "Apple" preset overrides my specific RAW camera preset. For some reason, the default "Apple" preset maxes out the boo