LabVIEW 2012 while event structure cannot stop

I am trying LabVIEW 2012.
An example of while-loop with Event structure inside cannot be stopped with the boolean stop button.  Any thing wrong?
Please see the attached VI.
Thanks.
Solved!
Go to Solution.
Attachments:
Close VI prompt.vi ‏9 KB

Yep, something is wrong. You need to add a event case to detect a value change on the stop button.
The thing is now your event structure keeps waiting for one of the event that it handles, and ight now it only handles the "panel close" event, the "timeout" event is handled too but since you haven't connected anything to the timeout terminal (top left corner of the event structure) the timeout is -1. So when you run the VI the while loop is stuck in the first iteration and waits for a panel close, the stop button will only be taken into account after the even structure catches an event ; I think this is because LabVIEW will execute code linked to the stop terminal of the while loop only after all the rest of the code in it has finished executing.
Hope this helps
When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

Similar Messages

  • What are the Dynamic Events avaliable in the LabView 6.1 Event Structure?

    I recieved LabView 6.1 recently and I am working with the Event Structure, and I'm trying to figure out what Dynamic Events are avaliable in the event structure, and how to access them. If you don't understand what I'm talking about, open a new VI in LabView 6.1 and drop an event structure on the diagram. Add an event and look at the dialog box that appears on the screen, specifically the Event Sources section. The third option in this area of the screen is "grayed out" but reads "Dynamic". I'm curious what these events are, and how I access them. I'm running WinNT 4 SP6.
    Thanks,
    Chris Davis

    I believe this is part of a feature which is not yet present in LabVIEW 6.1, but may be present in a future release.

  • LabVIEW user interface event structure "priority"

    Do Pane events get processed first and then control events?
    I have a VI that checks a value change of button that is latched and it also checks for the mouse down event on the Pane.  I noticed that the Pane event gets processed and then the value change of the button.  This is not too critical at this point for my project but was curious if this is on purpose.
    Attached is a VI that does this.
    Attachments:
    Pane vs Control Events 2014.vi ‏11 KB

    When debugging what event occures in what order, I usually find the Event Inspector Window helpful.  It basically tracks the queue that LabVIEW uses and shows the order that events are generated and handled.
    http://zone.ni.com/reference/en-XX/help/371361K-01/lvdialog/event_inspectorwindow/
    https://decibel.ni.com/content/blogs/Sixclear/2013/11/04/vi-high-51-event-inspector-window-flushing-...
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Front panel locks with event structure loop and another while loop

    Hi,
    Why is the front panel locking after changing the value of the "boolean switch" twice? This problem disappears if I uncheck the "lock front panel" option in the event case. However I don't understand why that is the case since the event structure loop has already finished executing.
    thanks

    Do you really want the event handling to stop after detecting the first event? If so then as Christian says the event structure will cause the front panel to lock. What you can do is dynamically register and unregister the events. You right click on the event structure and enable "Show Dynamic Event Terminals" Then  you can programatically register and unregister events.
    Here is your vi modified to do that.
    Edit: Just in case - right click on the control and create a reference. When selecting the source of the event in the structure look under the dynamic section.
    =====================
    LabVIEW 2012
    Attachments:
    event structure test.vi ‏13 KB

  • Labview 2013 cannot use event structure

    Event structure can be added into the back panel, however when i add event case or try to edit the default event case, the program is crask and cannot response to my mouse. 
    when i launch windows task manager, it present " running" properly.
    However this program run properly at my another computer with sample Win7 OS.
    Can anyone tell me what the problem is?

    Aaron1978 wrote:
    sir, this issue does not related to code, even i create new empty VI, the event structure cannot work properly, i cannot add new event or edit the default even!
    However, i installed the same eval version into my another computer, this event structure can work properly, both computers use same Win 7 OS.
    Okay in that case I would recommend a repair install of LabVIEW.  
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to exit from the DO-while loop in the event structure

    Hi all
    I am just a beginner for Labview
    I want to build a loop in the event structure, but when I enter in the loop, it seems the system is dead, and I can't exit the loop.
    here I attached a simple sample.
     In the sample.  when I press the start_calculation button , the calculation start, but the system is dead, and I can't exit calculation loop.
     actually, i just want switch the different operation by changing the event action.
    anybody has a good idea about it??
    thanks so lot
    Attachments:
    event_problem.vi ‏17 KB

    Your problem is that you are trapped inside an event case. It is not a good idea to run extended code inside event cases, else the event structure cannot service other events.
    Why don't you use the outer loop for everything? Now things don't step on each others toes. What good is an event structure if it cannot react at all times???
    Message Edited by altenbach on 07-25-2008 12:26 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    event_problemMOD.vi ‏17 KB

  • How to control the tab control using event structure?

    Hi,
    I am using tab control and event structure in the program.
    When i run the application event is not happening for the active page.
    When user switches from active page to the other page then event is taking place for all pages
    So, how to get the event trigger for the active page when the application is started
    For more clarification i am attaching the code "Test Control Tab using Event Structure.vi"
    Attachments:
    Test Control Tab using Event Structure.vi ‏52 KB

    You have a basic misunderstanding of dataflow. Maybe you should start with some tutorials or study some of the examples that ship with LabVIEW.
    The event structure belongs inside the while loop, and not vice versa. RIght now, the event structure only runs exactly once and never again.
    If the stop is pressed first, the VI will stop. Game over.
    If the tab control is changed (from any state to any other state!), the inner loop will spin forever as fast as the CPU allows, either executing one or the other case. It just reads the tab terminal to decide which case to execute. Changing tab never triggers any events. The VI is trapped inside the event until stop is pressed to stop the VI.
    you were closer to a reasonable program in the other thread:
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=287905
    Have you tried execution highlighting? Maybe things would become more clear of you do.
    LabVIEW Champion . Do more with less code and in less time .

  • Questions from a rookie about event structures

    Hello,
       I am currently scheduled for Labview classes next month,
    so I want to apologize in advance for "dumb questions". I have created
    a program that is starting
    to be a CPU resource hog. The majority of my program is inside a while
    loop so that the program will "react" to changes in controls, etc. I am
    assuming that
    if I incorporate "event structures" in my program that my program will
    not be a resource hog.  Is the use of event structures the correct
    way to go? If using
    event structures is the correct way to go, what is the best way to
    learn how to incorporate "event structures"?  I am assuming that
    the examples in Labview will show me how. Are there any good reading
    materials about event structures?
    Regards,
    Kaspar

    To fix the CPU resource issue, you need to place a small wait statement in your loop. It will solve two problems:
    Slow down the loop (you don't need to check for UI changes more that 10x/second)
    It will allow other, parallel tasks a chance to run after each iteration. Without a wait, it will hog the CPU for 55ms before releasing control.
    If your loop currently spins one million times a second and you would place a 1ms wait, the CPU would go from 100% to 0.1%!
    The event structure is a fantastic tool to solve most UI issues and it makes the diagram automatically simpler, more self-documenting and easier to read. Have a look at some of the examples that ship with LabVIEW.
    The event structure is easy to learn, so dive right in. Read the online help for some important considerations. As a rule of thumb you should stick to a single event structure per diagram.
    LabVIEW Champion . Do more with less code and in less time .

  • Problems using event structure to write new parameter values to VISA

    Attachments:
    FMA_event_2.vi ‏28 KB
    FMA_event_2.vi ‏28 KB

    It seems I'm also having trouble using forums..not sure what happened...updated and corrected thread: http://forums.ni.com/t5/LabVIEW/Problems-using-event-structure-to-write-new-parameter-values-to/td-p...

  • How to use event structure of event data nodes event filter nodes in programming

    hi,
    I need manual of how to use 'event structure' events of 'event data nodes' and 'event data filters'...please help me....
    Regards
    Ravindranath

    I'm not really sure what you are looking for here.  Did you do a search in the LabVIEW help for Event Structure?
    The Event Data Node just returns information about the event, like control data, control reference, what caused the event, etc.
    The Event Data Filters are just used in Filter Events.  This allows you to discard an event or change the data that the event will recieve.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to stop While Loop in Event Structure with same button?

    Hello,
    I have a problem. I want to use one control to activate an event in a event structure, and the same control to terminate a while loop in that event.
    It is possible to use 2 controls to do this, but I need it to be only one.
    Thank you  
    Message Edited by Heinen on 02-19-2009 06:16 AM
    Message Edited by Heinen on 02-19-2009 06:20 AM
    The Enrichment Center is required to remind you that you will be baked, and then there will be cake.
    Solved!
    Go to Solution.

    Hello,
    I have a bit different problem.
    I have a tab control, with several buttons on different pages.
    In the current situation, we can talk about two pages, where one page ("Settings") in the Image, has a START and EXIT button, while second page ("Wait") has an EXIT button.
    In a while loop, I have event structure, which handles events of the START and EXIT buttons of the Settings page. This is fine. But I also want to control the Exit button of the Wait page.
    The control works like this:
    When I click on Start in the Settings page, the front panel shows Wait page and attempts to connect to a datasocket server on the remote computer. If the user wants to stop this process, he can click on Exit on Wait page too. But, this doesn't give any immediate effect. On the even of Start button, the front panel is not locked, so the user can actually click the Exit button on the next page when it's visible. But it's of no immediate effect. Means, what the LabVIEW does is, finishes the execution of event in Start button's click, and while this executes, it doesn't consider the Exit button's refreshed value (shown in Red circle in the block diagram).
    Simple question: Is there any way to check the updated (latest/live) value of a control during some event's execution? Or if I write an Event "Value Changed" for the Exit button and pass it to some variable. Is it the only solution?
    Thanks ahead.
    Vaibhav
    Attachments:
    terminate event_diagram.jpg ‏200 KB
    terminate event_front_1.jpg ‏63 KB
    terminate event_front_2.jpg ‏63 KB

  • How to stop a while loop of event structure from a main vi

    Hello;
    sorry for my english
    I have to stop a subvi from my main vi, the subvi contains a while loop and an event structure so I need to stop this loop while directly from my main vi I have tried global variable but it did not work
    any help please or example !!!   
    Solved!
    Go to Solution.
    Attachments:
    stop a while loop and event structure from main vi.png ‏16 KB

    IYED wrote:
    Hello;
    sorry for my english
    I have to stop a subvi from my main vi, the subvi contains a while loop and an event structure so I need to stop this loop while directly from my main vi I have tried global variable but it did not work
    any help please or example !!!   
    If this is an example of how your code looks, I'd clean it up before the developer who has to work on it next hits you over the head with his LabVIEW Style Book. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • While loop with stop button within event structure locks up front panel.

    I am not sure if this is a bug with my program or a bug within LabVIEW.  If you believe that this is a bug with my program then I will post my program to be looked at.
    The problem I am having is there is a while loop within an event structure that fires when a particular value changes.  Once the "Activate" button is pressed the while loop within the event structure starts going with a polling frequency of 1hz (1000ms wired to the "wait till next ms multiple" vi).  There is a "Deactivate" button that is wired to the stop control of the while loop and an outter while loop that resets the event structure so that the activate button is being listened to again.
    Once inside the while loop, however, none of the button are responsive within the front panel.  The VI continues to run, and only 60% of my CPU is being consumed, but none of the button or scroll bars work.  The only way for me to terminate the program is with the "Abort" button next to the "Run" button.  If I remove the event structure so that the while loop in question runs as soon as the program starts, the front panel remains responsive.  I've inserted probes within the while loop and verified that it is not running prior to the "Activate" button being asserted, and it is running after the assertion of the "Activate" button with the expected polling frequency set by the "wait till next ms multiple" vi.
    Can anyone help?  Do I need to post my code?
    -Nic

    It is typically not a good idea to stall an event structure by placing loops inside event cases. What good is an event structure if it is not free to repond to events?
    Have a look at some alternative solutions, such as in the following link:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=224817#M224817
    LabVIEW Champion . Do more with less code and in less time .

  • Event controll: How to stop a running while loop inside a event structure

    Hello,
    I have some problems with controlling a while loop inside a event structure (see attached VI).
    I habe 3 buttons ("Start Measurement, Stop Measurement, Quit Program"). When a measurement is running, it should be possible to stop the measurement by clicking on "Stop Measurement", but this does not work.
    Has anyone an idea?
    Thanks a lot and best regards,
    Michael
    Message Edited by MichaGue_01 on 04-23-2010 04:37 AM
    Solved!
    Go to Solution.
    Attachments:
    Event_Controll.vi ‏27 KB

    Hello,
    Try not to use while loops inside a Event structure.
    My approach is using two While loops (one will have only the Event structure).
    I had to use to Flag buttons that make it a bit more complicated but i am sure somebody will come up with a better idea, or you might want to have a think about it yourself.
    Have a look on the modified version on the attachment.
    Once you are happy how it works then you can Hide the 2 flag buttons from the Front Pannel by going to Block diagram right-click the indicators and choose option "Hide Indicators/Controls"
    I did it in LV 8.6 so i hope you can open it on your PC if not i can downgrade it.
    If you have any problem let us know.
    Regards
    Dimitrios
    Test Systems Computing Engineer
    Cummins Turbo-Technologies
    Attachments:
    Event_Controll[1]_modified.vi ‏18 KB

  • Stopping an event structure inside a while loop.

    I am relatively new to LabView, and especially the event structure. I have been looking at previous posts regarding the event structure and people having trouble stopping it. In my VI, I have two event cases in addition to the timeout. I am using this VI for stepper motor control. I have 2 buttons (for each case), one for movement to the left, the other to the right. It runs like it is supposed to, but when I try to stop it I have to press both buttons before it stops. As if the loop has to execute everything inside before stopping.
    In my VI, how can I make the execution stop when I press the stop button? I tried many setups of the stop button and boolean logic (which I believe was correct) but am now stuck.
    Thank you very much ,
    Alek
    Solved!
    Go to Solution.
    Attachments:
    motor control2.vi ‏24 KB

    OK, here's my simplified version. All you need is two event cases.
    Note that (with a tiny difference), the "left" and "right" cases are identical, so they can be handled in one event, reusing most of the shared code.
    We don't need a timeout event
    Just some extra tweaks...
    Message Edited by altenbach on 06-23-2008 05:09 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RightLeft.png ‏13 KB
    motor_control2MOD.vi ‏15 KB

Maybe you are looking for

  • Scheduling agreement - automatic delivery schedule line generation

    Hi, we assign our scheduling agreements in source lists with MRP indicator on 2 (Record relevant to MRP. Sched. lines generated automatically). As we don't know what the future demand pattern for the product will be, a longer validity date of the sou

  • Cannot record to tape

    Hello. I have a Canon Optura 60 mini dv camera. I can digitize and edit footage fine, but I cannot print to tape. I get no video image on my camcorder. I've tried all the suggested methods to troubleshoot this problem (refreshing av devices, show all

  • Manufacturing-admin still not working

    Hi everyone! I had no problem in getting SQL Trace up and running on my local Netweaver instance. However now I'm stuck getting SQL Trace running on our test machine. I followed the instructions given in the respective documents as well as the ones g

  • Reg:Cloniing Error

    Folks, we are facing below error: Error while running adlnkoh.sh. Please check logfile .end std out. /9.2.0/appsutil/install/adlnkoh.sh: line 198: /9.2.0/bin/sqlplus: No such file or directory .end err out. StackTrace: java.lang.Exception: java.lang.

  • JAVA ME version Open Source

    Hi, I am new to JAVA technology. I want to use open source version of JAVA ME along with CDC1.1 and FP1.1. Can you please provide me links to download these open source packages. I am planning to cross compile and use it on Linux. I hope I can downlo