Programmat​ically fire an event in a subvi

I have a subvi with an event structure in a while loop. The event I'm interested in is controlled by a boolean. I want to have a boolean in my top level vi fire the event in the subvi. Can this be done?
I have attached an example.
Attachments:
example.zip ‏16 KB

In your sub-vi, you need to open a vi reference to the toplevel vi. Then use the GetControlValue method to get the value of the boolean. Put this in your loop to constantly get the control's value. Now for the problem. Normally you wire the value to the value(Signaling) property to fire the event. However, since you are constantly looping and reading the value, the event fires on every loop. You may have to replace the event structure with the old time poll method. Use a case structure to execute the desired code when the boolean is TRUE. Or just put a case structure inside the event. The event will fire on every loop, but the desired code would only execute on TRUE. Since you have to poll for the toplevel boolean, there is no other way that I can think of to set off the event. Why not put the event structure in the toplevel vi, and call the sub-vi from there.
- tbob
Inventor of the WORM Global

Similar Messages

  • How can I fire an event case on the value change of an indicator, or a network variable?

    Hi!  I have an event structure setup to look for a value change of an indicator on the front panel.  The indicator is updated by the value of a boolean network-published shared variable through a seperate parallel loop that is polling all of the network-published shared variables.  The event, however, does not fire when the indicator changes value.  I have switched the indicator to a control and tested it with user interaction and that works just fine.
    I want to use the event structure space for my code exectution because it seems logical that that is where it would go, and it will help keep my block diagram tity.  The code is also something I would like executed with the front pannel temperarily disabled.  I would rather not have the code in my network-variable polling loop because again the tity issue.   I would also rather not use a notification VI wired to an independent loop for this particular code.
    Is there a way to have an event structure fire an event with the value change of an indicator, or a network variable directly?
    Thanks for your input.
    LV 8.5
    -Nic

    Thanks for the reply.
    I went about things a little differently, but got them to work so..... .  It really was not my desire to have a boolean indicator on the front panel.  As previously stated, my ultimate goal was to have an event fire on the change of a network variable, which I had to poll for anyway but that is tucked away in a section where I am handling all my network variables.  I ended up using that Create User Event, Register User Event, and Generate User Event SubVIs to handle the task.
    I've read the help for all of those SubVI's and it is not entirely clear to me if the event fires every time the "Generate User Event" receives some inputs, or if it only fires when the value changes.  I could do a test to find out.  It wouldn't be too difficult to add a shift register or a feedback node and place the Generate User Event in a case structure so that it is only fired when the input changes state.

  • How to click on an Image and fire an event

    Is there anybody who can tell me how to click on an image and fire an event, so I can programmatically use the object? Can the image be used as an object?
    Thanks in advance
    Mario Bagnara
    Chile

    Why don't you just use a mouse listener and check (by getting the x,y coordinates of the click) whether the guy has clicked on the picture?
    That would be an easy way to see if some one has clicked on something.
    Regards
    Jiby.

  • How to set fire action event for particular rows in a table

    HI All,
    I have a requirement in which I want to set fire action event for particular rows in a table based on some condition.
    The table has columns like fullname,employee id etc.
    So i want to set fire action event for particulars rows only which will saisfy some condition.

    Atanu,
    Your approach(setting fire action for few rows) seems not possible. Better to go ahead with workaround.
    Do you want this functionality in processRequest(while page loading) or processFromRequest(on some event) method ? Give more explanation regd. your requirement ?
    In either case loop through the rows and when your condition is met write the action to be performed in controller.
    Regards,
    Anand

  • How can I move an event in ical to another calendar without ical resending the event invite to everyone

    I have 2 microsoft exchange calendars that I use for work. One is provided by my company, the other is provided by a customer that I do contract work for. The customer prefers to send invites to my email address provided to me by them. Which means that the invite appears on the exchange calendar provided to me by the customer.
    That's fine, but I would like for the event to appear on my work calendar so that I can get reminders on my iphone (long story short, the customer does not allow me to connect to their exchange server via my iphone due to security reasons).
    So, I go into iCal, open the event and change the calendar for the event. Unfortunately, that causes iCal to resend the invite to everyone involved in the event. This causes alot of confusion, obviously, as now everyone is wanting to know why I sent an invite for an event that is already scheduled.
    How can I move events to another calendar without iCal sending another invite to everyone?

    If you change anything in a repeating calendar entry it will give you the option of disconnecting it from the series. So may any random change, choose to not change the series.

  • Ical cannot create event in month view

    iCal cannot create event in month view. Is this a bug?
    I've tried double clicking in a day as I always did but nothing.

    Ko be,
    Application UI issues are in many cases, caused by a corrupt plist file.
    Quit iCal, and try removing the com.apple.iCal.plist file from your Macintosh HD/Users/yourusername/Library/Preferences Folder. Since that Library is now hidden, you have to use the Finder>Go Menu>Depress the "Option" key>Library. Drag the .plist file to your desktop, and log out/in or restart and check iCal for functionality.
    Also read Apple iCal 5 Office Software Review | Macworld for a description of Lion iCal.

  • Is there a way to have iCal notify of events by email as the default setting? Now I get Message with Sound as the default. I have OS 10.9.2/Mavericks.

    Is there a way to have iCal notify of events by email to myself [My Card in Contacts] as the default setting? Now I get Message with Sound as the default. I have OS 10.9.2/Mavericks.

    Is there a way to have iCal notify of events by email to myself [My Card in Contacts] as the default setting? Now I get Message with Sound as the default. I have OS 10.9.2/Mavericks.

  • The order of my ical 'all day' events changes when i go into print mode?

    The order of my ical 'all day' events changes when i go into print mode. What can i do to keep the order of events i so painstakingly created?

  • Some Ical all-day events automatically move to Jan 1 2000 (01/01/2000)

    I keep getting ical reminders for events bearing the date of Jan 01 2000. I checked such date in iCal and I noticed that I had over 30 events set for that date. Some are marked as "detached events" from recurring events set in 2006. What is going on??

    I have the exact same problem. I have entered birthdays for people I know starting with the year of their birth and never ending, an all-day event. They now don't show in 2007, but there is a detached event on January 1, 2000. When I delete that event and all subsequent versions of it, the initial event now ends in 2006 or 2007, and I have to set the repeat to end Never again. I fixed all the ones from February that showed up. Now I notice that a huge amount of the other birthdays (all day events) that I have entered are doing it now, and we are talking well over 40 of them. I don't understand why it keeps creating these detached events. I also publish my calendars, if that makes any difference.

  • Why does my ical not keep events in my upcoming days?

    Why does ical not keep events that i have added? the events show up on my other devices and on the me website but will not sync to my computer. does ical have a finite amount of events and if so what is the number.

    Anyone??

  • How Do I Programmatically Dispatch an Itemclick Event in Flex 3?

    Hi,
    I need some help with programmatically dispatching an itemclick event in Flex 3.
    For example, I've got a popupmenubutton as follows:
    <mx:PopUpMenuButton
        id="myPopUpMenuButton"
        label="Neighborhoods"
        dataProvider="{myNeighborhoodList}"
        itemClick="myPopUpMenuButtonClickHandler(event)"
    />
    Let's say that the myNeighborhoodList contains 3 choices: Old Port, Newport, Southport.
    In another piece of code, I want to programmatically dispatch the myPopUpMenuButton itemclick event as if "Newport" were chosen. How do I do that?
    FYI, I posted this question on Stack Overflow, but I didn't get a reply.
    Thank you!
    -Laxmidi

    Ok , here is how I solve the problem architecturally.  One class should be responsible for the viewstack index.  This class can respond to events dispatched anywhere.  So it goes a little something like this.
    The view stack
    <Viewstack selctedIndex="{stackIndex}">
      <Script>
          [Bindable] public var stackIndex:int;
       </Script>
      <ViewOne />
      <ViewTwo/>
      <ViewThree />
    </Viewstack/>
    StackPresentation.as
    public var stackCount:int;
    [Bindable] public var stackIndex:int;
    public function startUp():int
        stackIndex = someRandomNumberGenerator( 0 , stackCount );
         return stackIndex;
    public function changeStackHandler( newStackIndex:int ):void
        stackIndex = newStackIndex;
    There are a few things I must explain here.
    1.  The stackIndex of the StackPresentation class in "injected" into the Viewstack class.  This can be accomplished using a number of frameworks.  Personally I use Mate , but there is a whole cornucopia of DI frameworks ( Prana , RobotLegs , Swiz ...).
    2.  When you want to change the stack index from any part of the application , you dispatch an event like the one I posted earlier.  Your framework will wire this event to the StackPresentation.  The event will have some parameters ( i.e var newStackIndex:int ) which it uses to go to the next stack index , it could very well be different from what I posted as this is an example.
    The advantages of this are numerous.  But they all stem from "separation of concern".   The view class is responsible for being a view , and the presentation is responsible for coordinating the state of the view class.  The other advantage is that if some other part of the application wants to change the viewstack index , it MUST go through the presentation layer , preventing a "ball of mud" type of approach.  This greatly cuts down on the number of bugs and the time it takes to resolve them.  In scenarios where there is a problem , you only have to look at a few things , the logic in the presentation class ( which lends itself to unit-testing) and the cases where the event triggering the change is dispatched.  Hope this helps.
    Sincerely ,
      Ubu

  • How to fire an event dynamically in JSF Page

    Hi All
    How to fire an event dynamically in JSF Page?
    Thanks
    Sudhakar

    Hi,
    Thanks for the response. I mean to say, if I create the components dynamically then how can I fire events for those components.
    In otherwords,
    If I create the Button dynamically with particular ID being set to that component, then how can I call button action event when the button is clicked??
    Hope you understand
    What is the role of MethodBinding mechanism here??
    Thanks
    Sudhakar Chavali

  • Why iCal cancel of event edits issue is still not fixed after over 2 years?

    Why iCal "cancel of event edits" issue is still not fixed after over 2 years?
    I have been in the software engineering industry for over 14 years, but I have never seen a large corporation being so slow at addressing major issues like these.
    What would it take for Apple to start working on this issue?

    Yup. This is fully ridiculous that you can't cancel your updates once you start. I love the tool but this is on pretty significant issue.
    Sometimes I accidentally move a mtg or make some edit while viewing and you can't back you!!
    If you feel the same way, you should post a note here:
    http://www.apple.com/feedback/ical.html
    Message was edited by: SteveMc10123

  • Possible to highlight a row in text area which in turn would fire an event?

    I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?
    I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
    Thanks in advance.
    Regards,
    Paul

    If a java application is required (as opposed to a web-based solution using HTML's linking capabilities) the best approach might be a JList implementation. It could go something like this...
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class ListFrame extends JFrame
       public ListFrame()
          super("JList example frame");
          getContentPane().add(getListPanel(), BorderLayout.CENTER);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          pack();
          setVisible(true);
       private Component getListPanel()
          JPanel panel = new JPanel(new BorderLayout());
          final JList list = new JList(new Object[]
             "List option 1...",
             "List option 2...",
             "List option 3..."
          // This will make sure only one item can be checked at a time.
          list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
          // Handle the selection here.
          list.addListSelectionListener(new ListSelectionListener()
             public void valueChanged(ListSelectionEvent e)
                // No need to go on if this was a deselection.
                if (e.getValueIsAdjusting() || list.isSelectionEmpty())
                   return;
                // This is where you would have to convert the value that's selected into whatever
                // it is you want to display to the user.  This example just puts the text of the
                // selected item into a messagebox.
                Object selectedItem = list.getSelectedValue();
                JOptionPane.showMessageDialog(ListFrame.this, selectedItem);
          list.setVisibleRowCount(5);
          // The scrollpane will control the scrolling of the list (so you can have as many options
          // as you want).  Standard JScrollPane functionalities can be used to control various
          // visual aspects of the list.     
          JScrollPane scroll = new JScrollPane(list);
          scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          panel.add(scroll, BorderLayout.CENTER);
          return panel;
       public static void main(String[] args)
          new ListFrame();
    }I know this is quite after-the-fact, but I hope it helps (if you hadn't already solved the problem :) )

  • Web dynpro to fire an event automatically via url in iview

    Hi expert,
    I create an iview, and would like to via the application parameter: 'auto = true' to fire an event in htmlb (bsp java) application.
    I have already successful calling the service in my wdDoInit() method.
    but next step is how to fire the event automatically in init method ? any code snippets will be appriciated.
    Ben.J.

    Hi,
    I have 2 main DCs bound. Now from DC2 I have to read the Context of DC1 (which is bounded to another application).
    To bind your context from DC1 to DC2
    Copy the context that you want to expose from the component controller to interface controller of DC1.
    Once this is done you will be able to see the context in DC2.
    Based on your requirement you can set the Input type property of the context node.
    Regards
    Ayyapparaj

Maybe you are looking for