GUI locking up, why?

The attached example VI replicates how my VI ended up, I know it needs to be completely redone but I'd like to know whats messing up here.  On running, if the user immediately goes to Page 3 the slider is unresponsive and so are the tabs.  This doesn't seem to be a race condition.  On starting if the user changes the slider, or goes to page 2 before going to Page 3 this doesn't happen.  So what is locking up the GUI.   Note on Page 3 the loop that is poling the slider is still working as the numeric is still being updated.  The GUI gets locked up other ways too.  I have also have noticed that on aborting this VI are restarting the GUI seems to be locked out until one of the event structures runs, at least that is what I think is going on but is not included in this example.
For those wanting the scoop before downloading.  There are three tab pages.  The controls on one are monitored by one event structure, it runs all the time.  Monitoring the controls on the other two pages are turned off and on with a change of the tab control using a case structure.
Attachments:
tab and event structure testing.vi ‏20 KB
just slider.vi ‏7 KB

phillman wrote:
From what my testing seems to show is that if the event structure is within a case structure, and even though the case that includes the event structure is never executed, the event structure is still activated? 
Why the question mark at the end if you tested and verified it yourself?
(The user interaction queues up the event in the event queue and locks the front panel (if so configured) and the event structure will handle the oldest event once it is able to execute.)  
phillman wrote:
It just seems to me that an event structure shouldn't be activated until it is actually executed. 
No, it's the other way around. You need to write your code with the knowledge in mind that events are aways queued up.
Without that feature you would not be able to write a useful program. What if a button is pressed while the previous event has not finished? What if a button is pressed while it is doing an FFT? Should it just ignore the button or should it service it once the event is available to be processed?
For more fancy requirements you can use dynamic event and register/unregister them depending on the program state. It is all possible, but requires significantly more code.
If you really think you have a much better idea how events should behave, please write it up and post it in the ideas exchange. If it is a good idea, it will collect votes.
(More information, for example read rule #1. Once the while loop has completed, the event structure is no longer in a running while loop, violating that rule )
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • GUI locks up when trying to read output from server

    I have a client built in MVC fashion and have two GUI views. One view is for output from the server and input from the keyboard. The other view is for changing connection settings and starting the conection. The problem is when I make the call to connect from the connection GUI it is able to connect and set up the streams but both GUIs lock up once I start trying to output the text received from the server. The strange thing is that when I call these methods just from the Model and not via the GUI and its actionListener the whole thing works. I think it may have something to do with the loop locking up the GUI but don't how to resolve this.
    public void monitorServer()
    try
    char inputChar = (char)fromServer.read();
    while (socket.isConnected()==true && inputChar >-1 )
    inputChar = (char)fromServer.read();
    if ( ( (inputChar >= '0') && (inputChar <= 'z') )
    ||(inputChar == '\n')||(inputChar == '\r')
    ||(inputChar == ' ') )
    String tempString = (""+inputChar);
    mv.addText(tempString);
    catch(IOException ioException)
    JOptionPane.showMessageDialog(null,
    "Error: Failed to read message. Corrupt data sent by server",
    "Connection Error", JOptionPane.ERROR_MESSAGE);
    mv.addText("\nMessage not read.\n");
    The code above is the bot that screws it all up. mv is the other view that it is outputting the text to.
    Please help! I'm gonna fail my degree. :)

    you need to run your server connection part in another thread.

  • My iPhone says "o death" where the date should be on the lock screen, why is it doing this and how do I get the date back?

    My iPhone says "o death" where the date should be on the lock screen, why is it doing this and how do I get the date back?

    I tried powering off and on and it went away, but I can't tell if it's been broken into since everything works fine (I'm using it now) is there a test to see if it's been broken into?
    Thanks for all your replies!

  • GUI lockes even though socket in in different thread

    I have a very simple GUI interface which is designed to simply display the data received from a server socket. The problem is that once I accept the client socket connection the GUI locks until the client socket is closed. This occurs even though I'm creating the socket in a new thread. What am I missing? Thanks
    The server socket:
        Runnable startServerSocket = new Runnable() {
            public void run() {
                try {
                ServerSocket srv = new ServerSocket(port);
                System.out.println("socket waiting");
                // Wait for connection from client.
                Socket socket = srv.accept();
                BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                System.out.println("socket got connection");
                String str;
                String text;
                while ((str = rd.readLine()) != null) {
                    outputArea.setText(outputArea.getText()+str);
                    System.out.println("got msg");
                rd.close();
                socket.close();
            catch (IOException e) {
                System.out.println("Exception: " + e.toString());
    };The socket is run in this manner:
    Action onaction = new AbstractAction("On") {
            // This method is called when the button is pressed
            public void actionPerformed(ActionEvent evt) {
                SwingUtilities.invokeLater(startServerSocket);
        };Any help you could give me would be very much appreciated. Thank you

    This occurs even though I'm creating the socket in a new thread.Actually SwingUtilities.invokeLater causes your Runnable to run in the Swing event thread, which is exactly what you want to avoid doing. Try this instead:public void actionPerformed(ActionEvent evt) {
      new Thread(startServerSocket).start();
    }

  • Upgrading to IOS 5, no camera icon on the lock screen why?

    upgrading to IOS 5, no camera icon on the lock screen why?

    put your finger on the photo frame icon and slide up. 
    i.e. the camera opens in a "reverse notifications" style in ios 5.1

  • GUI  locking.

    I need help !!!!
    I have an java Applet that call web services.That applet has a button wich when is pressed it send a request to the SOAP server.The request is an asynchron call because we are invocating a web service wich will return some results. When I make the call the soap server before of send the response to my applet it send a RPC call to a thread listener that I have runing in my applet. That listener is listening for request in a port . My listener got fine the soap server request but an acction wich the listener must to do is display a dialog message . The problem is that because of the applet GUI es locked waiting for the SOAP server response the dialog shows locked again an it is disabled. the soap server would expect for a response from the listener buto as the dialog shows freezed the response cannot be send to the soap server. after some time the soap server get timed out and send the response to the applet sending a error code. The question is somebody knows how can i display a dialog in a Applet when the GUI is locked due to is waiting for a IO operation be completed ????'
    I will tank you very much for your help.

    more threads. have the soap request in one thread, the response listener in another thread, and the GUI dialog in another.

  • Locked file - why?

    I am creating an image in Photoshop CS6. I've saved it a few times but now it's telling me the file is locked. I resaved it as something else and now the original file has vanished!
    I looked at the properties of the file before it vanished and clicked the security tab and it told me I didn't have permission to view it and I had to be an administrative user, which I am. It gave the option of giving myself permission and said the previous owner may no longer have permission but there was no previous owner listed (obviously because there never was one).
    These files are very important, I can't risk them just vanishing or locking me out. Why is this happening and how can I stop it?
    Thanks

    I can't help with permissions, but if you want to see which program is 'locking' your file, you can try Unlocker:
    http://www.filehippo.com/download_unlocker/
    Once installed, right click the file to run Unlocker. From there you can see which programs/processes are accessing, and can unlock the file.
    I find InDesign locks folders, even after closing the file within that folder. I have to close InD to rename or move the folder...
    On-access virus scan can sometimes cause issues too - add a scanning exclusion for psd files perhaps...

  • Oracle XE GUI locks up frequently

    Hello,
    My Oracle XE 10g GUI (browser) keeps pending endlessly in the status bar (processing the SQL statement),
    after I did some statements (be it DDL, DML or a simple select). It makes me think there is an implicit lock going on,
    though when I go to the locks screen, I see none active. I do see various sessions active.
    I simply do this (nr 1):
    SELECT *
    FROM emp;
    I press turn autocommit off and I press ctrl+enter.
    I get the full emp list as expected.
    then I do this (nr 2):
    SELECT ename, sal, hiredate
    FROM emp
    WHERE empno = 20;
    followed by ctrl+enter.
    I get my results as expected.
    Then I go back to repeat these steps using SQL History and it locks up at nr 2.
    This behavior seems to occur sporadically because I was never able to reproduce identical scenarios in succession.
    It only happens when I run the statements from SQL History.
    When I copy paste my previous statements without using SQL History, everything works fine.
    Is this a bug, or what's going on?
    Thank you
    Edited by: 898322 on Nov 21, 2011 6:15 AM

    Hi,
    Are you using Apex 2.1 that comes with XE 10G?
    That version Apex is old and might/have bugs. Also it not support well latest browsers.
    It is better use tool like SQL developer to run queries
    http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html
    Or you can upgrade Apex and see does problem go away
    http://www.oracle.com/technetwork/developer-tools/apex/upgrade-apex-for-xe-154969.html
    But note if you upgrade Apex, you lose database admin web interface
    >
    Once you upgrade Application Express within your Oracle Database XE, you will lose the Oracle APEX interface to perform some of your database management functions. This includes the ability to create and alter users, set database parameters, etc. To perform these functions, you will need to use either SQL Developer or SQL*Plus.
    >
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • I got my ipad stolen and I locked it and bought a new one. When I am offline and someone tries to call me or message me it goes to my stolen ipad how can this be if it has been locked? Why do they still have access to my contacts/facetime/messages?

    I got my Ipad stolen one month ago and bought a new. I locked the stolen one but now everytime someone calls me and my new ipad is offline the calls or messages will go to the stolen one. It is kind of creepy to know that my thiefs can read everything and send messages on my behalf to my contacts.....I have done the find my iphone application and it says that the ipad has not been used however I have family tell me that people that are not me answer the calls... I have also seen messages in my new ipad that I did not write.

    That message is usually due to a bad cable.
    Not Charge
    - See:    
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    If you can’t charge your iPhone, iPad, or iPod touch
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - If a 5G iPod               
    Iphone 5 lightning port charging problem - SOLUTION!
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar
    or send it in to Apple. See:     
    Service Answer Center - iPod

  • HT4539 My apple ID is locked. Why?

    While purchasing my Id was locked because I was not able to answer a security question..please help me what can I do

    Hello,
    We are not Apple. We are just users like yourself. For more information about how to unlock your Apple ID and reset your security questions if you forgot them:
    Apple ID: "This Apple ID has been disabled for security reasons ...
    Some Solutions for Resetting Forgotten Security Questions

  • MB GUI locking up when waking from sleep

    This doesn't happen every time, but sometimes when I wake the MB, the screen will freeze. The OS is still operating, I can ssh in to the machine. The cursor still responds, but I can't click on anything. The clock will be frozen at the time when the MB went to sleep.
    I waited for about 15 minutes, but it never came back.
    It wasn't connected to any network shares, and I didn't have any USB/FW devices plugged in.
    The only thing I can do is to power it off. It's running 10.5.5, with the most recent security updates, etc.
    Any thoughts? I feel like I've tried everything short of a reinstall, which I don't want to do.
    I did run Applejack and let it do its thing, so maybe that will help. I don't know.

    Joanne,
    I believe you are still under warranty. I recommend backing up your data and taking your iBook in to be looked at. Your logic board might be failing.

  • Yoga 3 - system locks up - why?

    I have a newly acquired refurbished yoga 3 - very nice appearance.
    Performance sometimes problematic as system freezes for 15-30 seconds... any ideas what might cause this - what should I troubleshoot?
    Solved!
    Go to Solution.

    Thanks to everyone for their suggestions -
    After 3 days of research, trial and error - and a moderate bout of personal frustration:
    Below is what seems to have worked as a solution -
    1. Reset Yoga 3 Laptop to a fresh install of windows from recover screen,
    (btw - the new recovery interface is great and easy to use)
    2. Load latest windows hotfix from Lenovo support website and checked off all available updates as installed -
    3. Turn off automatic windows updates (optional - not necessarily part of the solution)
    4. Open the installed program 'intel rapid storage technology' -
    This app has a main panel window to control settings (manage) -
    Set to disable 'power management' which would otherwise if enabled toggle power to the SSD when it 'thinks' machine is idle - Enabling toggle power to hard drive seems like it might be a nice way to save resources -
    Except for now with the 'bug' this 'feature' is for the end user a randomized windows system freeze.
    5. Once updares and settings are in place suggest 'set restore point' with Windows OS for simple future system recovery 
    Once I disabled this setting my machine has run for 12 hours of usage with no issue.
    Now it feels like the laptop I had hoped to purchase.
    Note that earlier solutions suggested to uninstall the IDE Intel drivers. I found on my machine that this was not a stable solution as it caused my system to fail reboot and windows update triggered other issues such as replacing the intel drivers - which recirculated the issue.

  • GUI seems to lock, but computer not crashed

    II've got a Mac mini 2010 server, that now has 2 x 1TB SSD and 16GB ram (user installed, but , whilst I'm not an expert, it's not the first time I've installed components in a mac). I'm in the process of trying to set it up as a home server, however I've come across a really dod problem.
    What happens is that after a period of time (sometimes ten minutes, sometimes twenty, sometimes and hour or so) graphical artefacts appear and then the front end/GUI locks. I can still usually move the mouse, but everything else is frozen. There have also been occasions where I get no artefacts and it just freezes.
    There are two things that makes this odd (to me at least).
    Firstly, the Mac mini appears to still be functioning behind this GUI crash. For example, if I'm doing a copy operation (as I was last night copying 300 GB of music over) it will still run. Or a YouTube video will continue to play with sound only. And when I SSH in to the mac mini, you can do top and see a list of running processes (note sudo killall [appname] doesn't effect what is displayed on screen and only sometimes kills the processes (I.e. They don't list in the top command anymore).
    Secondly, this only happens when I physically interact with the computer for a period of time. If I leave it (not touch it whilst it does the process) copying files or downloading it will happily chug away and not lock up.
    I can't see anything significant in the logs, and I've reseated the memory just in case. Am I looking at a graphics card fault here?

    An update. Had a look in the logs and found the following. The crash happened at 20:31:21 – I'd completely forgotten I'd written the time down last night.
    29/07/2014 20:28:20.468 WindowServer[121]: _CGXHWCaptureWindowList: No capable active display found.
    29/07/2014 20:28:20.471 WindowServer[121]: _CGXHWCaptureWindowList: No capable active display found.
    29/07/2014 20:29:13.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:29:13.000 kernel[0]: IOVendorGLContext::ReportGPURestart
    29/07/2014 20:29:13.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:29:13.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:29:14.150 AirPort Utility[4170]: BUG in libdispatch client: kevent[EVFILT_WRITE] delete: "Bad file descriptor" - 0x9
    29/07/2014 20:29:34.750 sudo[4180]:    admin : TTY=ttys000 ; PWD=/Users/admin ; USER=root ; COMMAND=/Applications/Server.app/Contents/ServerRoot/usr/sbin/changeip -checkhostname
    29/07/2014 20:31:20.242 login[3752]: DEAD_PROCESS: 3752 ttys000
    29/07/2014 20:31:21.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:31:21.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:31:21.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:31:21.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:31:21.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:31:41.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:32:01.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:32:05.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:32:25.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:32:25.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:32:25.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:32:25.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:32:25.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:32:25.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = Graphics Engine Error (GR Error 5)
    29/07/2014 20:32:25.000 kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0x6 = DMA Engine Error (FIFO Error 6)
    29/07/2014 20:32:45.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:33:05.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:33:25.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:33:45.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:34:05.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:34:26.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:34:46.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    29/07/2014 20:35:06.000 kernel[0]: NVDA(OpenGL): Channel timeout!
    I'm also noticing that this happens when I am running chrome. Killing it via ssh will see the system return, after a period of time (again could be like 10-20 minutes though).

  • Why not a read lock?

    Hi,
    I use dbsql operate the database, when i begin a transaction, followed by executing a query, by observing its lock and found it produced a write lock, instead of reading a lock?
    Why is it? Do the following:
    [root@iZ28aslsffdZ db_sql]# dbsql test.db
    Berkeley DB 12c Release 1, library version 12.1.6.1.19: (June 10, 2014)
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    dbsql> create table t (a int);
    dbsql> insert into t values (1),(2),(3);
    dbsql> begin;
    dbsql> select * from t where a = 1;
    1
    [root@iZ28aslsffdZ test.db-journal]# db_stat -CA
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Lock conflict matrix:
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    80000014 dd= 0 locks held 1
    write locks 1
    pid/thread 30420/140133200996096 flags 0
    priority 100  
    80000014 WRITE    
    3 HELD      
    test.db:table00003 database  
    0

    That is expected behavior.  It is due to an internal optimization for single threaded access to the database.  The first time two threads clash trying to get access to the database schema table (which is what table00003 is), the database will stop getting a write lock on the table and will instead just get a read lock.
    Lauren Foutz

  • GUI freezes when new Thread object start()ed. Neat, brief code included :)

    The title says it all really.. I have the code below in a method startScan() that is called when a button is pressed. The thread executes fine, but the GUI locks up while the thread is executing. I don't really understand why, since a new thread is implicitly separate from the event dispatch thread.
    Must I use a SwingWorker to get things working? Would someone be kind enough to explain why, if this is the case?
    private void startScan() throws InterruptedException {
              final Runnable breadthFirstComparer = new Runnable() {
                   /** Sleep interval used when scan paused */
                   private int interval = 1000;
                    * Kills the current thread
                   public void stop() {
                        scanProgressLabel.setText("Scanning complete");
                        scanComplete = true;
                    * Sleeps the currently running thread if user has paused the scan,
                    * otherwise initiates comparison of the trees' next depth node sets
                   public void run() {
                        while (!scanComplete) {
                             while (scanPaused) {
                                  try {
                                       Thread.sleep(interval);
                                  } catch (Throwable exc) {
                                       Gecko.logException("Scanner thread could not be paused", exc);
                             compareTrees();
                        // Stop thread execution once scan is complete, and disable
                        // scanner-related buttons
                        toggleScanButton.setEnabled(false);
                        stop();
              scanner = new Thread(breadthFirstComparer)
                   public void start() {
                        scanProgressLabel.setText("Scanning in progress...");
                        breadthFirstComparer.run();
              scanButton.setEnabled(false);
              scanner.start();
         }Many thanks.

    it's getting really irritating that pretty much every thread out of the last
    20 I've made, you've criticised me for not posting an SSCCE. How do you think I feel. I'm donating my time to help you solve a problem, but you are not willing to spend 5-10 minutes to post a SSCCE so that we can fully understand what you have done and what the problem is.
    You don't have to post a SSCCE if you don't want to. Thats fine, I just won't answer your questions.
    what's the point me spending 30 minutes or more my end creating an
    SSCE, and you spending 10 minutes or more compiling, running and analyzing it your end?It should not take 30 minutes. If it does it just goes to prove that you don't really understand what you are attempting to do. And if you don't know what you are doing how do you expect us to guess what you are doing? One of the benefits of a SSCCE it to help you learn to develop problem solving skills by learning to simplfy the problem.
    Also, what if we can't figure out the problem based on your verbal description of the problem? If you post code it gives us the option of compiling and testing the code if we so desire. Without the code we give up and move on to the next question.
    but since the simple information that you've provided, and the chunk of code that Michal so kindly donated, are likely more than enough of an explanationThis time we were able to guess what the problem was, but that is not true in all cases. You seem to think that we are all miracle workers, that you can place a couple of lines of code in front of us and we can automatically tell whats wrong. Well, thats not true (at least for me). Many times I use my problem solving skills to solve the problem.
    I really should learn to scroll down and read all the posting before replying. es5f2000 pretty much said it all for me.
    Message was edited by:
    camickr

Maybe you are looking for