How do I store VI References in global variables and access them later

From what I know, Labview automatically deletes VI references when they go out of use. Is there a way for me to override this so that I can access a set of preloaded references in a separate VI? Essentially I would like to open the VI's dynamically into the memory, store the references in global variables and access them at a later time. The VI's I'm referencing won't be known until runtime. I know its not the safest way to do it, but it would be the most productive on my end.
Thank you
Clay Upton

I'm not sure what you mean by "a later time", but a VI reference will remain valid as long as the VI is in memory. If you don't unload the VIs, the references will remain valid.
If you do need to unload the VIs, for whatever reason, I would suggest the following:
Create a functional global as your interface for obtaining the references.
Feed the paths to the VIs into the VI when initializing it (since you don't know which VIs in advance).
When calling the VI to obtain the references, have the VI check them first (using the Not a Number... primitive). If it sees that they're invalid, it can open a new reference and return that.
You should note that when a VI is removed from memory, the data space is used is released, so if those VIs are expected to hold data (using shift registers, etc.) this will be a problem.
The description I've given will only be usable in certain instances (and it has its intricacies), but you didn't really give any details about what you're actually trying to accomplish.
Try to take over the world!

Similar Messages

  • How Do I Store HTML in a String Variable and then display in JSF

    Hi,
    I generate some HTML code and store in a String varible (ie. String str = "<b>Hello World</b>";)
    I want to display the HTML in a JSF page. I tried using <h:outputText value="binding to the variable"/> and it prints out the entire string and not the rendered HTML i desire.
    I also enclosed the <h:outputText> within <h:verbatim> tags and that does not work either.
    I want to display some generated HTML without having to make a custom component.
    any help would be appreciated.
    Thanks,
    -d

    Simply use the escape attribute of h:outputText.
    Here is the code :
    <h:outputText value="binding to the variable"
                  escape="false"/>

  • How can I check for references to previous server and remove them?

    I recently migrated several Win7 PC's off an old sbs2003 box to a new 2012 essentials server.
    All client data is stored on the server in a shared folder and that is mapped to the local PC's.
    Everything has been great, except we have noticed a delay of 10-15 seconds the first time on one PC, the user opens up Word or Excel and clicks on File (to check recent documents) - it goes to "not responding" for 10-15 seconds and then is perfectly
    normal.
    Once the program responds again (and the recent documents appear), there is no longer any delay in opening any of the documents at all.
    If the user goes off and browses the internet for a while and comes back, re-opens Word or Excel again, the same thing happens.
    I've checked what I hope is most stuff, and think I've come down to references on the PC to the old server still.
    Is there a list of registry entries/groups that I should be checking, and are there other places aside of the registry that I should be checking also, so I can be sure that only the new server is referenced?
    Appreciate any guidance please.

    Hi,
    Where is these recent office document located? On your Server?
    Generally speaking, application hungs means its process isn't waiting for Windowsing input. Is other application have similar problem?
    To troubleshoot this problem, firstly, I would like to suggest you using Process Explorer to check Word or Excel's stack. Then check what does its thread waiting for.
    Downlaod Process Explorer:
    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
    If no use, you can use Process Monitor to monitor the starting process of Word or Excel, then we should be able to find which resource cause hung.
    Download Process Monitor:
    http://technet.microsoft.com/en-us/sysinternals/bb896645
    Note: When using Process Monitor to caputer app's trace. Firstly, please set its filter Process Name is Word.exe.
    After that, start work to start monitoring.
    If there is any difficute using these tools, please feel free let us know.
    Roger Lu
    TechNet Community Support

  • Why not to store notifier reference in global

    Hi all,
    I am working with notifiers and queues in multiple VIs. I have strange behaviours, when I store the queue and notifier references in global variables.
    I have read some entries in this forum, and some says, it is a "bad idea", that "should not be done", to store the refs in globals.
    Can anybody tell me, what is the real background?
    regards
    mitulatbati
    Solved!
    Go to Solution.

    Besides that globals are simply evil (just slightly an over the top statement as I really advocate to minimize the use of globals to nothing more than a status boolean or sometimes some single skalar value), all LabVIEW refnums employ some garbage collection.
    The reason to use globals usually implies that you want to create the according resource at one place and use it someplace else. But that often does not work with LabVIEW refnums if the producer and consumer are not in the same VI hierarchy (for instance you create the resource in a startup VI and then spawn a plugin VI that continues while the startup VI terminates). All LabVIEW refnums are automatically disposed at the moment the top level VI in whose hierarchy the refnum was opened goes idle. So at the time your plugin VI gets to work, the refnum and its object has been already disposed and is therefore invalid.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How can i find all global variable and parameters in a form?

    I don't know name of global variables and parameters,but i want get their name and value .
    how can i do? who can help me?
    Thank you.
    Daniel Liang
    2007.1.19

    no problem. As Francois said you can't do it programmatic in runtime.
    But when you use the debug-mode you can see each global with name and value.
    By the way: It's not good to not know all the globals in your application. This is one of the most important things you have to write down for your app. Create a wiki for such informations, so that all developer can share their information.

  • How can I store movies in the cloud and access them from my devices?

    Hello,
    I would like to store movies in the cloud and access them from my device without having to download them to the device because there is not enough space on the harddrive to store them on it. How would I do this? Would I have to download the movies to my PC or could I store them directly in the cloud?
    Thanks,
    Tyler

    Unfortunately I don't use sugarsync myself, I have a dropbox account and it works slightly differently.
    As I understand it you can upload files to a folder in sugarsync from your computer without having them sync to any of your devices. You can access that folder from any of your devices, and although you would need to download them in order to play the video file, you could then delete them without deleting the files in the sugarsync folder in the cloud.

  • How can I store movies in the cloud and access them on my devices without having to download them to them?

    Hello,
    I would like to store movies in the cloud and access them from my device without having to download them to the device because there is not enough space on the harddrive to store them on it. How would I do this? Would I have to download the movies to my PC or could I store them directly in the cloud?
    Thanks,
    Tyler

    Would I have to download the movies to my PC or could I store them directly in the cloud?
    There is good news coming!
    Technology experts are working on a movie storage system where YOU have physical possession of the movie.
    This system stores the movie digitally on an optical disk system that will not be dependent upon a congested, complicated, and fragile network.
    Because all of the data is stored only a few feet from your television, all the bottlenecks are removed.  Performance and reliability are virtually flawless.
    Further, the system will not utilize any form of security codes, authentications, or passwords. Once the optical disc is purchased it can be moved around freely at will, and can even be lent or given to friends and neighbors with zero hassles.

  • How can I create a function using TestStand variables and call it from a step's Pre-Expression?

    In one sequence I have dozens of Pre-Expressions which are almost the same thing, like this...
    Locals.tagID = (Parameters.singlePhaseEnabled ? "L" : "D") & Str(Locals.phase) & "006"
    ...and the only thing different is that three digit string at the end ("006" will vary). How can I write a function that I can call from a step's Pre-Expression so it would look something like this? ...
    Locals.tagID = MyNewFunction("006")

    You cannot write custom commands for expressions.
    That being said, there are a couple of options:
    Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
    Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
    Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
    Norbert

  • Declare global variable and retrive?

    Hi,
    we are working in live project in webtool, we wants to create global variable,
    calling that variable in a required pages, our questions is that where to declare global variable and how to declare in which page we have to declare?   pls guide us its very urgent and send the code.
    Regards
    Kannan.D
    Edited by: kannan desikan on Jan 14, 2008 8:07 AM

    Hi Kannan,
    I would suggest using a comma delimied list or putting it in the database.
    ArrayList myList = new ArrayList();
    myList.Add("one");
    myList.Add("two");
    myList.Add("three");
    string comma = "";
    // store the array in the session state
    foreach (string s in myList){
      Session["persistedArray"] += comma + s;
      comma = ",";
    To get the array back
    if (Session["persistedArray"] != null){
      ArrayList myList = Session["persistedArray"].ToString().Split(new char[1] {','});
    If your array is storing objects, you should use the database.

  • How do I  take four pages on one page, and give them each their own page?

    How do I take four  images on one page, and put them on their own page?

    You need a unique AppleID for each iCloud account.  So grab some free gmail, hotmail, aol, yahoo or whatever email addresses to make five new AppleIDs.  Now, everybody make an iCloud account for themselves, and keep the existing shared AppleID and password just for use in the iTunes and App Stores.  You can also each use your own unique AppleIDs to make iMessage accounts and keep those separate as well.

  • What's the difference between global variables and instance variables?

    hi im just a biginner,
    but what is the difference between these two?
    both i declare them above the constructor right.
    and both can access by any method in the class but my teacher said
    global variables are not permitted in java....
    but i don't know what that means....and i got started to confuse these two types,,
    im confusing.......
    and why my teacher said declaring global variables is not permitted,,,,,,
    why.....

    instance variables are kindof like Global variables. I'm not surprised you are confused.
    The difference is not in how they are declared, but rather in how they are used.
    There are two different "styles" of programming
    - procedural programming.
    - object oriented programming.
    Global variables are a term from Procedural programming.
    In this style of programming, you have only one class, and one "main" procedure. You only create one instance of the class, and then "run" it.
    There is one thread of control, which goes through various methods/procedures to accomplish your task.
    In this style of programming instance variables ARE "global" variables. They are accessible to all methods. There is only one instance of the class, and thus only one instance of the variables.
    Global variables are "bad" BECAUSE you can change them in any method you like. Even from places that shouldn't have to. Also if you use the same name as a global variable and a local variable, you can cause great trouble. This can lead to very subtle bugs, as the procedures interact in ways you don't expect.
    The preferred method in procedural programming is to pass the values as parameters to the methods, and only refer to the parameters, and local variables. This means that you can track exactly what your method is doing, and what it affects. It makes it simpler to understand. If you use global variables in your methods, it becomes harder to understand.
    So when are instance variables not global variables?
    When you are actually using the class as an Object, rather than just a program to run. If you are creating multiple instances of an object, all with different values for their instance variables, then they are not global variables. For instance you declare a Person object with an attribute "firstname". Your "main" program then creates many instances of the Person object, each with their own "firstname"
    I guess at the end of all this, it comes down to definitions.
    Certainly you can write procedural code in java. You can treat your instance variables, for all intents and purposes like global variables.
    I can only think to show a sort of example
    public class Test1
       User[] users;
       public void printUsers(){
         // loop through and print all the users
         // uses a global variable
          for(int i=0; i<users.length; i++){
            users.printUser();
    public void printUsers(User[] users){
    // preferred method - pass it the info it needs to do the job
    for(int i=0; i<users.length; i++){
    users[i].printUser();
    public Test1(){
    User u1 = new User("Tom", 20);
    User u2 = new User("Dick", 42);
    User u3 = new User("Harry", 69);
    users = new User[3];
    users[0] = u1;
    users[1] = u2;
    users[2] = u3;
    printUsers();
    printUsers(users);
    public static void main(String[] args)
    new Test1();
    class User{
    String firstName;
    int age;
    public User(String name, int age){
    this.firstName = name;
    this.age = age;
    public void printUser(){
    // here they are used as instance variables and not global variables
    System.out.println(firstName + " Age: " + age);
    Shit thats a lot of typing, and I'm not even sure I've explained it any good.
    Hope you can make some sense out of this drivel.
    Cheers,
    evnafets

  • In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    In Pages 5.2.2: How do you go from 1 column to 2 and keep them on the same page?

    Sorry, I tried to say your answer solved my question, but I guess I told it that my response to you solved it. Now that I liked it, the solved option doesn't appear.

  • I have an imac and macbook pro. my creative suite 5.5 design premium is on them both. I'm about to take them in to the apple store because they are running bad and have them completely restored to factory settings. when I get them back will i be able to r

    I have an imac and a macbook pro. my creative suite 5.5 design premium is on them both. I'm about to take them in to the apple store because they are running bad and have them completely restored to factory settings. when I get them back will i be able to re-install my adobe creative suite to both of my computers using my same product code from when i first bought it?

    Yes. Just make sure to deactivate the license on both systems using Apple menu --> Deactivate while one of the suite programs is running.
    Mylenium

  • When printing a list in Address Book, how can I select more than the default Attributes and keep them selected when I print again? I want to print ALL information for contacts so I have email address, notes, phone, company, title, etc all on one page.

    When printing a list in Address Book, how can I select more than the default Attributes and keep them selected when I print again? I want to print ALL information for contacts so I have email address, notes, phone, company, title, etc all on one page. I don't want to have to check off an additional 5 or 6 attributes each time I print out contact information. Is there a way to change the default setting for printing lists, so it is not just "phone," "photo," and "job title?"

    I have a user who wants to do this same thing. I did not find any way either to default the attributes to anything other than what you see the first time. Seems like such a trivial thing, hard to believe they do not allow it. I did find a program for this called iDress but I can't seem to download it from any links on the Internet. Not sure if it is free or not, but it was recommended by a link on the Mac support site.

  • I cannot play purchased songs in iTunes v11.0.1.12 or sync them to my iPhone and the songs are no longer available for downloard in iTunes store (so, I can't delete and download them again).

    I cannot play purchased songs in iTunes v11.0.1.12 or sync them to my iPhone and the songs are no longer available for downloard in iTunes store (so, I can't delete and download them again).

    carolinechx wrote:
    i know the description may be a little bit too confusing
    Mostly because you are not using any capital letters or paragraph returns and your post is difficult to read.

Maybe you are looking for

  • Apache Tomcat as Win NT Service

    Can anyone help me get this setup? I read the manual and I think I got it installed as a service, and I can start it, but I have no idea what port it's running on, or if it's running at all. Can you help me?

  • User Based Security in Power BI (Power Pivot / Power View)

    I am looking for a way to implement User based security (based on user access needs to restrict data) for my Power BI reports. Is there any way implement this kind of security. We have this support in traditional OLAP cube by creating roles and manag

  • Problem building PetStore 1.1.2 with WebLogic 6.1

    I am trying to build the JPS-1.1.2 example using WLS 6.1 according to the instructions at: http://e-docs.bea.com/wls/docs61/petstore/bea_deployathon.html The build fails with the following message: [execon] Error: [jspc]: 2 file(s) failed: [execon] /

  • How to cancel task which are in Queue state in SCOM console?

    Hi All, When I start any task it does not execute. It show task is in queue state. How can I cancel or execute this task? Thanks

  • Loadercli -p: no module named _csv

    Good afternoon, I'm having a problem on a Win2003 X64, with loadercli -p. calling it on a cmd shell, I'm getting a "no module named _csv", followed by other messages, regarding the module sax. I think that the problem is strictly related to the _csv