Panel Close? Event causes front panel to be unresponsive

I'm trying to create a simple program. There is a while loop that generates random numbers just so I can see it's running. An "Exit" button is wired to the exit terminal of the while loop. An event structure is also in this while loop, which catches "Panel Close?" and discards it, then wires true to the exit terminal of said while loop. To be more specific, the exit terminal takes an OR statement that takes the Exit button and this Event Structure boolean as inputs. However, when I run the program, the Exit button doesn't respond, though with highlight execution the event structure part of the program seems to be working. Sorry if I'm bad at explaining, any help is appreciated.
I guess my real question is, how do you properly implement that an exit button stops the loop and clicking the red x or File:Close is ignored and instead does the same thing as your Exit button.
Solved!
Go to Solution.
Attachments:
ex1.vi ‏10 KB

For applications that require a user interface I prefer to use a producer/consumer architecture. The producer loop with the event structure essentially does nothing but deal with the UI. It will process UI events as well as provide the ability to update the UI. The consumer loop(s) do the actual work. These loops are generally some form of a state machine but they allow messages to be passed from the producer loop for control purposes. Most common are start, stop and exit events. This type of approach allows your UI to be very responsive to user input. Even though your application may take time to shut down cleanly you can immediately let the user know you are going into shut down mode. They know you receive their input and are working on it. This prevents them from pressing the stop button multiple times. If your shut down does take a very long time make sure you provide regular updates to the user informing them you are still running and not simply hung.
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

