Run / quit user interface and memory clean up

Hi,
may be I simply miss a coffee, but here is my problem: I have a main function and a quit callback in a standard configuration, i.e. as follows:
int main ( int argc, char *argv [] )
    RunUserInterface ();
    DiscardMenuBar ( popup_menubar_handle );
    DiscardMenuBar ( menubar_handle );
    DiscardPanel ( panel_handle );
    return ( 0 );
int CVICALLBACK Quit ( int panel, int control, int event, void *callbackData, int eventData1, int eventData2 )
    if ( event == EVENT_COMMIT )
        FreeDynamicMemory...
        FileCloseFiles ...
        QuitUserInterface ( 0 );
    return ( 0 );
On the panel, there is a graph with plots etc. If I quit the program via the quit callback (i.e. a Quit button), everything is fine, no memory leak.
If I try a modified version as shown below, plots are not freed after the program has finished, resulting in a memory leak as shown by the resource monitor:
int main ( int argc, char *argv [] )
    RunUserInterface ();
    return ( 0 );
int CVICALLBACK Quit ( int panel, int control, int event, void *callbackData, int eventData1, int eventData2 )
    if ( event == EVENT_COMMIT )
        FreeDynamicMemory...
        FileCloseFiles ...
        DiscardMenuBar ( popup_menubar_handle );
        DiscardMenuBar ( menubar_handle );
        DiscardPanel ( panel_handle );
        QuitUserInterface ( 0 );
    return ( 0 );
I have also tried reversing the order in the quit callback, with the same result:
int CVICALLBACK Quit ( int panel, int control, int event, void *callbackData, int eventData1, int eventData2 )
    if ( event == EVENT_COMMIT )
        FreeDynamicMemory...
        FileCloseFiles ...
        QuitUserInterface ( 0 );
        DiscardMenuBar ( popup_menubar_handle );
        DiscardMenuBar ( menubar_handle );
        DiscardPanel ( panel_handle );
    return ( 0 );
So only the first variant works properly and I could be happy.
However, I do not understand why version 2/3 do not work.
Second, the first variant does not work if I also have installed a main callback, see the other thread here That's why I tried variants 2 and 3 but failed...
Thanks for the coffee

Off the top of my head, I can't think of any reason why the 2/3
alternatives wouldn't work. This might be a bug in the resource tracking
detection.
I tried to reproduce the problem with a simple program, but I wasn't
able to. I'm attaching my files. Can you try them out and see if you can
reproduce the problem with them? If not, can you try attaching some
project that reproduces it, so that I can look into it?
Thanks,
Luis
Attachments:
plotleak.zip ‏5 KB

