Control a VI with Menu and Buttons

Hi,
I'm a beginner in LabView, so my question could be very easy. However, I
have not found a solution yet.
I have a VI which is controlled over buttons using an event structure.
Now I want additionally control the same VI with a menu, so that the
user can either use the buttons or the menu.
How can I realize that?
I would be very happy, if someone can explain to me an easy way how to
solve this problem. Perhaps a small Example-VI would be very helpful.
Martin

Looking at my last comment, I think I may have confused you a bit. I stated something that's not quite correct.
The Menu selection for the Event Structure should only be configured to a single event case in the event structure. But you can still have a menu selection trigger an event case that is also triggered by a button.
The attached example shows how to setup for what you want to do. The menu selections trigger the Menu event, then there's a property node for the correct cases to trigger the button so it's event case will run. I put a delay in there just so you can see that two events are triggered when you select a menu.
Hope this helps more than last.
Ed
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Attachments:
Menu_Event_Demo.zip ‏24 KB

Similar Messages

  • I am satisfied with my menu and buttons but would love to change the big white screen below it.

    I have used themes to change my menu and buttons. What I would like to change is the big white screen below, where the search space is. Is this possible?

    Well, in later OSes, Mouse buttons can be switched in the Mouse Pref Pane, no idea if Magic Mice work like that.

  • Menu and Buttons not showing up!?!

    OK. I was trying to burn a iDVD project on my dual G5 desktop w/iDVD5. I would get "there's an error while rendering". After fiddling with it for a day and getting no where, I switched to my laptop (G4/1.25ghz/10.4.8) with iDVD6.0.3. I started to re-assemble the project and the Themes button appears with the themes, the Media button appears with the media, but both the Menu and Buttons buttons show up with nothing but a empty white area! I need to reposition some buttons, but I can't.
    Please help.

    This frequently helps solve some problems. Quit iDVD. Search for the file named com.apple.iDVD.plist and trash it. (A new one will be created next launch of iDVD.) Or look in: User/Library/Preferences. This may solve project loading errors too. Restart and use Disk Utility to Repair Permissions.
    You'll need to reset some Preferences.

  • Working with XML and Button

    Hi,
    How are all of you. Well I am new to Flex. But I have started
    building simple applications. One of the top most problem I am
    facing is working with XML and Button. Can you please assist me in
    this. I am explaining my problem:
    I have an external XML file like this:
    <Menu>
    <button>
    <idnt>0</idnt>
    <label>General Health</label>
    <text>General Health pages is currently under
    construction</text>
    </button>
    <button>
    <idnt>1</idnt>
    <label>Mental Health</label>
    <text>Mental Health pages is currently under
    construction</text>
    </button>
    </Menu>
    Now I want to generate Buttons Dynamically from this XML. And
    the second thing which is the most problematic is that how I code
    it so that when I press the Button labled "General Health", it will
    show the same text as in the XML tag coresponding to tag
    "<label>General Health</label>" ?
    I badly need this. I am realy confused on this. Kindly help
    me.
    Regards
    ..::DeX

    Let's assume that variable "node" contains one element of the
    XML. For example,
    <button>
    <idnt>0</idnt>
    <label>General Health</label>
    <text>General Health pages is currently under
    construction</text>
    </button>
    such that node.label would be "General Health", node.idnt
    would be 0, etc.
    You can build a Button like this:
    var b:Button = new Button();
    b.label = node.label;
    b.data = node; // more on this later
    b.width = 60;
    b.height = 26;
    addChild(b); // critical - adds the button to the display
    list so you can see it
    b.addEventHandler( MouseEvent.CLICK, handleClick );
    You must set the button's width and height unless the button
    will be in a container that will size its own children (like Tile).
    Every Flex component has a data property. You can set it to
    whatever you like. For your needs it makes sense to set each
    Button's data property to the node it relates to.
    Now suppose that code above is in a function, createButton:
    private function createButton( node:XML ) : void {
    // code from above
    Here's how to make all the buttons where "menu" is a variable
    that contains your XML:
    for(var k:int=0; k < menu.button; k++) { // menu.button is
    an XMLList
    createButton( menu.button[k] );
    Now to handle the event:
    private function handleEvent( event:MouseEvent ) : void
    var b:Button = event.currentTarget as Button;
    trace( b.data.text);
    When a button is picked, the description element will print
    in the debug console. Replace the trace with whatever code you
    need.

  • Problem with menu and panel

    hi,
    i m new to java still learning new concepts. When i was working with menu and panel i got this problem and i tried a lot but still i havn't got any success. the problem is i m creating a menu with two menuitem - one for "add item" and another for "modify item". What i want to do that on the same frame i want to create two panel of these two item. when i click "add item" option it should show add window and so with modify option. but the problem is if i click add item it shows the addpanel but when i click modify option (add item panel goes- ok ..) but it doesn't show the modify panel, it shows only the main frame on which menu is there.
    i cannot understant what is happing here plz guide me.
    thanx

    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    public class ajitAutomobile extends JFrame implements ActionListener
         JMenuBar mb;
         JMenu jobmenu;
         JMenuItem newJobCard,modifyJobCard;
         Font ft;
         JPanel pnlnewJobCard,pnlmodifyJobCard;
         Container con;
         ajitAutomobile()
         ft=new Font("Arial",0,12);
         mb=new JMenuBar();
         setJMenuBar(mb);
         jobmenu=new JMenu(" Job Card Form");
         mb.add(jobmenu).setFont(ft);
         newJobCard=new JMenuItem("New Job Card Detail");
         modifyJobCard=new JMenuItem("Modify Job Card Detail");
         jobmenu.add(newJobCard).setFont(ft);     
         jobmenu.add(modifyJobCard).setFont(ft);     
         mb.add(requisition).setFont(ft);
         con=getContentPane();
         // setting panel for new JOb Card Entry
         pnlnewJobCard=new JPanel();
         pnlmodifyJobCard=new JPanel();
         con.add(pnlmodifyJobCard);
         con.add(pnlnewJobCard);
         pnlnewJobCard.setBackground(Color.RED);     
         pnlnewJobCard.setVisible(false);
         pnlmodifyJobCard.setBackground(Color.YELLOW);
         pnlmodifyJobCard.setVisible(false);
         //setting JFrame resources
         setVisible(true);
         setTitle("Ajit Automobile Service Center");
         setSize(750,300);
         setResizable(false);
         newJobCard.addActionListener(this);
         modifyJobCard.addActionListener(this);
         public void actionPerformed(ActionEvent ae)
              if (ae.getSource()==newJobCard)
                   pnlnewJobCard.setVisible(true);
                                                                    pnlmodifyJobCard.setVisible(false);
              if(ae.getSource()==modifyJobCard)
                                                                             pnlnewJobCard.setVisible(false);
                                                                    pnlmodifyJobCard.setVisible(true);
         public static void main(String args[])
         ajitAutomobile objajit=new ajitAutomobile();
         objajit.show();
    }so, this is the code and as i m expecting that when i click on "New Job Card Detail" then it should display pnlnewJobCard and when i will click "Modify Job Card Detail" it should display pnlmodifyJobCard panel but it is not working.It shows only that panel which is clicked first.
    plz help
    thnx, any answer will be appriciated.

  • Create Window with Textbox and Button For getting Input Value

    Hi All,
    I have create plugin application but i want to take input from user. Therefore i want to create window with textbox and button.
    please may i get solution...

    Or if that's all you need to do, just use JavaScript or a form.

  • Help Me with Encore CS6 Menu and buttons

    Hi I need help with Encore CS6 Menu's.  I have a Premiere CSs 6 video which is 3 hours long and 21 chapters.  It looks like I can get 18 of the buttons to work.  I also want to set up a exit button.  Is there a 18 button limit to a menu?  Should I be looking at using menu index's or play lists?
    Thanks in advance for your help.
    Ed

    I assume you have a single video on one timeline, and you have chapter markers for your chapters.
    A button (e.g. "play movie") links to the timeline (default is chapter one, which is what you want). The end action of the timeline is "last menu."
    Commonly, a second button on the main menu goes to a chapters menu. Each chapter menu has links back to the main menu and to the next and previous chapter menus.
    For EACH chapter, you create a chapter playlist with that one chapter in it. The end action of the chapter play list is "return to last menu."
    There are no end actions on chapters and no overrides anywhere in the project using this method.

  • Error 2050 with Menu and States - DisplayObject must be a child of the caller.

    Hi,
    I'm starting an application using States and a main Menu and
    when you click on the menu Item it changes the currentState.
    I was doing fine until I wanted to dock the Menu using an
    ApplicationControlBar.
    You can see the error message:
    http://dev2003.greatkingcasino.com/flex/casinomanagement.html
    My Idea is have always the menu on top and use States for
    each one of the menuItems. How can be done?
    Thanks,
    Paul
    Code:
    AS File:
    // MENU PERMISSIONS
    private function initApp():void
    dsData.send();
    }//initApp
    private function onResultMenuData(oEvent:ResultEvent):void
    xlcMenuData = new
    XMLListCollection(oEvent.result.children());
    private function menuHandler(oEvent:MenuEvent):void {
    currentState = oEvent.item.@label;
    MXML File:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="initApp()" currentState="navigation">
    <mx:Script source="functions.as"/>
    <mx:states>
    <mx:State name="logIn">
    blah
    </mx:State>
    <mx:State name="navigation">
    <mx:SetProperty name="layout" value="absolute"/>
    <mx:AddChild position="lastChild">
    <mx:ApplicationControlBar dock="true">
    <mx:MenuBar x="0" y="0"
    dataProvider="{xlcMenuData}"
    labelField="@label"
    itemClick="menuHandler(event);">
    </mx:MenuBar>
    </mx:ApplicationControlBar>
    </mx:AddChild>
    </mx:State>
    <mx:State name="Customer Detail" basedOn="navigation">
    <mx:AddChild position="lastChild">
    <mx:Panel x="0" y="111" width="464" height="247"
    layout="absolute" title="General Information">
    </mx:Panel>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Panel x="472" y="111" width="350" height="530"
    layout="absolute" title="Customer Information">
    <mx:Form x="0" y="0" width="310" height="100%">
    </mx:Form>
    <mx:ControlBar>
    <mx:Button label="Update Information"/>
    </mx:ControlBar>
    </mx:Panel>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Panel x="0" y="366" width="300" height="247"
    layout="absolute" title="Login Information">
    </mx:Panel>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Label text="User Name" x="347" y="59"/>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:TextInput id="idCustomerID" text="1" x="421"
    y="57"/>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Button label="Search"
    click="netService.GetCustomerDetails(idCustomerID.text);" x="589"
    y="57"/>
    </mx:AddChild>
    </mx:State>
    <mx:State name="Player Stats" basedOn="navigation">
    <mx:AddChild position="lastChild">
    <mx:Canvas label="Canvas 1" width="260"
    backgroundColor="#e2e2e2" id="canvas6" height="580" y="61">
    <mx:DateChooser x="10" y="66" id="datechooser1"/>
    <mx:DateChooser x="10" y="290" id="datechooser2"/>
    <mx:Button x="185" y="10" label="Search"
    id="button1"/>
    <mx:NumericStepper x="192" y="92" id="iniHour1" value="0"
    minimum="0" maximum="23"/>
    <mx:NumericStepper x="192" y="148" id="iniMinute1"
    value="0" minimum="0" maximum="59"/>
    <mx:Label x="10" y="40" text="Start Date"
    fontWeight="bold" id="label1"/>
    <mx:Label x="10" y="264" text="End Date"
    fontWeight="bold" id="label2"/>
    <mx:Label x="192" y="66" text="Hour" id="label3"/>
    <mx:Label x="192" y="122" text="Minute" id="label4"/>
    <mx:NumericStepper x="192" y="204" id="iniSecond1"
    value="0" minimum="0" maximum="0"/>
    <mx:Label x="192" y="178" text="Second" id="label5"/>
    <mx:NumericStepper x="192" y="316" id="endHour1"
    value="23" minimum="0" maximum="23"/>
    <mx:NumericStepper x="192" y="372" id="endMinute1"
    value="59" minimum="0" maximum="59"/>
    <mx:Label x="192" y="290" text="Hour" id="label6"/>
    <mx:Label x="192" y="346" text="Minute" id="label7"/>
    <mx:NumericStepper x="192" y="428" id="endSecond1"
    value="59" minimum="59" maximum="59"/>
    <mx:Label x="192" y="402" text="Second" id="label8"/>
    </mx:Canvas>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Canvas label="Canvas 2" width="486"
    backgroundColor="#e2e2e2" id="canvas7" height="1200" x="268"
    y="61">
    <mx:DataGrid x="10" y="10" width="402" height="100%"
    id="datagrid1">
    <mx:columns>
    <mx:DataGridColumn headerText="Player"
    dataField="col1"/>
    <mx:DataGridColumn headerText="Risk"
    dataField="col2"/>
    <mx:DataGridColumn headerText="Win" dataField="col3"/>
    <mx:DataGridColumn headerText="Casino win"
    dataField="col1"/>
    <mx:DataGridColumn headerText="Percent (%)"
    dataField="col2"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Canvas>
    </mx:AddChild>
    </mx:State>
    <mx:State name="Casino Usage" basedOn="navigation">
    </mx:State>
    </mx:states>
    <mx:HTTPService id="dsData" url="MenuData.xml"
    resultFormat="e4x" result="onResultMenuData(event)"/>
    </mx:Application>
    Text

    try{
    catch(error:Error){
    finally{
    (look up error handling in documentation)

  • Reset while loop with time and button?

    I am trying to get the while loop to stop and reset with a button or if time runs out. So when I switch the button it should stop the indicator; when I switch the button back on it should reset the time and start reading data again. Likewise, when time runs out it should stop the indicator and I want to flip the switch to start a new run and reset the time again. I have attached my vi for some clearification. If you have trouble understanding please let me know and Ill try and explain more. Thanks.
    Attachments:
    reseting_time_whlloop.vi ‏70 KB

    Relient wrote:
    I know my program is not efficient at all, Im inexperienced with labview and my company needs it soon so I'm trying to get it out quick. Attached is what I have so far. It is very messy!!  However it is nearly working how we want. The producer/ consumer design is needed because I am implementing this into my other program and each loop  has a different job than the other loops. This is just a mock version as I am trying to figure out the process.
    The stop buttons aren't needed but the button labeled boolean should reset the time and stop the run. When the run is stopped I want to re-enter a 'test time' and hit the button again for a new run. I just need to be able to reset the original time... Is the producer/consumer the best way to connect while loops because it seems messy?
    Again sorry if it is hard to follow and if its not the best way to go about it; I'm doing the best with what I know. Thanks for the help.
    I realize you may need this soon but you will regret it later (or the next person to touch this code) when you need to touch it again. It is overly comnplicated, messy and not very well designed. Doing a bad job quickly is never the right answer. A little extra time spent up front to do it right can save tons more time later on.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Can you control background audio with native IOS buttons?

    I have background audio working but would like to control the audio using the native buttons. Is this possible with Air 3.3?
    Not important but.. is airplay possible?

    Sorry but Airplay is currently not supported in AIR.

  • Trouble with Menu and Looping

    I have Encore CS6.  I created a Blu Ray Project.  720  50p.   the Preset is H264.   I have two Menus in the Project and each have an Audio of 21 Secs. Duration pickwhiped, and Set to forever in the Properties  Motion tab.  The Menus are PSD and White in colour.  When the Project is Burned to Blu Ray Disc both menus at the 21 sec mark go to Black frames and I can see the Underlined Highlight only for about .9 of a second. How can I get rid of those Black frames and get the Menus to loop properly.
    kind regards,
    Brendan
    Ps. How long does it take to get a reply on this Forum.
    I have returned to this forum on numerous occasions, but not anymore, as it looks like Adobe are not interested in resolving problems for their customers.    I will also be returning the CS6 Production Premium which I paid good money for. I am not going to put up with being mistreated like this anymore.
    Message was edited by: professional videographer

    I had a chance to play around a bit.
    I can confirm the black gap, but there is quite a bit of variation depending on other conditions.
    I was distracted by the audio length and highlights, but now wonder if this is not a variation on the problem discussed here:
    http://forums.adobe.com/message/3633026#3633026
    Using Brendan's menu and wav file (and a made up PAL 720p50 clip for a timeline), I get his results. Brendan, I did not understand that the menu continued normally after the absent menu background. In any event, the audio ends, the menu background is absent (so there is black), the highlight remains, then the menu continues normally through another loop. The audio is playing to the end.
    The problem is not present in Encore preview; it is present to varying degrees playing from a build to folder with Total Media Theater 5 or a burned disk (BD-RE).
    The varying degrees is interesting - Brendan's 59 second clip leaves a pronounced black frame - probably less than a second, but significant. A 30 second audio clip shows only a very, very short flash of black. A 10 second clip had a black frame almost as long as the 59 second clip.
    I wonder about the audio length issues I raised above.
    The full scope of the issue is easier for me to understand using a video background, where the delay is also present - there is just no black frame. For example, simply load the Crib Menu. Playing on the computer from a build to folder, the black is observed. Played from a burned disk on a DVD player, no black flash is present, because the player holds the last image (the final frame of the motion video background) on screen until the menu repeat is loaded. (The highlight disappears briefly.)
    The black is more apparent on an audio only menu, because there is no video background to be held.
    I don't recall whether the frame being held is a build issue or a player function.

  • Help with menu and icon size in Muse app

    The menu and icons in the muse cc app on my lptop are so small that it cant really be used. any help?

    i have the 3200x1800 for the screen, the newest muse cc and windows os 64bit
    On Tue, Aug 12, 2014 at 5:50 PM, Varun Kalra <[email protected]>

  • How to control adobe flash files with sliders and buttons

    Hi,
    I am trying to make a front panel for a vehicle completely designed in flash, and control it through labview.  I can load a flash file into an activex container successfully.  I have followed this thread here http://forums.ni.com/ni/board/message?board.id=170​&message.id=351719  and gotten everything working. 
    But my question is, how can I send data to the flash file from labview?  Some examples of things I need to do:  Interpret a CAN signal and have some text appear on the screen, Make buttons flash, etc.
    I understand how to load the swf, Im just not sure how to communicate with it.  One thing to mention is that the front panel for the vehicle will be fully custom coded.  However in the meantime, I am trying to figure out how to control it from labview.  Like if there is a clock.swf out on the net, how can I change the time from labview?  Is there a way to see what parameters are available for changing?
    Thanks in advance

    Hello,
    What specific Active X framework are you using to embed the container? The thread you referenced mentions Shockwave's Active X API, does this set of Active X functions expose methods for object control? 
    Could you elaborate as to the driver behind a fully Flash based front panel embedded within LabVIEW? Is this application inevitably going to be deployed as thin client software? 
    For interaction with custom flash applications aside from Active X, LabVIEW has an integrated Web Services feature to allow data transfer from custom thin client applications to the LabVIEW environment for processing and instrument control. A detailed discussion of the Web Services feature may be found via the links below:
    LabVIEW Web Services FAQ (Detailed)
    http://zone.ni.com/devzone/cda/tut/p/id/7747
    Web Services in LabVIEW (Overview)
    http://zone.ni.com/devzone/cda/tut/p/id/7350
    Please post back any further questions, or information on the system design.
    Cheers!
    Patrick Corcoran
    Application Engineering Specialist | Control
    National Instruments

  • Problem with transparancy and buttons

    Hello
    i have a strange behavior with buttons which shall be transparent.
    On a JInternalFrame i placed several JPanels. Each JPanel and the JInternalFrame have opaque set to false, as does the contentPanel of the JInternalFrame. On one of these JPanels (does not mater which) has rows of several buttons. These Buttons shall be semi transparent, so i set their opaque to true and their back color to 238,238,238,207, which should let them be gray with a little bit of the background.
    My problem is, that when i move the mouse over them that sometimes the content of a whole different screen location is painted inside the button, or the button gets the content of its neighbor. The Background is than not visible anymore.
    Also, when i press the buttons, they turn light blue and are not transparent anymore.
    Does anyone of you have an idea what i have to do differently?
    I am using Java 1.5.0_08
    Thanks
    Matt

    @Kwun Tong – make the controlling buttons part of every state of the MSO.
    So you could alter the color of "normal" state and "click" state of each of the buttons in every state of the MSO as you wish.
    Uwe

  • Menu and Buttons not respoding DSP4

    For some reason I can't make buttons on my DSP 4. Every time I drag and create a new button it disappears. Same thing when I create my own button.
    I'm running a Dual 2.5ghz Powermac G5, 4gb of ram, 10.4.8, and with 14gb of hard drive space left.
    DSP is up to date.
    I have tried different files, different users, deleting the plist, cleared out system cache, completely removed DSP 4 and its package contents, then reinstalled, reloaded system fonts, and repaired permissions. Still... no good.. Any help will be appreciated.
    Thanks in advance
    Dual 2.5ghz Powermac   Mac OS X (10.4.8)   4GB RAM

    Look in the menu editor window. There are two groups of buttons on the bottom right, three buttons to show normal, selected, or activated button states, and two to show the button outlines and or guides. Make sure the button outlines are on and the selected or activated state is showing.

Maybe you are looking for

  • While Installing i am getting error in ECC 6.0

    I am getting Administrator@sap: Input Error You entered: D:\ECC6\EXP2\Label.Asc Found the Label SAP:ECC:6600SR1:Export(2/11):Installation ExportCD51031798_2 but need the label SAP:Ecc:600SR1:Export(11/11):. Regards Balaji

  • No sound in iPhoto since installing Yosemite

    Since updating my Mac to Yosemite, I have no sound in movie clips viewed in iPhoto. I am running Yosemite v10.10.1 Some old clips do have sound but many, including the latest movies, do not have sound. However, I can play them ok with sound using Qui

  • Bean not working in 9i ids

    hello, i have a prograss bar bean class and i saved this bean in /form90/java and set the property of beans item " implement class" with this bean name but not working or display. urgent help. thanks

  • Has anyone else had iCloud notes automatically deleted after ending a skype call?

    I was making notes during a Skype call and when I ended the call the note was gone. This has happened twice now, the first time I presumed it was my mistake. When it happened again in exactly the same conditions I knew it wasn't my doing. has this ha

  • Slow down continues unabated and unresolved...

    this started a few days ago - I received some responses but nothing seems to work.   Now that I've tried eveything I can think of (even switching the hard drive...) I thought I'd start fresh here... I had been out of town for a few days, left my Mac