Similar Messages

  • Open and close a vi front panel dynamicall​y

    I created a main vi panel that display all the signal names.  I like the main vi to open a new plot screen when I double click on the signal name.  I was able to do that using invoke node. But I when I close the plot screen by clicking on the Window "Close" button, the main vi was not able to open a new one again.  So I disabled the Window "Close" button and only use the "Stop" button coded in while loop in the blockdigram of the plot screen.  It worked, but the plot screen is still open and changed to editing mode.  Is there an easy way to close the plot screen by only one click.  Another question is that how does the main vi can open multiple plot screens.  Thanks for your advice.

    I think I know what happens:
    If you close the front panel of a sub-vi, the code is still running, so the VI doesn't terminate and somehow you can't address it (it don't know how you communicate with your sub-vi).
    So in your sub-vi you should monitor the panel-close event, and finish the code of the VI and finish the VI
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • How can I close a remote front panel by closing only the browser window?

    I control a remote front panel in a browser (from the client PC). If I don't use the 'close' - button in my program to end the remote front panel, but instead of this the 'x' of the browser window (in the right bottom corner), my program won't be close, it continues on the server. Do you know how to end a VI by closing only the browser windows?
    Thanks for any help!
    wolfe

    I found the examples. Thanks.
    But I could not find a solution yet. Now I know how to end a VI by clicking on the x of the VIwindow.
    My problem is, to end a VI by clicking on the x of the BROWSER window after I loaded and controlled a remote panel VI in a browser (e.g. IE).
    If you have any ideas ... I'd be happy.
    Thanks for your help.

  • Event structure front panel lock

    hi, I have a mouse down event for pushbutton on the front panel to trigger an event. The event structure is under a while loop. However, I checked 'lock FP during the process' but the pushbutton actually registers the mouse click. i.e. once i click the pushbutton during the event(which is supposed to be locked), the event will be triggered again automatically after the current round.
    Does anyone know how to fully lock the button? I even add in property node to disable the button in the beginning of the event case but it doesn't work as well.
    Thanks a lot.
    Cheers,
    SSR 

    Hi,
    The option is to 'Lock the front panel until the event case for this event completes'. If you have this checked, then all other controls are locked until the event triggered by the mousedown completes.  It does not prevent the event from registering in the first place. The mousedown will still register and it's event code will execute regardless if this checkbox setting (unless another event is being processed at the time).
    Mousedown also registers if you disable the control either programatically or via the menus - you need to change the event to 'Value Change' instead of Mouse Down. If you do this and programatically alter the enabled stated of the control, you can control whether the event is processed or not.
    HTH
    Steven
    edit: stevem181 beat me to it and in fewer words too
    Message Edited by Steven_G on 11-02-2009 10:33 AM

  • Close top vi front panel while sub vi front panel run

    Hello,
    I'm writing wiring a program and  have several (several several several .. ) VI which launches Sub-VI with their front panel.
    During there Sub VI, the Front Panel of the Top-VI get bored behind...
    Is it possible to Hide this Front Panel while the sub-VI is running.
    Thanks
    Solved!
    Go to Solution.

    Sorry for this post, i didn't read every replies of the folowing topic :
    http://forums.ni.com/t5/LabVIEW/closing-front-panel/m-p/300115
    The VI of falkpl :HideFPvi.vi 24 KB is a very good method for my VI.
    Sorry again, hope this'll help someone

  • Reference to control on main front panel fails when subvi front panel is closed?

    Hi All,
    I'm experiencing an odd bug. In my code, I use a subvi to control a piece of hardware. This subvi has controls for all of the functions of my hardware.
    I'm changing the value of one of these controls from my main front panel by running a reference to a knob on my main front panel into the subvi, grabbing the value of the knob with a property node, and then updating the value of the subvi control using a signaling property node.
    This works fine when my subvi front panel is open but fails to work at all when the subvi front panel is closed.
    I'm new to labview , so any help is appreciated.
    Thanks,
    Arpan
    Solved!
    Go to Solution.

    What is your LabVIEW version?
    Front panels that are not shown are typically not updated and might not even be loaded into memory.
    The presence of certain code elements (e.g. property nodes) often forces the front panel to be in memory even if it is not shown, but I haven't studied it in a long time so there might be subtleties. Maybe somebody from NI can give more details.
    If it does not work unles the FP is open, open the front panel minimized to avoid distraction.
    Can you attach some code? Maybe there are better ways to do all this anyway.
    LabVIEW Champion . Do more with less code and in less time .

  • How to hide front panel objects behind other front panel objects

    Hi,
    I need tho change an existing project and to make it simple just want to hide some front panel objects behind others. But I can't find how to put the one I wnt to the front hiding all others. So now there are some in front that should be hidden.
    Is there a button or menu item "Move to front / back" like in many other programs?
    Thanks
    Martin
    Solved!
    Go to Solution.

    Hi Martin,
    what about the link I provided in my previous post? What else do you need?
    What about the chapter "fundamentals" in the LabVIEW help?
    Going the way "Fundamentals -> Building the FrontPanel -> How-To -> Reordering Objects" seems rather logically to me…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Z87-G45 Audio Issue - Back panel jack is staticy, front panel is perfect

    Hi,
    Experiencing this weird issue with this board - up to date drivers on BIOS, Realtek and everything else. The back output jack of the board has trouble with higher frequencies and will produce static / corrupted noise reproducing higher frequency sounds (e.g. the Windows speaker tests). The frontpanel jack is perfect and reproduces everything. My "work around" is currently to use the FP jack, but I would like to fix the backpanel (same speakers).
    Any ideas?

    You wouldn't believe it.. But I RMA'ed my board last week and got replacement on saturday.. Not only does I still have random ass DPC latency spikes all over the shop, rear audio jack is broken as per OP's. Left channel produces almost static while Right channel is fine and Front jack works fine, it would appear MSI's QA seems to be slipping on this board judging by various other posts of usb/audio/dpc latency spike threads.

  • Close Front Panel

    Is there a way to close the VI front panel from inside the VI? I can
    trigger an exit of LabVIEW itself, but can't find an event to close
    the front panel.
    Thanks.

    First off if you are going to build this into an exe then don't worry about it. but if want to close the vi programmatically then here is an example.
    Hope this helps you out
    Joe
    Joe.
    "NOTHING IS EVER EASY"
    Attachments:
    Untitled.vi ‏20 KB

  • Main VI Menu event calling a subVI front panel

    Hi all,
    I have a subVI whose front panel is loaded upon calling by a main VI.
    I call the subVI using a User-menu event.
    the subvi-properties are set to allow close window and i am not handling a 'panel close' event.
    The problem is....
    when i run the main VI and click on the menu that loads the subVI front panel, subVI window opens, and if i click on the window-close, the main VI hangs.
    i understand that the control remains with the subVI only and never returned to main VI after i close subVI panel.
    but is it the only way to handle the 'panel close event' or any other way out to solve this?

    Try running the VI with highlight execution turned on, and see if anything unexpected is happening, or you could post your vi and let us take a nosey
    Message Edited by yenknip on 09-12-2008 04:30 PM
    - Cheers, Ed

  • X Control Exec State Change with Panel Close

    I have an X Control that launches VIs dynamically and loads them into subpanels. If I put this X Control on a VI front panel and that VI has its panel closed, but that panel close event is unhandled so LabVIEW takes the default panel close behavior, the exec state change never fires. If I reopen the VI however, it is stopped. Because of this, my shutdown user event which is sent in the Exec State Change event case never sends and my VI is left running in the background. 
    Of course, I know the panel event should be handled, but this is about robustness of my X Control, not the panel close event handling. Is there any way I can capture this specific case?
    CLA, LabVIEW Versions 2010-2013

    DevonR wrote:
    Hi,
    Thanks for sending in the code.  Have you tried implementing an event structure?  With an event structure, you can set the event to, “Application Instance Close”, so that you can execute some code when a user executes the Quit LabVIEW function.  Please see attached screenshots.
    Devon R.
    Applications Engineer
    National Instruments
    This doesn't work because if you close an owning project but not LabVIEW, the refnum goes invalid. However, I got an answer from here that lets me know what I needed to.
    CLA, LabVIEW Versions 2010-2013

  • SB X-Fi Titanium Front Panel not working

    Hello,
    I would like to fully use the Front Panel, because I own a 5. Surround sound system blocking all the backpanel slots. The problem is, that I simply get no sound from the front panel sound output, while the microfone works just fine. Is there some kind of special option to enable it's
    The FP is properly plugged into my SB X-Fi Titanium. And it's also not broken, because the FP works perfectly with my onboard soundchip (though it seems to cause crackling in my headphones, so I cannot use it for it).
    ... Okay now the Mic FP is not working aswell, eventhough it did when I tried it the last time. I set everything I could, like choosing Headphone Mode, enabling FrontPanel everywhere and all that. So why is it still not working?
    RIG: Win XP 32bit
    Asus P7p55d
    Creative SB X-Fi Titanium
    normal Stereo Headset
    Thanks in advance for any help!

    Ofcourse that was something I did not know before I bought the soundcard. I am quite sure it is an AC 97 Front Panel, but how can I verify that?
    Seems like I will have to sell this soundcard.
    - The plugs from my 5.1 sound system are quality plugs and are rather big and so they barely fit, because the audio jacks (not sure about the correct english term here, i mean the holes from the soundcard, where you plugin the soundsystem) are sitting way too close together (expected more for that price..).
    - It doesn't support my Case's Front Panel.
    - And the soundcard is sitting directly before my Graphic Card's fan (because it uses PCI-E), causing heat.
    I guess there is no way around it. I will probably get a new graphic card at christmas and it's most likely going to be bigger than my ATI 4850HD. And I simply do not have the space for a bigger graphic card AND a soundcard, that uses PCI-E. So I guess the best solution is to sell it and buy a soundcard that uses normal PCI and supports AC 97, right? Or what would you recommend?
    Until then, is there an easy and cheap way to upgrade my ac97 front panel to Intel HD Front Panel Audio?
    thanks

  • How to open front panel of a VI running in RT.

    Hi,
    I have an application to read the encoder position using the cRIO program. I have made an executable and this application runs as startup application whenever the controller reboots. Right now, i am accessing the VI of the startup exe through Remote Panel connection. This works fine but everytime i close the remote panel , i have to reboot the controller for the next view.
    So is there any alterntaive to open the front panel of the VI.
    I tried using VIServer but ran into errors. (i tried using front panel -open property node.did not work)
    Also i do not have any VIs stored on the controller. Only the exe is stored on the ni-rt/startup folder on the RT controller.
    Please let me know how to open this VI.
    Thanks.

    Hi Ben,
    When i close the remote front panel the first time, i am terminating the RT VI which is running on startup.
    So i had to reboot everytime to access the remote VI.  I guess that the VI (exe) should be continuosly running when the RT is started up. The remote panel only should be opened and closed. After I close the remote panel , i want a windows VI to be opened up.
    I have a Windows VI which programmatically opens connection to the RT server for opening the remote panel. The VI runs. When the user clicks Exit on this RT VI, the VI running is stopped and then another windows VI opens up. This works fine for first time. Since the RT VI is terminated, second time , if I run, it says, VI not in server memory.
    Is there a method to close the remote panel programmatically in the RT VI itself. I have a Exit button in this RT VI, so if the user clicks, Exit, the program has to be running, but the remote panel has to close. There is a method called close connection to client , but this does not work in RT , as this requires VI path.. Right now , when the remote panel RT VI is launced, to close the remote panel, i click on the 'close' button on the VI title bar. Again when the remote panel is launched, there is no error. but is there a method to close the remote panel in the server(RT VI itself).   i have attached the VI.
    Thank you.
    Attachments:
    Dummytest.vi ‏39 KB

  • Front Panel Controller SubVI?

    Here is the scenario, I have a main VI that uses an event structure to call various other SubVI's depending on what control is pressed and to update the front panel accordingly.  The front panel of the Main VI is a Tab Control with ~25 controls total.  As you can imagine, some controls should not be enabled until other events happen.  For example, I have a menu ring called "Report Type" of which you can choose 'HTML' or 'Send to Printer.'  Next to this ring is a boolean control called "Open in Browser?" , I want to only enable this boolean control only when "Report Type" is set to 'HTML.'   Likewise I want both the "Report Type" and "Open in Browser?" controls to be disabled if the user has not hit the "Download Data" control to get data from the RT Controller (otherwise there would be nothing to report.) 
    These are just a few examples of what I need to do, I have been adding 'Disabled' property nodes throughout my event cases but it is becoming very unwieldy and making my block diagram quite cluttered and hard to understand.  What I want to do is have a 'Front Panel Controller SubVI' of sorts, of which I define about 10 or so various states the front panel can be in and pass that state to the controller SubVI which in turn disables/enables controlls accordingly.  This idea sounds good but so far the implementation seems pretty bad.  I was hoping I could just make a cluster of control references and pass that into the SubVI but LabVIEW 8.2 doesn't seem to allow me to wrap up references in a cluster.  This has forced me to use VI Server to get the references.   What I've been able to come up with using VI Server works, but I can't believe its the most elegant solution.  Basically, for each of the possible states, I iterate over all the controls in the front panel and have a case structure for their Label Text which determins if that control should be enabled/disabled for the given state passed in.  Also, for some reason it seems that it is not grabbing references to ALL of my controls.  There is a menu ring control on the front panel that isn't in the Controls[] array.  I should mention that this particular Control already has a reference node created for it that gets passed to a SubVI, perhaps this is why its not found in the Controls[] array, but this doesn't seem to be very intuititve, or documetned for that matter.
    <a href="http://tinypic.com" target="_blank"><img src="http://i37.tinypic.com/fjgwtv.gif" border="0" alt="Image and video hosting by TinyPic"></a>

    Thats a very good idea, although I'd probably want to put a case structure around the disable property node and have it only change value when the search array function does *not* return -1, otherwise I'll be disabling things I might want to maintain in an enabled state.
    Just before I read your post, another thought came to me and that why use a SubVI, I could just use a parallel loop with queues to send back state information.  Since queues can be blocking, this would not negate my event structure.  I could combine the idea you gave me with this architecture.  Thanks

  • Show LabVIEW VI Front Panel When Sequence Step Called

    Hello,
    By clicking on the “Show VI Front Panel When Called” checkbox in the Step Settings pane displays the LabVIEW VI Front Panel for approximately 100 milliseconds. Is there a configuration way to display the VI front panel for a longer period of time, during that step execution, and allow the user to control the duration of the front panel exposure by clicking to resume execution of the sequence file at their will?
    Thank you.
    Solved!
    Go to Solution.

    Hi,
    You will need to have some sort of structure in your VI for handling front panel response, otherwise you front panel is only going to be visible for as long as it takes to execute an return back to teststand.
    But remember, once you hold your step within that VI which is waiting on the operator to eventual close it, your Sequence will be held as well and if you are expecting steps to continue running after your VI then you will have to consider running it in parallel to your main test sequence.
    You may also need to consider what happens if you want to terminate your Test Sequence, how do you close your VI.
    Check out 'Strategies for Terminating or Breaking Sequences' in the following.
    hope this is of help
    Regards
    Ray Farmer

Maybe you are looking for