Similar Messages

  • Nokia's user interface and software A terrible e...

    (hope this is in the right section, here goes)
    I got my E63 about a month ago. I thought it only fair to list my grievances with the phone so far, because I am really close to selling it and buying something else, and I think Nokia deserves to know the reasons why, and will hopefully improve in the future.
    I will start off with what I love about the phone, because I do in fact, really like it. The slim size, excellent keyboard, great connectivity like 3G and Wi-fi, and the reasonable battery life, make it a great phone, but its in the user interface, and actual usage of the phone, where things really start to fall flat.
    The user interface is very disorganized and difficult.
    Why is everything so hard to find and use? For example, if I want to change the applications that appear on my home screen, I need to navigate the following directory tree:
    Menu > Tools > Settings > General > Personalisation > Mode Settings > Home Screen Applications > Application Shortcuts > Shortcut 1
    and then, when I finally get to the list, the items arent even in any order!
    You must be joking, what a horrible menu! Its insane. As a user, I feel like its a terrible experience.
    But thats not all. Why are there 2 notes applications on my phone? There's notes, and active notes. Why does Nokia OVI store exist twice, once in the main menu, and once under installations? Why do I have Contacts, and OVI contacts on my phone? Why can't my phone have just one app that works well, instead of 2 that differ slightly.
    Why is email setup in the installations menu? Why isn't it under email, where mailboxes get set up? Its just sitting there cluttering up Installations, when its something you only use once or twice.
    Not to mention the fact that the configuration settings are all over the place, i.e. there is an Email Key setting in Menu > Tools > Settings > General. Its all on its own, not near anything. Why isn't it in the same menu where the other shortcut keys get set? Or even in the email app settings?
    I am not naive, I know that the E63 is on the cheaper end of the scale, so I can't expect it to be the fastest phone in the world, but scrolling through my email in HTML mode is so horribly slow, and the view tends to jump from left to right on some emails, I hardly even use the phone to check my email anymore, which is sad because that is the reason I chose the E63.( for the nice keypad and email syncing)
    These are just SOME of the things that I have noticed. So please Nokia, PLEASE PLEASE PLEASE! Spend some of your R&D money on user interface and user experience!
    If there is anything you take away from this letter, let it be this:
    Doing anything on the phone just feels like hard work, it makes me not want to use the phone.
    Your phones should be simple and easy to use, even without the mass of Help files that appear in a lot of the menus.
    I know, some people may say that if I want a better experience, I should be willing to buy a more expensive phone. Well, I can say that if I do spend more money on a phone, the chance is very slim that it will be a Nokia.
    Really, I am not being nasty, just trying to be honest. I know that Nokia is run by human beings like myself, so I tried to be polite, and I dont intend to hurt anyones feelings.
    I am quite willing to answer any questions you may have. Its a bit of a pipe dream, but I would love to see Nokia release an entirely new version of the phone software, with everything re-organized and re-done. The sad truth is that will probably never happen, and I will end up swopping my E63 for something that is easy and pleasant to use.
    So please, let me know if there is anything I can do to change the situation, or help you guys in making this better for everyone.

    "If your not used to symbian you'll learn it quick enough, compared to android it's childsplay."
    On the contrary, Ive been using Nokia phones for the last 8 years, and for the last 2 years Nokia exclusively, and the UI has just got worse.
    The fact that "you'll learn it" is of no comfort. Why should I have to spend hours learning how to use a cellphone? Whenever I want to do something I havent done before, I have to spend time digging through obscure menu options. That is absurd.
    "What phone do you have in mind to replace the E63,  that would help us users alot more then telling us what is wrong with your phone.  Although over all I like my e63."
    I don't have any specific phone in mind, Im just going to ask and look around until I find something with an operating system that is organised in a logical manner, and that allows me to access and read my email quickly and easily.
    I put this here hoping that other users would come forward with UI related things that they were unhappy about,  and then Nokia would take notice. I could easily have just gone out and changed phones, but I chose to do something different.

  • Vi with access via both user interface and external communicat​ion

    Hi,
    Maybe a little bit too general but I'll risk it:
    It concerns a project to stear a tensile machine. Data acquisition is relative straightforward via a few analogue and digital channels.
    The interaction of the operator with the tensile machine can be done at two levels:
    1. Directly via an user interface on the computer next to the machine. Here I would typically use a state machine in combination with event structures.
    2. Remotely,  via TCP protocol. Here different clients (external program, written in C) should be able to connect to the LabVIEW program and send simple commands such as 'read force', 'write force', 'read status', ...
    It is relatively easy to setup a small daemon that accepts TCP connections from multiple clients. Furthermore I would put the commands from the clients into a message queue (using a producer/consumer structure).
    I was wondering what the best method is to allow both the user interface and the external clients to stear the machine (e.g. using an event structure to respond to interactions via the user interface, and create user events from the commands of the clients to access the same actions).
    Steven
    LV8.5

    Hi VPS,
    one way could be to build your TCP receiver in one while loop and your event structure in another while loop. if you want to send a command from the event structure you can send this over tcp to the TCP receiver.
    Another way could be to use a queue or notifier to send the commands from the event structure and the TCP receiver to another while loop which work with the received commands.
    Mike

  • Open Serial Driver VI runs in user interface thread - why?

    I know the serial port compatibility functions are "phased out" and you should use the newer VISA functions - but why on earth is the open serial driver VI set to run in the user interface thread?  If you happen to use these compatibility VIs your serial communication will be blocked by e.g. a user that opens the calendar view of a date and time control...- and the only reason for that is that that particular VI is running in the user interface.
    Change the thread of that VI - and the serial communication runs as it should, so why is it that that particular VI, unlike all the other VIs in that library, is configured that way?
    MTO

    The S/N dialog is part of the process model.
    For the Sequential Model (SequentialModel.seq), the default S/N dialog in found in the 'PreUUT' sub-sequence and implemented as a DLL call.
    The PreUUT sub-sequence of the SequentialModel is a callback, so you can override it in your own test sequence.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • SESSION_PER_USER limit of the user profile and memory Oracle 11g

    Hi,
    I am new to oracle 11g.
    My applications are facing some problem hosted over oracle 11g and this issue appearing because of there is not sufficient sessions available.
    Here is current setting
    CPU count                    2
    Parallel Thred per CPU               2
    Resource Manager CPU allocation     2
    Shared mamory address          0
    Memory MAX target               6GB
    Memory Target               6GB
    Total Size of DB               75
    Used Size of DB               55
    Sessions -MAX               555
    Processes-MAX               500
    We want following settings
    Total Size of DB               75
    Used Size of DB               55
    Sessions -MAX               1200
    Processes-MAX               800
    Here is my qurey
    Is there any relationship between memory allocated to database and Sessions -MAX & Processes-MAX or CPU allocated .
    and whats best setting we can get for Sessions -MAX & Processes-MAX for given configuration of CPU and memory ?
    Thanks
    Edited by: user13714831 on Jul 22, 2011 12:54 PM

    limit number of session per user using wired dot1x is not available in 1.3

  • User interfaces and event structures

    I am just learning to use event structures to improve operation of front panels.  At the moment, I am working on a tab strucrture we use to montinor/set program paramters.  VArious parametera are displayed on each tab as controls (not indicators) and are constanly updated sice they can be modified elsewhere by other pieces of code.  We controls are normally disabled via a property node so they behave more like indicators and the values are updated by writing to a local variable (I know this is evil but it works in this case).  There is a boolean on each tab that toggles between "monitoring" and "changing" modes (or states).  When toggles to "changing" (or setting) parameters the monitoring activities are suspended and the control are enabbled.  After making the desired changes the controls are either read and the changes implimented or get rest based on some other boolean controls, the parameters controls are then disables and monitoring resumes.  The issue is that many users fing the need to toggle between "monitorsing" and "changing" modes to be confusing.  I want to replace this switch with an event.  If the user clicks on any of the parameters controls in a tab, I want to go into changing mode rather than using the "monitoring"/"changing" boolean control.  All other asspects are handled as before.  My problem is than if I use a mousedown event to go into "changing" mode and the user clicks on several parameters to shift the keyboard focus to edit more than one parameter, these subsequent mose clciks get processed as new events when change mode is exited.  This means that as soon as it returns to "monitoring" mode it jumps immeadiately back to "changing" mode.  How should I structure the events to avoid this problem?
    Thanks,
    --Lee

    Lee,
    Instead of using a "mouse down" event, use a "value change" event for each
    of the controls. Then your program can switch to the "changing" mode
    whenever the value of the control is actually changed.
    TJW
    "Lee Robertson" <[email protected]> wrote in message
    news:[email protected]...
    >I am just learning to use event structures to improve operation of front
    >panels.&nbsp; At the moment, I am working on a tab strucrture we use to
    >montinor/set program paramters.&nbsp; VArious parametera are displayed on
    >each tab as controls (not indicators) and are constanly updated sice they
    >can be modified elsewhere by other pieces of code.&nbsp; We controls are
    >normally disabled via a property node so they behave more like indicators
    >and the values are updated by writing to a local variable (I know this is
    >evil but it works in this case).&nbsp; There is a boolean on each tab that
    >toggles between "monitoring" and "changing" modes (or states).&nbsp; When
    >toggles to "changing" (or setting) parameters the monitoring activities are
    >suspended and the control are enabbled.&nbsp; After making the desired
    >changes the controls are either read and the changes implimented or get
    >rest based on some other boolean controls, the parameters controls are then
    >disables and monitoring resumes.&nbsp; The issue is that many users fing
    >the need to toggle between "monitorsing" and "changing" modes to be
    >confusing.&nbsp; I want to replace this switch with an event.&nbsp; If the
    >user clicks on any of the parameters controls in a tab, I want to go into
    >changing mode rather than using the "monitoring"/"changing" boolean
    >control.&nbsp; All other asspects are handled as before.&nbsp; My problem
    >is than if I use a mousedown event to go into "changing" mode and the user
    >clicks on several parameters to shift the keyboard focus to edit more than
    >one parameter, these subsequent mose clciks get processed as new events
    >when change mode is exited.&nbsp; This means that as soon as it returns to
    >"monitoring" mode it jumps immeadiately back to "changing" mode.&nbsp; How
    >should I structure the events to avoid this problem?
    > &nbsp;
    > Thanks,
    > &nbsp;
    > --Lee

  • User Interface (UI) Too Small on InDesign and CC Suite

    I have a 27″ IMac running Yosemite 10.10.2. Its native screen resolution is 2560×1440.
    When I opened CC Indesign 2014 for the first time I was shocked to see that the tools and rest of the user interface were SO SMALL that I was having tremendous difficulty seeing them clearly. I'm talking 5 and 6 point type!!!  And the icons... minuscule!
    I lowered the resolution of the display, but type then becomes fuzzy. I searched the web and found that there were others who were having the same problem.
    I find it hard to believe that a company specializing in software for the design/creative community would overlook something as CRITICAL as size of the graphical user interface and its customization to work optimally on different platforms and with different display sizes and to satisfy the particular needs of each user.
    The UI obviously greatly impacts our working speed and facility.
    I called Adobe and their tech support could not help. I called Apple and got the same. 
    I've been a graphic designer for over 20 years.  Frankly, at this point, I find the suite UNusable (I took a quick look at Photoshop and Illustrator and the same issue applies).
    This is just unbelievable!  Anyone out there have an answer?
    Someone suggested we should repeat our complaints INDEPENDENTLY in the general forum instead of them being buried on one thread.  GREAT IDEA!!

    CC 2014 has a Expermental Preference you can use to increace the UI size 200% for High resolution displays

  • MBP App Memory Clean showing a total of only 3.38GB RAM, although my MAC should have a total of 4?

    Hello all,
    Perhaps a question more for the tech-experts (I'm not one ) :
    I have been running the (well-known) App Memory Clean for a while, and have been quite satisfied with its "Auto-Clean" function, as it saves me up on the Disk swapping.
    However, as I open the App, there are a few options that can be seen:
    Active
    Wired
    Inactive
    Free
    Used
    Total
    My MBP Retina (late '13) has a 4GB RAM installed- and yet the "Total" RAM memory that Memory Clean displays is a mere 3.41 GB and fluctuating. I have checked Activity Monitor as well as About this Mac>More Info>System Report> Memory, showing me that all slots are "OK".
    Is this an app "bug"? If so, that would be relieving, but nonetheless brings me to a more deep-rooted question:
    Is constantly "cleaning" the RAM bad for it and for the MBP's performance?
    (I have heard that Memory Clean runs by "dumping disk cache"- which is supposedly bad for system performance...?)

    I also have your concerns. I have a first gen rMBP with 16 GB of RAM and I often see every bit of RAM being used!
    So far I’ve been too chicken to upgrade my mid ’11 MBA since it only has 4 GB. I understand Mavericks utilizes RAM differently, but I’m still skeptical. Mavericks hasn’t been as stable as most initial releases so I’m waiting until 10.9 doesn’t seem so much like a beta.
    I’d like to see a good explanation of Mavericks memory management system vs prior versions of the OS. Apple’s quick explanation was ok but far from comprehensive.
    BTW, I switched to FreeMemory when I upgraded to Mavericks. It has all the same functions as Memory Clean but has the added benefit of having a menu bar icon with the familiar pie chart that Activity Monitor once had for a dock icon but lost in the upgrade.
    For now I'll disable the auto clean feature and see how the system behaves, but I'll keep it installed just for it's monitoring capabilities.

  • How to avoid long user interface response time in long measurements ?

    Hi
    I tried to find more information regarding techniques how to avoid long user interface response times in case of extremely long measurement times with an external instrument communicating over GPIB, so I post this hoping to get some hint or a link to a guideline. I guess this is quite normal problem.
    Problem is that when I want to measure long time in order to get an average result from the instrument, I have to wait until the result is returned from the instrument. Obviously that makes the user interface response very slow in traditional technique. 
    My restriction is the old GPIB 488 instrument driver that I would not want to modify, but I have source code to it.
    What would be the best way to improve the response time for user interface ? I have looked into the few things:
    * multithreading
    * callback in main program for GPIB events
    * modifying instrument driver e.g. to support VISA and creating a VISA callback
    regards,
    Petri

    Several ways to do this:
    If you're getting several measurements, you could have the instrument generate an asynchronous interrupt (an "SRQ" in GPIB terms), then collect the data in response to the SRQ callback.  While you're waiting for the SRQ's, you can have your main thread running the interface so responsive GUI.  You don't have to spinlock on the GPIB read waiting for instrument data.
    Or, as you mentioned, you could spawn a thread to manage the measurements, and use a timer in the main thread to periodically allow you to check the status of the measurement thread.  Again, the main thread mostly just runs the user interface.
    Either way, the idea is to keep the main thread freed up most of the time to run the GUI, and have it periodically check for completion of your measurement sequence.  While you're waiting in the main thread, you may want to make sure the user can't inadvertently re-trigger another measurement sequence until the active one is complete.
    If you do find yourself doing a dead wait, you'd want to break this up into a series of shorter waits, and in between each wait, do a ProcessSystemEvents from the main thread to keep the GUI active.
    Menchar

  • Recovering lost user interface

    I have lost my user interface and all applications etc. have reverted to unused on my G5 10.3.9 iMac. This happened while I was in Firefox when opening a file just copied from my local networked Leopard MacBook. OS9 applications and preferences do not appear to have been affected and the second user account is unchanged. I have tried booting with the installation disk and repairing the disk but my user account could not be repaired. The name of my user home file has not changed.
    Would reinstalling the system software cure the problem? I am concerned that the other user could lose his data and preferences etc. if I reinstall.

    It can also happen if the Finder's preference file has been deleted or overwritten. The dialog about opening for the first time occurs when the LaunchServices database has been cleared.
    As long as your account is still OK I wouldn't worry too much about this. You will need to re-establish your preferences but otherwise it should be fine. I would also suggest doing the following as a precautionary measure:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger, and 4.1 for Leopard) and/or TechTool Pro (4.6.1 for Leopard) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.

  • After Effects not starting at all, stops at "initializing user interface"

    I installed CS5 master collection trial version on W7 64 bit machine.
    After Effects  doesn't load at all (it stops at "initializing user interface") and it's  even impossible to kill the  process in windows (never had this problem with any app). I can shut down all  the other processes, like dynamiclinkmanager.exe  or Adobe QT32  Server.exe, but aftereffects.exe  just won't stop and I need to restart my PC.
    Also  Premier crashes after I click 'new project', or try to open something,  but the application starts and I do see the whole GUI.
    I updated Quicktime, as well as my video card  drivers. All  other apps in the master collection seem to work fine. Uninstalled the  whole thing twice (with the remove preferences option), cleaned the registry with a comodo system clean up utility,  reinstalled also twice- nothing. Tried with the firewall turned off and  quick time completly uninstalled - nothing changed.

    can you rename or delete "C:\Users\xxxxx\AppData\Roaming\Adobe\After Effects\10.0"
    can you rename or delete for max 11
    "C:\Users\xxxxx\AppData\Local\Autodesk\3dsmax\2011 - 64bit\enu"

  • How do I fix incorrect resolution for Firefox user interface on Retina display Mac?

    I have a 15" retina display Mac (roughly a year old) running Mountain Lion. A couple weeks ago the user interface in Firefox seems have switched from using the normal zoom level of every other application to the native dpi of the retina display monitor. This means that the UI elements are all extremely tiny, etc. Is there anyway to reset this without simply reinstalling or reseting the rest of my configuration?
    Currently running Firefox 27.0.

    You can try to modify the gfx.hidpi.enabled pref on the <b>about:config</b> page (<=0: disable; 1:all screens same res; >1:enable always).
    *http://kb.mozillazine.org/about:config
    Try to disable hardware acceleration in Firefox (you need to close and restart Firefox).
    *Firefox > Preferences > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can set the layout.css.devPixelsPerPx pref on the <b>about:config</b> page to 1.0 and if necessary adjust layout.css.devPixelsPerPx starting from 1.0 in 0.1 or 0.05 steps (1.1 or 0.9) to make icons show correctly.
    *http://kb.mozillazine.org/about:config
    See also:
    *https://support.mozilla.org/kb/forum-response-Zoom-feature-on-Firefox-22
    Use an extension to adjust the text size in the user interface and the page zoom in the browser window.
    You can look at this extension to adjust the font size for the user interface.
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/
    You can look at the Default FullZoom Level or NoScript extension if web pages need to be adjusted after changing layout.css.devPixelsPerPx.
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • User interface threads

    Ok let's say you're writing a user interface and nothing involves
    special-resources like a daqcard so there's no constraints on using things
    at once. These are some kind of stupid questions and ideas but I'm really
    not sure how to write a quality app with user interface at the moment.
    My current design is bad, it is a mainVI which checks the menu and
    frontpanel buttons, decides which operation or calculation (if any) is
    selected, and sends that to a case structure to perform the operation.
    This is sloooow but the most common way in examples that I've seen. The
    major problem is that while processing the interface isn't checked and
    therefore mouseclicks might be lost. Let's say the processing takes like
    500ms on average, that is kind of slow between user-interface querys so it
    would feel unresponsive in the mean time.
    So here's my three ideas so far, I'd love some comments on what will be FAST
    and what would be worthwhile to spend my time on:
    1. Leave the app as-is, latch the booleans. However you can't latch
    mouse-clicks on a picture indicator that I knew of. I emailed NI before
    about this and they just suggested adjusting execution priorities. Anybody
    else messed around with this? Probably the worst option, but would take zero
    programming.
    2. Divorce the user interface and the processing. Create two parallel
    while-loops in the same VI, one checks the buttons/menu on the front panel
    the other processes the request or calculation. Let's say on average UI
    checking takes 1.2ms and processing takes about 500ms. Also in this case is
    the watch icon still really my best option (since checking buttons/menu only
    takes like 1.5ms on average) for not wasting time repeatedly checking when
    there's no input and dividing up cputime accordingly? Seems like there'd be
    some overhead in switching back and forth repeatedly.
    3. Going all-out and changing to somewhat of an object structure. That way
    the UI could create a new "execution" refnum, maintain some list of created
    objects, process, return values, destroy any object, so everything could be
    going on in parallel. That way one slow calculation won't bog down the rest
    of the things the UI requests. The idea is far too abstract to me at this
    point, but on a single CPU w98 system is it even worth my thinking about
    such a structure? I get the feeling I'd see zero performance change between
    the two, in fact maybe worse from any labview thread overhead!
    Thanks for any comments. I have seen DAQ intensive apps discussed often, but
    don't usually catch much on large user interface apps.
    -joey

    Hi Joey
    First check are you are not recalculating the values on ever iteration of the user interface loop but are you only recalculating
    on any change in the user interface values.
    Otherwise I would use idea No. 2 but with these changes.
    1. Only check the whole user interface every 200-300ms, 1.5ms loop time will unnecessarily load the CPU.
    2. Each user interaction could be given a string representation and then placed in a queue to wait for the calculation loop to
    have time to process it.(So the user instructions are not lost)
    3. Have separate loops for faster and slower calculations (or more) with each having their own queue.
    4. The extension to the idea's of having separate loops, is to have each loop in a separate independently running VI (see
    VIserver). Still use the queue's to pass the data. This method would allow the calculations and the user interface to run on
    separate threads and also lets you alter the execution priority for each VI to fine tune the execution times.
    Following these instructions you would produce a basic client-server architecture for your user interface, as long as the UI
    doesn't require too many slow calculation results before continuing then this should work well.
    If this is still not fast enough then, if you have used suggestion No.4, the calculations can be moved off the users computer to a
    faster server (using VIserver) also assuming they are networked.
    Hope this gives you some ideas.
    Tim S
    Joseph Oravec wrote:
    > Ok let's say you're writing a user interface and nothing involves
    > special-resources like a daqcard so there's no constraints on using things
    > at once. These are some kind of stupid questions and ideas but I'm really
    > not sure how to write a quality app with user interface at the moment.
    >
    > My current design is bad, it is a mainVI which checks the menu and
    > frontpanel buttons, decides which operation or calculation (if any) is
    > selected, and sends that to a case structure to perform the operation.
    >
    > This is sloooow but the most common way in examples that I've seen. The
    > major problem is that while processing the interface isn't checked and
    > therefore mouseclicks might be lost. Let's say the processing takes like
    > 500ms on average, that is kind of slow between user-interface querys so it
    > would feel unresponsive in the mean time.
    >
    > So here's my three ideas so far, I'd love some comments on what will be FAST
    > and what would be worthwhile to spend my time on:
    >
    > 1. Leave the app as-is, latch the booleans. However you can't latch
    > mouse-clicks on a picture indicator that I knew of. I emailed NI before
    > about this and they just suggested adjusting execution priorities. Anybody
    > else messed around with this? Probably the worst option, but would take zero
    > programming.
    >
    > 2. Divorce the user interface and the processing. Create two parallel
    > while-loops in the same VI, one checks the buttons/menu on the front panel
    > the other processes the request or calculation. Let's say on average UI
    > checking takes 1.2ms and processing takes about 500ms. Also in this case is
    > the watch icon still really my best option (since checking buttons/menu only
    > takes like 1.5ms on average) for not wasting time repeatedly checking when
    > there's no input and dividing up cputime accordingly? Seems like there'd be
    > some overhead in switching back and forth repeatedly.
    >
    > 3. Going all-out and changing to somewhat of an object structure. That way
    > the UI could create a new "execution" refnum, maintain some list of created
    > objects, process, return values, destroy any object, so everything could be
    > going on in parallel. That way one slow calculation won't bog down the rest
    > of the things the UI requests. The idea is far too abstract to me at this
    > point, but on a single CPU w98 system is it even worth my thinking about
    > such a structure? I get the feeling I'd see zero performance change between
    > the two, in fact maybe worse from any labview thread overhead!
    >
    > Thanks for any comments. I have seen DAQ intensive apps discussed often, but
    > don't usually catch much on large user interface apps.
    >
    > -joey

  • Multiple monitors, duplicate user interfaces

    Hey everybody,
    My application consists (as the title suggests) of a computer running 4 touchscreen monitors. Three of the monitors will be completely different, but the 4th will need to be a combination of the other 3. The 4th is bigger, so it will actually fit all of the front panel from monitor 1.
    Here is a depiction of what the setup will be.
    The hard part is that I need Monitor 4 to act exactly like the other monitors in its respective sections. It would be nice to be able to do this without duplicating code or having to send my data to multiple places every time. Do any of you have experience in UI duplication, or know of a clever way to do this?
    What I'm thinking I'll have to do is create a new interface for the 4th monitor that triggers the other user interfaces and vice versa. The downside is that it takes extra development on top of the UIs I already have and if I change something with the first 3 UI, I have to go in and change the 4th manually. I would also have to do some fancy global event triggering LIKE THIS in order to communicate between two different VIs.
    Any help is highly appreciated.
    Thank you!
    James
    LabVIEW Professional 2014
    Solved!
    Go to Solution.

    GerdW,
    My architecture follows a Queued Message Handler structure and allows communication between each module.
    Can you elaborate on "duplicate FP"? Is there a way to duplicate just the FP for control purposes, but have the code only running once in the background.
    johnsold,
    Each GUI is it's own top level Queued Message Handler that sends its information to seperate QMHs through shared API. Essentially this means that each module has its own Master portion that can send its data to another module's Slave and vice versa. This architecture would allow for near-simultaneous user inputs from different locations because the first one to be written to the queue would just get handled first, then overwritten by the other, which isn't a problem. 
    Can you link to an example of pulling a VI in to a subpanel while simultaneously running another instance of the VI? Every time I try this, I get an error.
    Edit: Thanks David
    Thanks,
    James
    LabVIEW Professional 2014

  • How can I give the "user interface thread" higher priority?

    We do alot of activex calls to front panels. We need to increase/decrease the priority of the user interface thread to resolve our thread problem. Anyone know how to do this?
    Chuck

    Hello,
    As P.M. was saying, you can adjust the thread priorities
    through the VI Properties dialogue. 
    Another place to modify the multithreading system in LabVIEW is a VI
    located at: [LabVIEW Directory]\vi.lib\Utility\sysinfo.llb\threadconfig.vi.  However I do not think this will remedy any
    problems you are having.
    From a Multithreading in LabVIEW tutorial (http://zone.ni.com/devzone/conceptd.nsf/webmain/d2e196c7416f373a862568690074c759)
    Priorities in the User Interface and
    Single-Threaded Applications
    Within the User Interface execution
    system, priority levels are handled in the same way for single-threaded and
    multithreaded applications.
    In single-threaded applications and
    in the User Interface execution system of multithreaded applications, the
    execution system queue has multiple entry points. The execution system places
    higher priority VIs on the queue in front of lower priority VIs.
    If a high-priority task is running and the queue contains only lower priority
    tasks, the high-priority VI continues to run. For example, if the execution
    queue contains two VIs of each priority level, the time-critical VIs share execution time exclusively until both finish.
    Then, the high priority VIs share execution
    time exclusively until both finish, and so on. However, if the higher priority
    VIs call a function that waits, the execution system removes higher priority
    VIs from the queue until the wait or I/O completes, assigning other tasks
    (possibly with lower priority) to run. When the wait or I/O completes, the
    execution system reinserts the pending task on the queue in front of lower
    priority tasks. Refer to the Synchronous/Blocking Nodes section for a list of
    asynchronous functions that wait.
    Also, if a high priority VI calls a lower priority subVI,
    that subVI is raised to the same priority level as the caller for the duration
    of that call. Consequently, you do not need to modify the priority levels of
    the subVIs that a VI calls to raise the priority level of the subVI.
    Thus changing the priority of your VI will change the
    priority of UI calls for that particular VI. 
    Again, I caution you because I suspect that if you are having problems
    with your application not running correctly, I do not believe that manipulating
    the thread priorities will resolve these issues.
    Hope this helps,
    Travis M
    LabVIEW R&D
    National Instruments

Maybe you are looking for

  • All day events showing in iCal

    Hi, I am trying to work out how to get iCal to show more than two (2) 'all day' events in the monthly view? At the moment if there are three (3) all day events in one day, it only shows two of them and then a "..." in the top of that days 'box'. How

  • ORA-06502: PL/SQL: error TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;

    Hi, I've a Compiled Body Package which code I described below: create or replace PACKAGE body emp_pkg IS TYPE boolean_tabtype2 IS   TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;   valid_jobs boolean_tabtype2;  PROCEDURE add_employee(     first_name emplo

  • Chat with an agent doesn't work

    I have been trying for the last hour to get into the chat with an agent feature, does this feature work? Has anyone else used it?

  • Differents accounts (one BC host) and another creative cloud (muse)

    Hello I have a client that have created a new account in BC for manage himself the website, in the other side I have created a website with muse and I have another different account so if I choose the option to publish de website that is in my accoun

  • Motion Tracking a dud

    I'm wondering if anyone else has encountered what to me appears to be a couple of bugs with Motion Tracking. 1. The first is that on most videos I have used (MTS files), when I select the clip on the timeline and hit the Motion Tracking button nothin