Using an event structure to reset a boolean control with ring menu value change

I am trying to get two boolean buttons to reset when the value of a ring menu changes.  For this I am using an event structure set to execute with a ring value change.  However I have other code that needs to be executing while the event structure waits for the value change.  I place my event structure inside the while loop the buttons reset as expected but my other code does not run (except at the moment of value change). If I place it outside the loop the rest of the code functions as expected but the buttons do not reset.  Any help you can offer is much appreciated.
Solved!
Go to Solution.
Attachments:
event structure reset.vi ‏11 KB

try this
Attachments:
event structure reset_edit.vi ‏14 KB

Similar Messages

  • Using multiple events structure inside state machine to control the Tab

    Hi y'all,
    Anne here.I have a Tab indicator in my front panel and I want to be able to control the flow of my program based on what controls I clicked inside the tab. I am using a state machine architecture and inside every state, I use an event structure to check for user interaction  to determine the next state and what tab page is going to be displayed next. This means that I am actually using multiple event structures in my application and I use them in just one while loop, but just that they are not running in parallel since I am only using "one event structure per state" which means that only one event structure is running at one time. My questions is, programming technique wise, am I doing it correctly? So far, I am not facing any problem (I am still in the early stage of the project) but I want to check with you all first on your opinion regarding this architecture. Will there be any issue on using multiple event structures in a vi? Since I will be using a tab, and the controls available in the tab will be the controls that will control my event structure for that state, by right, there should be no issue. Am I correct to assume this? Is there any limit on the use of event structures? I have attached here a simple sample of the architecture that I am talking about for your reference. I have attached a 2010 version and a 8.6 version. Let me know what you think or any opinions that you may have.
    Hoping to hear from you soon! Thanks so much in advance!
    Cheers!
    Anne
    Attachments:
    State Machine-Event Structure Sample_2010.vi ‏19 KB
    State Machine-Event Structure Sample_8.5.vi ‏25 KB

    Hi jak888,
    I decided to use tabs cause I don't want to have subvi pop ups every time i need to perform the process in the state and show an update in the front panel. This is actually going to be more of an ATE where you will have to choose first whether the one using is the operator or the engineer. If the operator is logged in, she will proceed to choose what test to run (this state will have its own event structure). This part, I don't want a pop up, so what happens is that from Login page, if the user logs in as operator, the tab will automatically switch to the Test Selection page. After selecting the test, it will proceed to Start Test state and the tab will show the Result Summary page. If the user logs in as engineer, then a totally different tab will be automatically shown next and so on. By doing this, I will be able to show an update on the front panel objects without having the subvis pop up. I will also just need to use the call reference functions to call my subvis, making my Main VI more generic. The tab Page header will be hidden so the operator will actually not see that there is a tab and that there are a lot of controls and indicators cause they are hidden in the tabs and that page will only be shown based on what they selected from the main tab. 
    I appreciate your thoughts! thanks so much!

  • How to use an Event Structure responding to an image control that belongs to a parent VI.

    Hi
    I am loading a subpanel vi by pressing a button located in the user interface of the main vi which also contains an image display. Subpanel vi opens up on the side and doesn't hide the image display of the main vi. Subpanel vi contains an event structure that needs to respond to user clicking on the image display of main vi.
    Since the bug that occured while creating an image reference control isn't fixed, I am passing the main vi pane reference onto the subpanel vi. From that point I've tried to edit event structure and have it respond to the image control/pane that belongs to main vi but I don't know how.
    Any help would be appreciated.
    Thanks

    Post a screenshot of your subVI code where you register the events.
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Boolean switch until released using an event structure

    I am using a boolean control with the mechanical action set to switch until released, I want the button to go back to the original state.
    I am using it in an event structure set to trigger on a value change. The action of pushing the button is generating two events, one of the on state and one for when it returns to the off state.
    How do I control this so that only one event is triggered and the second event that is queued up is ignored, I would like the button to go back to the original state and not execute code twice.
    Thanks
    Jim
    Solved!
    Go to Solution.

    You can use the value from OldVal or NewVal in the event case and a conditional structure to mask it off.  Do you really need switch until released functionality?  That's intended to give you two events, as the click and release are different actions.  Switch when released might be a better fit for you if you only want one event.
    --Using LV8.2, 8.6, 2009, 2012--

  • Acquiring continuous data using an event structure

    I am new to labview, having recently taken the Core I and II courses.
    I am programming a test rig to acquire the linear position of a hydraulic cylinder and plot it over time.  In programming this code, I elected to use an event structure so that when a front panel button is pressed, a certain part of the test is run. 
    In one particular part of the test, called the Snub Test, I need to measure the position of the cylinder over time and plot it to a graph.  The data acquisition needs to be continuous, however the event structure only allows the loop to run once. 
    I have attached a portion of my code for reference.
    Can someone please advise how I can get this data acquisition to run continuously until the user (or a reference trigger) stops the test?
    Thanks
    Attachments:
    Front Panel.vi ‏115 KB

    A few comments to your VI in general:
    You changed the stop button to "switch until released", most likely because you fabricated a race condition and did this as a quick fix. The reason is (1) your placement of the stop terminal outside the event structure and (2) the use of a local variable wired to the stop condition. The button terminal of a latch action boolean belong inside it's associated event case! This way it gets read (and reset to false) when the event occurs. In your case, the local variable and the button get read before the event occurs and the loop needs to spin once more at the event that occurs when you release it (true->false). At this point, the local is still true from the earlier event and the loop stops. Correct would be: latch action, stop terminal inside stop case and wired to the stop condition from inside the event. Other cases use the default output (false) and don't stop the loop.
    Your "equal false" code fragment is just an invert, right? So why complicate things?
    Why do you need a wait if there is an event structure?
    LabVIEW Champion . Do more with less code and in less time .

  • Can I use an event structure within another event structure

    Hi
    Can use an event structure within another event structure?
    Thanks
    Yasamin
    Solved!
    Go to Solution.

    I attached my Vi from my old project (MY OLD VI). It is worked correctly.
    But I decided that use event structure instead of case structure.
    I attached my new VI as a picture and as a LabVIEW VI too (network_analyzer_8510_920527 Frequency Sweep.vi )
    My graphs show by pressing "case 5: button (Bottom of page right hand).
    Then I want to show each of graph in a large window( in a new VI) by clicking a key (for example "show 1").
    Thanks
    Yasamin
    Attachments:
    my VI.JPG ‏256 KB
    network_analyzer_8510_920527 Frequency Sweep.vi ‏72 KB
    MY OLD VI.vi ‏69 KB

  • How to use a event structure in a subVI

    I am trying to use an event structure inside a subVI.  The subVI has an array builder that builds arrays, and the event structure is used so that when the program is running, it allows you to change the elements of the array.  It works, but when I implement it inside a subVI, it does not work properly.  This is going into a subVI, because it will be a part of a much larger progrram, so it needs to be modular.

    If you're using an event structure, it's not a subVI.  if you're worried about modularity, you shouldn't be using the event structure.
    You seem to have a fundamental misunderstanding of modularity.  An event structure should be placed within a while loop.  If you have a while loop within a subVI, you've handed over control of your program to the subVI.  You're not modular at this point.  Your top level GUI has no control.  You'd have to create some asinine system of variables to pass data down to that loop to stop the loop and return to your main VI.  That's not a good design decision.
    Instead of looking for a way to do something broken, you should spend effort trying to understand what you actually want to accomplish.  You should also spend some time learning how event structures work.
    This application is small right now and it's already on the path to unreadable.  That's a terrible thing to do to yourself.  Break these habits now.  se variables only when absolutely necessary.  Use subVIs to accomplish individual tasks, not run the entire application.  With event structures, use a stop button value change event to not be held hostage by the timeout.  If your variable has "2" in it, you're doing something wrong.  There has to be something different between the setpoints, put that in the name.  If you want to make subVIs, create an icon.
    But first and foremost, invest time in understanding dataflow

  • Using nested Event Structures

    Hi ,
    I wanna clarify whether using nested event structures in a vi is good Labview programming ?
    I have a vi which has two event structures nested,assuming it has two buttons GO1 and GO2.
    The outer event structure handles event triggered by GO1 and inner event structure handles Go2.
    The outer structure does fine by handling the button click on GO1,the problem is inability of inner
    event structure to handle click on GO2 button.
    I'm also attaching a sample.vi for reference.It would be great if you could help me
    solve this issue.Thanks in advance.
    Regards,
    Nalin
    Attachments:
    sample.vi ‏30 KB

    You can actually make this work, but like the others, I don't recommend it.
    To make your VI work. Right click on the "GO1" structure and select "Edit Events.....". At the bottom of the dialog, there is a checkbox that reads "Lock Front Panel until the event case for this event completes". With this checked, all front panel objects are locked until the GO1 event completes. This is what is causing the GO2 button not to work. Uncheck this and your application will work as you want it to.
    If your intent is to have GO2 disabled until you click GO1, try the attached VI. It uses property nodes to disable the GO2 button until you click the GO1.
    Another thing that you have setup that doesn't look necessary is the Timeout event, especially set to 1ms. The basic idea of the Event Structure is to not have to constantly poll for front panel events. If you just deleted the timeout event cases and removed the 1ms constant, your application would just well, but would just sit and wait for you to click a button.
    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:
    sample.vi ‏27 KB

  • Synchronization start/abort fetch by boolean control with postprocessing queue

    Hello dear colleagues!
    Thanks for your support, I ask you still to help to understand the following:
    How correctly to supervise on/off of Fetch function? (An example of that what I did already, please see the enclosed file).
    I.e. I explain conditions: it is necessary for me start/abort Fetch cycle on boolean control, i.e. then when it is necessary. 
    And one more condition I wish to adhere Fetch cycle at least approximately by 1st second (in my example and it turns out).
    Further, it agree my example, I consider quantity of second cycles and accordingly I understand, that Fetch have accepted so much that data for so much that seconds. Boolean control is in position true a certain interval, from 1st till 100 seconds.
    The postprocessing cycle (detecting of peaks) lags behind a fetch cycle for 1 second approximately.
    My example works, but it is not always correct (as it seems to me), i.e. sometimes fetch works once again than it is necessary, or on the contrary it is less.
    I consider, that where that in a code I have broken sequence Fetch and Abort. 
    I ask you to correct a code as consider it necessary (there it very little). 
    In other words, I need somehow programmatically to distinguish, that postprocessing of a current interval of gathering (from 1st till 100 seconds) stopped and to make by this criterion some actions. 
    I don't want to use any timers, there can be a turn/semaphores or new queue, etc. will help??
    Sorry for my English. Please, advise me.
    Message Edited by Current 93 on 11-17-2009 06:04 PM
    Attachments:
    8ch_I8_bool_control_reset_before_fetch.vi ‏43 KB

    There are numerous issues with this code.  Here are the things you can do to make it much better:
    The enqueue in the top loop needs to be inside the Waiting case.  It will feed empty packets to the analysis loop when waiting.  This is not good practice.
    You have not implemented a way to stop either loop.  The previous suggestion for the top loop would probably work for both, since closing the queue will cause the bottom loop to error and exit.
    Your code for "x+y" would be better handled with a shift register.  Better yet, simply wire it to the iteration terminal on one of the loops.  The bottom shift register on the top loop is a reimplementation of the iteration terminal output.
    You could use an event structure for handling changes in things like the channel.  However, this would complicate your code quite a bit, since it would require a state machine wrapper on your analysis code and another loop for the event structure.
    The implementation of "texp" makes the top while loop into a FOR loop.  If your LabVIEW version is new enough, consider using a FOR loop with a conditional terminal (abortable FOR loop).
    See what you can do and post your results.  If you get stuck, let us know.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Imitate boolean switch behavior using an event structure on a front panel indicator

    Hi,
    I am looking for a possibility to imitate the bevhavior of a boolean switch with an event structure. To be more precise, I want a boolean value to change each time I click on the front panel indicator and then remain constant until I click again. I have not worked with shift registers in a while loop yet, but could this be a way to find a solution?

    LordSnow wrote:
    Okay, I figured it out, BUT I still have a problem. Before I first trigger a mouse event on the front panel indicator, I already need the case structure to be executed once. Therefore I assume that I need some kind of default value, but since the event structure does not create any output at first, I have no idea how to do that.
    Are you talking about the shift register you just created?  You can while in a default value on the left shift register ndoe.  It is wired outside of the loop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Using an event structure to register many actions

    Hi there,
    I'm making a simple game;
    4 player game.
    Each player gets a led that flashes at random and a button to hit when the LED is on. But it is only on for 500 milliseconds.
    I’m having troubles with it. i think i need a case structure in the 3rd case of the main case structure?
    at the moment points are awarded if the button matches the LED. i.e. both on or both off.
    Any help is appreciated
    Attachments:
    buttonbash v1.vi ‏17 KB

    First, let's clean up some of the Rube Goldberg code.
    (You don't need a case structure to output a True or False boolean.  Just use the condition.)
    As for your code, I don't know where to help.  You talk about an event structure, but there aren't any in your code.
    Attachments:
    buttonbashV1.vi ‏12 KB

  • Using an Event Structure to sense selection of a ring control

    LabVIEW version 6.1. Windows 2000. I am trying to develop a robust approach to sensing when the operator presses the lighted boolean push button to initialize a VI procedure. Presently I am using an User Event Structure. I have tried triggering on a 'value change', and 'mouse up'. Either one works properly the first time, then hangs on the second invocation of the button, with the push button LED light on - with no action - the event fails to trigger?

    In article <[email protected]>,
    new_user wrote:
    > Hi,
    >
    > Yes I will gladly post my VI.There are (2) block diagrams. The
    > 'setpoint' ring controls should invoke the upper block diagram in the
    > event of a selection.
    > The lower block diagram should be invoked when the 'Initialize
    > Displays' push button is pressed. It is turned off upon successful VI
    > execution.
    > Both are exhibiting the same symptom - only first time execution?
    Well they aren't in a loop so they are both wating for an event. Each
    one will fire once and then exit. There should be only one event
    structure and it should be inside a while loop. The loop should
    terminate when the stop button is pushed
    and fires the stop button value
    changed event.
    So, make the bottom event one of the events in the top structure and put
    the whole thing in a while loop. Make a stop button and make another
    event case for the stop button value change, wire the new value property
    to the loop stop terminal.
    Also you are using the value of the INIT button before it changes (ie
    the old value). That value is read before the value change and passed
    into the event loop. Move the init button to inside the event structure
    value change for the init button.
    Get rid of the local variable in the lower sequence structure in the
    init event case. There is no need for it. In fact get rid of the
    sequence structure entirely it is not necessary to force a sequence on
    those actions which should be optimized by the compiler.
    -Scott

  • How to use a event structure with a state machine

    First, I would like to inform you that I only work on LabView part time, and have much to learn.  Anything I do learn, I usually forget until I need it again, because I only work on it part time.
    Using your StopWhileLoopMOD[1].vi, I am trying to put a state machine inside the event structure.  
    Related link: http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loop-in-Event-case/td-p/465564/page/2
    Here is my application:  on the front panel, the user can select any combination of 7 different tests.  I have created cases to perform each step of each test in the correct order, but if the user presses stop, the tests won't stop because some of the cases have a while loop inside the event structure (like you mentioned is a bad idea).  The user should be able to stop the test, reselect tests to perform, and re-start the tests. 
    When the start button is pressed for the event structure, I need all the cases to run in the proper order, unless stop is pressed.
    In the past I have indexed an array and used that to run the state machine, but it won't stop immediately.  
    I have sub VIs that are built in while loops because the outputs of the product needs time to stabilize.  The state machine stops and waits up to a certain number of iterations.  If it passes the test, the while loop stops and the next state starts.  If it takes too long, it exits and reports an error.  Maybe I need to just use the state machine and not an event structure?
    Is there a good example of an event structure?
    metzler CLAD
    Solved!
    Go to Solution.

    I'm not sure exactly what you are asking, but it sounds like you want to script a bunch of tests and if the user says stop, to immediately stop the current test and abandon the others?  I'm going to assume that you know how to clear the array so that it will abandon the others, so I'm guessing that you are having trouble abandoning the current test?  If this is indeed the case, then the problem is that you are not able to propagate the message from the main VI FP which is the GUI to the sub vi which is the test, where the test may or may not have a GUI (FP visible) of it's own.  Threading was the first thing to come to mind, but this may not be necessary using events.
    You can do this by passing a refnum of the stop button to the subVI, where you can then add that wait to the event case structure.
    I've attached 2 VIs, mainvi.vi which is just a loop displays the count*2 (number of seconds passed since running) that will call subvi.vi and then check to see if the stop button is pressed.  mainvi.vi is by no means a state engine, it is just a simple loop for demonstration purposes.  subvi.vi just waits 2 seconds and leaves, it is a better structured state engine with an init state to start a poll case to wait for events and an exit state to clean up.  You can modify this any way you wish to get it to do what you want.  You will note that even if subvi.vi is being executed, it will terminate immediately when the stop button is pressed.
    Hope this helps.
    A
    Attachments:
    mainvi.vi ‏17 KB
    subvi.vi ‏33 KB

  • I am using many events structures in my applicatio​n,but i am getting caught in my problems ,can any body tell me abt events programmin​g on time out

    i have extensive gui application ,i am using events ,but i am caught,i want to konw abt events ,there pros and cons,time out ,how to program in time out

    It is unclear as to exactly what you are asking. The event structure is very handy for monitoring front panel activity and performing tasks accordingly. The default event in the event structure is the timeout. In order to set the timeout you just wire the amount of time before timeout (in ms) to the timeout terminal of the structure. You may have tasks that you want to perform at timeout or you may just have an empty case. I strongly suggest using a timeout and putting the case structure in a while loop in order to keep monitoring the events until the loop exit condition has been met.

  • How can I determine whether to use an event structure or a case structure?

    I'm starting a large project and need a state machine. I can't decide on whether to use a case structure or event structure. Is there an article  or other information that describes criteria for selecting between the two approaches?
    Thank you,
    Chuck
    Solved!
    Go to Solution.

    Hi Chuck,
    Well case structures and event structures differ quite alot.  Here's a link for indepth information on Event Structures, and using them in state machines: http://zone.ni.com/devzone/cda/tut/p/id/2962.  Hopefuly this will help you make up your mind.  
    Let me know if you have any questions after reading it. 
    Regards,
    Dominic Walker
    Cardiff University
    Electrical and Electronic Engineering Student

Maybe you are looking for

  • Iphoto 8 moving photos into trash bin!! Help!!

    When I try to import photos from my digital camera to iphoto the pics get put into the trash bin and it will not let me put them back. Its not the iphoto trash bin, its the desktop trash bin. I can see them in there and when I right click on them and

  • In FGI4(report painter) not finding predefined key figure BILWERT

    hi, I am trying to create a report using FGI4. But when i am selecting predefined element & trying to choose key figure which are coming dynamically from structure GLFLEXS(Flexible General Ledger Reporting), there i am not getting BILWERT(Balance she

  • E rec 600 - APPLY_DIRECTLY

    Hi All, We have upgraded 4.6c to ECC 6.0 SP11 (technical). We are in process of implementing E-recruitment for internal job postings. E-rec 600 is installed on the same server of ECC. We are using structural authorization profiles for all our employe

  • Exception occured while reading the license file.

    Java Exception: java.lang.RuntimeException Exception occurred while reading the license file. java.lang.RuntimeException: Exception occurred while reading the license file. at weblogic.security.utils.SSLSetup.getLicenseLevel(SSLSetup.java:143) at web

  • How to findout rows which are not null ?

    Hi friends, Can anyone tell me how to find out the no of rows which is having full data in each column (not null) ? Ex:- TEST_TABLE having 1000 columns and lakes of rows. myQuestion:- I need to find the no of rows which are filled with 1000 columns f