Open VI Reference prevents execution of other parallel threads

I am using splash screen to start an application. I use dynamic loading of the Main.vi and an animation during the loading, both in parallel threads (see image below). However, when the Open VI reference VI is called everything else stops executing (the animation stops running) until the Open VI reference is done. I must call the Main.vi dynamically, because it takes some time to load and I want to notify a user that the application is loading (using animation). Is there an option to prevent the Open VI reference to block the execution of other threads? Or should I use some other approach?

andrej wrote:
But the problem is not in the Run.VI method because the Open VI Reference blocks the execution of the top loop and I need the Open VI Reference to call the Get VI Dependencies method. Other approach could be to create a static array of dependencies and then to use this array to load VIs from bottom up.
The only question now is if the Get VI Dependencies method returns dependencies in top to bottom order? If it does then I can just load VIs in reverse order from the array.
Well the problem is the Open VI Reference! This executes in the UI thread, as several people have explained already (and really can't be made to do otherwise without causing a number of possible and nasty race conditions, some of them even related to the underlaying OS and not just LabVIEW itself), just as your two Property Nodes in the upper loop have to use the UI thread too.
Once Open VI starts it only returns if it has loaded the required VI fully into memory (and that includes any dependencies that aren't already in memory) and linked them all properly together or runs into an error during loading. For this duration, NO UI Property Node can execute, which is what stalls your upper loop. If you would use local variables or terminals instead the upper loop would happily run along while Run VI loads the entire VI hierarchy but it would still not show on the UI, because in order to draw the new data from the diagram passed to locals and terminals LabVIEW has to catch the UI thread to do the UI drawing.
So first fix is to kick out any property nodes from the upper loop and the second part of the solution is to load your VI hierarchy in chunks instead of simply loading only the top level VI directly. It would be nice if Open VI had an option to allow UI thread release between loading of chunks of VIs, but the implications are not that nice. It would be quite easy for an uncareful LabVIEW programmer to create a lockout situtation then, where two functions are in fact waiting on each other to release some locks so that the program gets hang up. And a simple warning in the documentation to watchout as this option can allow to create such lockout situations is not very useful as nobody reads them anyhow.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Itunes wont open because of Data Execution Prevention?

    itunes wont open because of Data Execution Prevention?

    Hello, ollieallen.
    I am unsure what operating system you are running so I am going to include articles for Windows XP and Vista, 7 and 8.  Completely uninstall all components of iTunes and then reinstall the program. 
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Cheers,
    Jason H.

  • I have mountain lion OSX and parallels with Windows.  Every time I click on a hyperlink in other applications it opens - some 7 Zip file explorer inside Parallels but doesn't go to Safari.  Does anyone know solution?

    I have mountain lion OSX and parallels with Windows.  Every time I click on a hyperlink in other applications it opens - some 7 Zip file explorer inside Parallels but doesn't go to Safari.  Does anyone know solution?

    I suggest that you run software update, after which you should have Safari 6.0.5 - then check Safari - Preferences - Privacy & see that 'Block cookies' is not set to Always.
    Failing that - switch Safari extensions Off via Safari - Preferences - Extensions & test again

  • "open vi reference" with run time menue

    Hello,
    I met some problems with "open vi reference" in labview.i can't parallel run this vi with the run time menue.i can't load the any vi then the run time menue has activation.(the "open vi reference" can run after the run time menue release.). it's means  labview is serial running for this both function.but now i want to parallel running in the program.so would you give the some idear?

    Now I see what you are talking about.  What you are trying to do is expected behavior.  If you click on the menu while any state is running that doesn't lock the front panel, then the menu will halt the VI execution until you choose a menu item.
    You should check the option in the event to "Lock front panel until event case for this event completes"  Then you will not be able to click on the system menu until tthe VI is launched and running.  If you wire a True like I suggested before, then you will fall out of the case pretty quickly in non-hoghlight mode, and the user most likely will not notice.  If the VI you are trying to open is quite large, it will take a little bit of time for LV to load the VI into memory.
    In highlight-mode, you just have to wait for the event to process before you select the menu.
    Message Edited by Matthew Kelton on 12-03-2007 10:56 PM
    Attachments:
    edit events.png ‏27 KB

  • LabVIEW 8.6.1 Project causes slow Open VI Reference

    I have an odd problem with "Open VI Reference.vi".
    Case 1.
    Open  LabVIEW project containing "Main.vi"
    Open "Main.vi"
    Run "Main.vi"
    Execution of "Open VI Reference.vi" take about 2,000ms
    Case 2.
    Open "Main.vi" - No LabVIEW project open
    Run "Main.vi"
    Execution of "Open VI Reference.vi" take about 100ms
    I converted the project to 8.5 and the problem goes away. I don't have any machines with 8.6.0 to test if this is an issue with 8.6.1 only.
    Has anybody else seen something like this?
    Solved!
    Go to Solution.

    Good catch on the type def. It turns out that this is also key to the problem.  I cleaned up my example VIs, removed the Type Defs and OpenG VIs. When I ran the cleaned up VIs the problem went away. So, I added a simple type def back to my called VI and the problem was back.
    You misunderstand the reason for including gmath into the project. This has nothing to do with the time to load the project from disk. The problem is slow execution of "Open VI Reference.vi" when opening VIs that contain TypeDefs that are in large projects. By including gmath I was able to create a large project without attaching extra VIs.
    Open Reference Test - No Project: 11 ms
    Open Reference Test - small Project: 105 ms
    Open Reference Test - large Project: 753 ms
    Code in Zip file is LV2009
    Message Edited by Gleichman on 08-21-2009 06:36 PM
    Attachments:
    Open Ref Test - II.zip ‏62 KB

  • Open VI Reference Function won't execute in multi process application

    I have a sub vi with Reentrant execution, and it has
    recursive call on some cases.
    It is very similar to OpenG VI “Read Key
    (Variant)__ogtk.vi”, my sub vi works without any problem unit LabVIEW’s Two
    Button Dialog is opened in other process loop.
    I have attached a Test VI, and would like to understand why
    would Loop 1’s Dialog box have any execution impact on Loop 2’s process?
    Why Open VI Reference Function won’t execute when Two Button
    Dialog is opened in other process?
    LabVIEW version 8.6
    Thanks,
    Attachments:
    Test Vi.zip ‏17 KB

    Broken Arrow wrote:
    LabVIEW's native dialog box is Modal. It will not let anything else run which requires (or MAY require) user input. In the case of your code, LabVIEW can't open a VI with a modal process going.
    Broken Arrow thanks for your reply, but not sure if I understand Modal dialog box would cause the problem.
      I already had a work around by using Three Button Dialog VI, and it is s Modal VI.
      I would still like to understand, why would DataFlow halt at Open VI Reference Function in Loop 2 when I use when Two Button Dialog?
    Attachments:
    Test Vi 2.zip ‏20 KB

  • Open VI Reference Error 1000

    Here is the problem:
    I am opening a VI (we will call SubVI) through "Open VI Reference" and running the VI in parallel with the VI (MainVI) that I am opening it from. When I run the MainVI using "Run when Opened", I get a Error 1000 and the SubVI freezes. I break out using ctrl-period. Then I start it up from within LabVIEW and the Error 1000 does not appear. Does anyone have an idea of what is going on? Thanks.

    I'm a bit unclear as to what your setup is. I suggest you post an example which will help clear it.
    As a guess, error 1000 means "The VI is not in a state compatible with this operation". If the subVI is the one set to be run when opened, maybe calling it dynamically is what causes the problem.
    Try to take over the world!

  • Open VI Reference asking save option

    Hello,
    I am opening a VI reference to analyze the state of the VI and closing it back and repeating this process for the bunch of VI's in a folder.
    While closing the VI reference, it is throwing save dialog box for the some of the VI's, after closing the dialog only  it is analyzing the next VI. To stop this behaviour I have set the  Open VI reference Option to 0x20, but still it is coming. Please Give me some way to prevent this.

    Are there any additional dialogs?
    My assumption is, that those VIs are deriving from older LV versions and are not masscompiled to the current version you are using. Therefore, if you open the VI, LV developement environment will automatically recompile them, which will change the VI. So when unloading the VI, the developement environment will ask you to save unsaved changes (recompilation) of the VI......
    Using the parameter 0x2 for opening the VI reference only effects the loading (supress the search dialog for subvis, do not mistake that with the "Browse for SubVI" dialog!), not closing the reference.
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Open vi reference by string in executable

    Hi all,
    Scenario: A top-most vi (main.vi) calls two subvis (subvi1.vi and subvi2.vi) separately such that they run in parallel. subvi1.vi has a front panel that appears when called, subvi2.vi does not.
    subvi2.vi uses Open vi Reference to get a reference to subvi1.vi. It then uses this reference in a loop and continually polls the property FrontPanel.IsFrontmost to determine if the front panel of subvi1.vi is frontmost. When it is frontmost, it performs certain actions. When it isn't frontmost - it doesn't.
    This all works great in the development environment, but as soon as I build this 'scenario' into an application I get the following error:
    subvi2.vi is generating the reference to subvi1.vi using the string "subvi1.vi" as an input to the path terminal of the Open vi Reference function. Why does this cause problems in a built executable?
    P.S. Clearly this scenario is actually a part of my much bigger project, hence I don't have any simple vi's to attach 
    Message Edited by Thoric on 04-27-2009 01:06 PM
    Thoric (CLA, CLED, CTD and LabVIEW Champion)
    Solved!
    Go to Solution.
    Attachments:
    crash.jpg ‏28 KB

    Thoric wrote:
    Norbert B wrote:
    Thoric,
    it's disturbing that LV is crashing on your system due to this error.  What version of LV do you use?
    LV 8.6.1 at least (i don't know which version was the first one) creates the following error:
    LabVIEW:  Open VI Reference no longer matches VIs in memory by filename. A filename is no longer sufficient because the full name of a VI now includes any owning libraries.
    This error occurs even in the developement system.
    I asume that the crash itself is created by handling of invalid references.
    hope this helps,
    Norbert 
    Norbert,
    I am using LV 8.6 (not 8.6.1). I am using strings to identify vis, not paths. I believe the error you are encountering only relates to using paths for referencing vis.
    If your assumption is correct and my crash is due the handling of invalid references, then I need to generate a path to the vi, rather then using it's name. But generating a full (non-relative) path might be tricky? If within subvi2.vi I use the 'current vi's path' function and strip it to determine the executable path, then add subvi1.vi, should that get me the path to subvi1?
    THis really depends on how you did your build. If VI1 ends up as dynamic file vs part of the app, the paths will be different. Easy enough to check. Look at where your exe is and figure out if VI1 is there in the support/dynamics. If not it is probably inside the exe to the path would then be "My.exe.VI1.vi".
    But I am speculating thats the issue so try to get more info.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Open VI Reference Function in an Executable

    Hi All,
    Is it possible to call a sub-VI (which within itself calls other sub-VIs not included in the executable source files) from an executable (LabVIEW 2011).
    I have no problems calling the sub-VI via "Open VI reference" when runing the main vi as is. As soon as i build the execuable, search for the intended subVI the exe"looks for a few items" then stalls.
    The subVI controls a few comports, and prompts the user to take some actions. The SubVI requires an input from the Main VI and when completed outputs a cluster of for the Main VI to continue.
    Solved!
    Go to Solution.
    Attachments:
    vi ref.png ‏3 KB

    Hi All,
    Firstly the main error was "1031 ~ VI Reference type does not match VI connector pane."
    Secondly, the subVI had a dependency on "Space Constant.vi" which is stored in the vi.lib, The Main executable did not have "Space Constant" in its vi.lib.
    SOULTION
    1. Added a "space constanst" to the executable project.
    2. Ensured that the Refnum type was not "strict" (also ensure refnum matches VI pane)
    becuase I am using a cluster, if the main cluster changes for any reason, you must update the inputs and outputs of your subVIs. This was achieved may making the cluster a control type def. However, because some subVIs are independent from the main, I have to ensure I use the lastest controls when building independent subVIs.
    This allowed me to run the subVI.
    Thanks.

  • Open VI reference freezes

    Open VI reference seems to run in the user interface thread. If you open a user dialog all the open vi reference functions halt until the dialog has been closed (even though they run in paralell loops etc, no data flow explanation).
    MTO

    > Loading and holding the references at startup is the solution I
    > suggested to the developer who ran into this, for some reason I've
    > never discovered this limitation myself. So it's not a big problem,
    > but one (too) easily overlooked.
    >
    True, this limitation has been there since LV5. It is a temporary
    ordering of things that resolves itself as soon as the modal VI goes
    away, so it very rarely affects an application.
    > We do however more and more develop application where there are
    > parallell independent (should be that is) operations going on all the
    > time, and this seems to introduce problems that are not always what
    > one would expect. The memory leak described in the following is one
    > example:
    >
    This looks a bit like a sneaky way of asking me to look at your "memory
    leak" problem. I modified it a bit, changed the delay to 20ms instead
    of 50, and made the button be a switch instead of latched, so I could
    just let it clone all by itself. Running it in a normal version of LV,
    I let it create and then I'd delete. All total, I created and destroyed
    about 300 VIs, and the memory on my LV for OSX would go up a few megs,
    then back down, then back up bit. I then tried it with a debug version
    where I can look at the amount of memory that LV thinks it has allocated
    at any point in time.
    My quick diagnosis? It isn't a leak, but the extra memory usage is due
    to fragmentation. Basically this stems from the fact that loading a VI
    means bringing quite a bit of stuff into memory. To do this LV asks the
    OS for some allocations. When tearing down the VI, LV frees the
    allocations, if it didn't, this would cause a leak.
    But, just because allocations are freed doesn't mean the system will
    show them as free to give to another app. Here is why. If a program
    asks for one byte, the OS will add one page of memory to the app -- that
    is 4096 bytes. If the app asks for another byte, the OS doesn't have to
    do much, it returns one of the 4095 reserved bytes that belong to the
    app. After the 4096 bytes are used, the OS will give the app another
    page for 9192 total. Interestingly, if the app starts deleting bytes,
    the OS will only be able to take back a page and make it available for
    other apps when no allocations are on that page. So leaving the first
    byte allocated and say the 5000th byte allocated are enough for those
    two bytes of allocation to use up 9192 bytes of memory.
    This effect is caused by fragmentation, and it is there largely because
    memory is cheap, so the OSes don't do any compaction. 4096 bytes on
    even a 64Mb machine is a tiny drop in the bucket, so the OS trades space
    for time and wastes memory to increase performance.
    So, this isn't a guarantee that this isn't a leak. You did the right
    thing in reporting it, and another person in R&D will spend more time to
    verify that there isn't a leak, especially in the new AutoClose Refnum
    feature. But my quick diagnosis is that as the app loads up a new VI,
    some of its lists and arrays grow and are moved to some of the new pages
    leaving behind holes. When the VI leaves memory, some of the pages
    can't be freed because even though the arrays and lists have shrunk
    back, they stay on the new pages. After a few of these chaotic
    operations take place, an equilibrium is reached and the app will stop
    growing. The pattern it takes, and the amount it grows is highly
    dependent on the OS and the heap manager in use. So, on OSX mine may
    only grew 3M, whereas one version of windows may grow 4M and another
    10M. At any point, it is largely out of LV's control and isn't a true leak.
    I hope this helps.
    Greg McKaskle

  • Open VI reference for VITs and VIs

    Hi
    I have a VIT and I get the reference using the Open VI reference. When I change (rename) this back to a VI, and get the reference for it, its much faster. Does the open VI reference takes longer for VITs than VIs in obtaining a reference?
    Another question  is the same VIT, takes lesser time to get the reference using the Open VI reference in LabVIEW 8.5.1. It takes longer in LV8.6. Why is this happening? 
    Thanks
    Vaa San.

    The two main differences between a VI and a VIT are that   VITs are never run, but are templates that generate a VI instance immediately that has all the properties, attributes and limitations of a VI.  A VI on the other hand has only one instance (unless you make it reentrant)
    ·         A VI generated by a VIT is debuggable just like a VI in that you can trace the execution along the wires. In general, a VIT creates a copy of the VI in memory when you open a reference to it. Creating that copy takes time, which affects performance when doing recursion. That copy is then a standard VI in every sense, except it is not a file. Also, if you don't close these references, they will take up space in your RAM. Reentrant VIs can currently only do real recursion in 8.5 and if they are part of a class. If you open a VIT, you don't open the actual file, but a clone. This way you can open it multiple times. Each time you open it, you get a clone. This is especially useful when you open the VIT with VI Server. VIT's are useful to make an interface window once, and use it multiple times in your program. If the code should run multiple times, but doesn't have a user interface, use reentrant VI’s instead. As far as having the project open, a VI will reload all instances related to the project therefore causing the Vi to load slower. Best Regards,
    Juan Galindo
    Applications Engineer
    National Instruments

  • Error 1003 occured at Open VI Reference

    This error occured when I want to used the LabView Report Generation Toolkit for Microsoft Office Example.
    It's impossible for me to execute the example "Generate Report from Template(Excel)"
    I suppose I have a problem with the Open VI Reference.vi function but I don't know where is that VI.
    Could you let me know where are the VIs listed in the Application Control Pallette.
    Do you know why I have this type of problem.
    Thanks
    Lucie

    The VIs located on the application control palette are primitives and are part of LabVIEW itself. Therefore you can not look at their diagrams because they don't have one.
    However the 1003 error means that you are trying to dynamically load a VI that is not executable. I would suggest turning highlight execution on and following the code to see what path is sent into the Open VI reference function.
    Once you have the VI that is failing to open go manually open it.
    Chances are that it is broken, so see why it is broken. If I remember correctly there is a linking issue in that example, so you can open the VI that is broken and hit ctrl-shift-Run Button, and that should relink it all and fix the issue.
    If not take a look at this
    Why Do I Get Error 1003 From Application Builder When I Try to Build Excel Macro Example.VI?

  • Open vi reference in executables

    My application requires to run two sub vis in parallel , Even though the VI is running the executable is showing reference.
    I am using open VI reference to open the sub vi from the main vi
    please reply..urgent

    I guess your problem is related to the vi path. You should create some indicators for debugging. One indicator for the path, and some indicators on the error output. Then you can build your aplication for testing.  
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • DG broker Switchover issue, ORA-16535: CRS is prevent execution of a broker

    I am having setup of 2 node 10.2.0.4.0 RAC setup on ASM with Single Instance Physical standby on File System (OS: REHL 5.4). I configured DG Broker without any major issues. Getting all output of 'show configuration' and all DG related logs are clear. Archives are getting transferred from both Primary nodes.
    DGMGRL> show configuration
    Configuration
    Name: dg_rac
    Enabled: YES
    Protection Mode: MaxPerformance
    Fast-Start Failover: DISABLED
    Databases:
    livestdby - Primary database
    livedg - Physical standby database
    Current status for "dg_rac":
    SUCCESS
    Now I am getting error Error: ORA-16535: CRS is preventing execution of a broker operation.
    DGMGRL> switchover to livedg;
    Performing switchover NOW, please wait...
    Error: ORA-16535: CRS is preventing execution of a broker operation
    Oracle Says
    Cause
    A broker operation was underway that required CRS to stop managing the instances of this database, but CRS management could not be stopped on behalf of the broker"s request on
    at least some of the instances, so the broker operation was canceled.
    Action
    Suspend CRS management of this database using SRVCTL STOP DATABASE -D <name> -O NONE. Then reissue the broker request.
    But this command is not working as it's given to stop the database.
    One more thing, it's nowhere said to stop CRS while performing Switchover / Switchback using DG Broker. When we do Switchover / Switchback we keep open only one of the Primary database.
    Anybody knows regarding this error???? or is there any solution for this ???? (is it bug ???)
    is there any documentation / link available to switchover of RAC database using dgmgrl (DG Broker)
    Any help would be appreciated.
    regards,
    manish

    Hello;
    I would check the tnsnames.ora on the Standby that's about to become the new Primary.
    Based on the information you provided I'm thinking you cannot connect from the Standby site to the Primary and thus the switchover fails and throws this error.
    If that checks out make sure the firewall rules for both server line up.
    Best Regards
    mseberg

Maybe you are looking for

  • Elements and Bridge

    I have been EXTREMELY happy with using Photoshop Elements 8 together with Adobe Bridge (which came bundled with PSE).  This has proved an excellent combination for the enthusiastic (and excessively prolific!) amateur.  I import my photos (normally RA

  • Getting unknown error 0x8004011c. when trying to set up email account in Outlook 2013 with a Domain

    Hi all The title basically states the problem - Outlook 2013 wont set up with a Domain. This only seems to affect Windows 8.1 pro, Win 7 Pro has no problems.  If I log on to the computer itself (not the domain) Outlook runs no problem If anyone has a

  • Mac Pro and monitor compatibility

    Hi Just ordered a new Mac Pro (ATI Radeon HD 4870 512MB), couldn't afford an apple display. I'm looking to take advantage of the dual monitor option. Can anyone tell me whether I need an adapter to connect the following monitors? Or even if the follo

  • No Order Confirmation E-mail

    Hi,  I have not received an order confirmation e-mail for the hard drive I recently purchased. Also, it does not show anything under "Order Status" or "Purchase History." I would greatly appreciate an explanation or assurance that my order went throu

  • Where is the animation panel in Photoshop CS6 extended?

    where is the animation panel in Photoshop CS6 extended?