Jump to content

Event case call from another event case in Event Structure


Recommended Posts

Need to know, "if i actuate a event case by some variable, in the same event i should pass the control to another event case". Is this can be done, If yes how can it be done??

PS: If it can be done by property node, what should be the reference.

Link to post
Share on other sites

There is no such a thing like a property node of an event structure which tells what event has been fired (at least in a simple way that I could know), but it is completely possible for the code inside an event case to fire other event(s), which cause other cases of the same or of another structure to be called. You can use anything which generate events: value (signaling) of any control, dynamic events, etc. Personally I do such things all the time in simple GUIs. However, an event calling another event already smells of "you need rather a state machine" or "you need to think at architecture".

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Austin Lee
      Hi I am relatively new to Labview (about a month of training) and I created a project that allows you to play Tic Tac Toe against an AI for practice. The VI itself works fine and you can play games properly in succession  My problem is that when the main level VI reaches the second event structure in the Idle>Turn Handler Case Structure the player turn case wont register to start a new game because it is waiting for an event from the enums. I am looking for a practical way of skipping this because if I add a new event in the second event structure it runs the new game case on start up as well.
       
      Any help with the project in general is welcome as well as style tips because I am learning.
       
      I'm hoping that somebody can provide me with some insight into my project.
       
      Thanks,
      Austin
      TicTacToe.zip
    • By GregFreeman
      I have a multicolumn listbox where I would like a "right-click" to set the value of the MC listbox to the row that was right-clicked, then a shortcut menu will appear. Depending on the value of the MC listbox (i.e. row clicked) I determine what right-click menu options are available. To do this, I use the mouse down event, and if it's a right click, I set the MC listbox value to the row clicked. Then, the shortcut menu activation event is fired, and in there I use the current value of the MC listbox to enable/disable menu items. My question is this, can I always expect the mouse down event to occur first (it seems it does), or do I need to manage the order in which the events fire. I guess I could also handle all this logic in the mouse down case, inside my case structure, when checking which button was pressed. What I want to make sure I avoid is the shortcut menu activation firing first and having the wrong row selected in the MC listbox which may disable/enable the wrong menu items.
      Edit:
      After discussing w/ co-workers, I think the answer is yes, because the mouse-down is the event, the shortcut menu activation is the system response to that event. Please let me know if this is wrong.
    • By JMak
      Hi All,
      I have been trying to come up with a way to make my program more efficient. I am trying to use less nested case structures, and to avoid calling sub VIs multiple times. I looked at some of the design patterns, and there was not a sole design pattern available that did what I wanted, so I have tried to combine 3 patterns into one.
      My application has a user interface controlling a camera, and each function is context sensitive. For example, if the camera is already acquiring images, the "change video mode" function needs to unconfigure acquisition before adjusting the settings. If the camera is not doing anything, the unconfigure step isn't necessary.
      My previous attempt used nested case structures to test the condition of all these criteria, and take the required action, so there were cases for every combination of states. I wanted the code to be more minimalist, and call functions (sub VIs) in a state machine in a different order, skipping certain cases, depending on the context. I wanted to combine the low CPU usage of the event structure with the queued message handler example, to take an array of states and process them one at a time.
      My first attempt is attached. I used notifiers because I don't want steps to be queued if the user presses multiple commands before completion. I want to only process the first command received after the current notifier changes are made. I couldn't think of a way to change between using the array from the notifier and using the modified array (minus the deleted element) in a shift register, so I used the send notification inside the slave loop to send the modified array of states. I want to know if there is a better, more efficient way of doing this, and whether there are any problems here.
      Thanks,
      James
      MasterSlave Events.vi
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.