How do you pass vi references from one event to another

I have a vi which gets vi references (thereby loading the vi's into memory) for all the vi's in a given directory when a user clicks a button on the front panel. To do this I use an event structure. My question is whether it is possible to have another event (user button on the front panel) which unloads the vi's from memory. I have tried passing the vi references that are initially generated to the close reference function but whenever I do I get a 'vi reference invalid' error. Does this have to do with trying to pass the vi references between one event and another? If I use a local variable simply pass a reference to another indicator and then probe it, the originally-generated refnum and the local vari
able refnum match up. However once I try to wire that same indicator to the close reference function I get the 'vi reference invalid' error. Is there a different/better way to unload the vi's from memory based on a user button click? Any suggestions would be welcome.
Jason
Attachments:
Load_Directory_of_vi's.vi ‏57 KB

Several problems with your code:
1... Bad idea to use lights as buttons. Yes it can be done, but it's not "natural".
2... If you've gotta do that, set their mechanical action to "LATCH WHEN RELEASED"
3... Because of #2, you are getting TWO copies of every array when you click the LOAD VIs light (er... button).
4... No need for the conversion from path to string and back - use BUILD PATH to append each file name to he folder path.
5... Set the BROWSE OPTIONS on your PATH control to EXISTING DIRECTORY to allow browsing of directories, not files.
6... Your code doesn't care whether the file is a .VI file, or a .ZIP file, or a .TXT file, or what. Use the PATTERN input on the LIST function to discriminate.
7... Your code is only storing the latest refer
ence, not the array of references.
8... An ERROR DIALOG on the OPEN REFERENCE function will tell you that you're getting an error. Why? You are asking to prepare a non-reentrant VI for reentrant execution (why use options = 8?)
9... Because of #8, the latest VI reference is invalid.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks

Similar Messages

  • How do you pass a variable from one form to another

    Sorry, I am new at this.
    I have an ID on one form and I want to pass it to another form and then populate a text field on the second form. How is this accomplished.

    There are various ways to accomplish this depending on your applications' needs.
    Read up on the manual, especially on session state management http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/concept.htm#CIHCFHBD
    This will get you familiar with the basics of url syntax and and session state after which you will have no problem implementing what your asking

  • How do you pass a variable from one page to another thru a button

    I have a page that has a button that goes to another page and allows the user to create a new record related to the data on the previous page.
    The first page is a master, while the second page is a detail. I need the primary key from the first page to update a column in the detail page.
    How do I get the primary key in the second page and how do in put the data in the correct column?

    Hi Nielsen,
    The master detail form should handle everything for you already...Select all rows in each table but only display the records besides the primary keys. Try creating a new master-detail form with this idea, don't bother trying to change some other page.
    Mike

  • How do you transfer Apple IDs from one ipad to another iPad?  I got the new ipad and gave my ipad 2 to my wife who had the first version and now I can't get my Apple ID off so she can use her Apple ID.

    how do you transfer Apple IDs from one ipad to another iPad?  I got the new ipad and gave my ipad 2 to my wife who had the first version and now I can't get my Apple ID off so she can use her Apple ID.

    You don't transfer Apple ID's from one device to another one. You sign out in the settings, )the App Store and iTunes if necessary) and then sign in with the other ID.
    Settings>iTunes & App Stores>Apple ID>Sign out. Them sign in with the other ID. You can sign out of the app store and iTunes as well by going to the featured Atab in the App Store and the music tab in iTunes, swipe to the bottom and access the Apple ID in there.
    You should have erased the iOad before you gave it to her in Settings>General>Reset>Erase all content and settings. That way she could set up the iPad as new with her own Apple ID.
    Be aware of the fact that if you use each others ID's in order to download past purchased content to your own iPads, you will lock yourself out of your own ID as you will have associated your iPad with the other person's Apple ID.
    In other words, if you sign into your wife's ID on your iPad so that you can download an app or an album so that you don't have to pay for it again, you will lock yourself out of your Apple ID for 90 days.

  • How can you move the objects from one server to another?

    how can you move the objects from one server to another?

    Hi,
    Collecting objects for Transporting
    1. rsa1->transport connection
    2. left panel choose 'object type', middle panel choose 'infocube' and 'select objects'
    3. then choose your infocube and 'transfer'
    4. will go to right panel, choose collection mode 'manual' and grouping only 'necessary objects'
    5. after objects collection finished, create request
    6. If they are $TMP, then change the package.
    7. When you click the Save on the change package, it will prompt for transport. Here you can provide an existing open transport request number, or if you like here itself you can create a new one.
    8. You can check the request in SE09 to confirm.
    Releasing Transport Request  
    Lets say you are transporting from BWD to BWQ
    Step 1: In BWD go to TCode SE10
    Step 2: Find the request and release it (Truck Icon or option can be found by right click on request #)
    Note: First release the child request and then the parent request
    Steps below are to import transport (generally done by basis )
    Step 1: In BWQ go to Tcode STMS
    Step 2: Click on Import queue button
    Step 3: Double Click on the line which says BWQ (or the system into which transport has to be imported)
    Step 4: Click on refresh button
    Step 5: High light the trasnport request and import it (using the truck icon)
    Transport
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/224381ad-0701-0010-dcb5-d74236082bff
    Hope this helps.
    thanks,
    JituK

  • How can I pass the photos from one iphone to another?

    how can I pass the photos from one iphone to another?

    Use the Beaming feature. See the info at the ? In iPhoto for iOS.

  • How do you transfer digital booklets from one PC to another PC?

    how do you transfer digital booklets from one PC to another PC?

    Hi Purple Cow,
    Welcome to Apple Discussions.
    The following User Tip will guide you through the procedure step by step:
    http://discussions.apple.com/thread.jspa?threadID=121751
    If you have further questions regarding iTunes for Windows you're better off posting the question in the iTunes for Windows forum which can be found here:
    http://discussions.apple.com/category.jspa?categoryID=150
    Simply pick an appropriate forum from the "Forum/Category" section and post your question.
    Good luck.
    RD

  • How do you move a clip from one event to a different event

    Can't find anyway to do this. Seems pretty likely I'm overlooking the obvious.

    Not sure what you mean. If you mean move clips from one event to another, you can just drag them in the Libraries pane. Or go to the File menu and use the Move Clip command.
    If you mean from one project timeline to another, use copy and paste. Or just edit the edited source clip from the event in the browser to the other timeline.
    Russ

  • How do I move selected photos from one event to another in iPhoto

    Using iPhoto 9.5.1, how to I move selected items from one event into another event. I do not wish to merge both events. Thanks.

    select the photos and flag them - then select the target event and use the add flagged photos to selected event command
    LN

  • How can I pass an exception from one thread to another thread

    If I create a new class, that will extends the class Thread, the methode run() can not be use with the statement Throws Exeption .
    The question now: Is there any possibility to pass an exception from one thread to another thread?
    Thx.

    It really depends on what you want to do with your exception. Is there some sort of global handler that will process the exceptions in some meaningful way? Unless you have that, there's not much point in throwing an exception in a thread, unless you simply want the stack trace generated.
    Presuming that you have a global handler that can catch exceptions, nest your Exception subclass inside a RuntimeException:
    public class NestedRuntimeException extends RuntimeException
        private final m_nestedException;
        public NestedRuntimeException(final Exception originalException)
            super("An exception occurred with message: " + originalException.getMessage());
            m_nestedException;
        public Exception getNestedException()
            return m_nestedException;
    }Your global handler can catch the NestedRuntimeException or be supplied it to process by the thread group.

  • How can you take a photo from one event and put it in another, without dragging to desktop and dragging back into iPhoto and moving it to the event folder I want it in.

    As the title says I need help on how to take a photo from one event and put it in another, without dragging to desktop and dragging back into iPhoto and moving it to the event folder I want it in. Right now when I want to move a picture from one event to another I drag it to my desktop then delete it from iPhoto then I drag it back into iPhoto and put where I want it.An example would be taking a photo from the Christmas event and add it to a specific person event.  Can I do that within the events section without all the dragging. Also is there anyway I can remove duplicates from iPhoto without going through each and every file. Any help would be greatly appreciated.

    Apple doesn't make it easy to do what you want.  However, here's how I do it. 
    Select the photo you want to move and create a new Event for it via the Event ➙ Create Event menu option.
    In the Event mode select the new Event with the one picture and drag it onto the Event you want to move the photo to.

  • How can I pass a value from one application to another through URL

    I am passing a value APP_USER from one application to another application (item is P_ASK_U) through navigation bar entrees URL.
    This is working with in the application..(javascript:popupURL('f?p=&APP_ID.:165:&SESSION.::&DEBUG.::P_ASK_U:#&APP_USER.#') )
    This one is not passing the value, eventhough it open the application..
    javascript:popupURL('http://htmldb.oracle.com/pls/otn/f?p=35129:1:::P_ASK_U:&APP_USER.');
    Is there any syntax error or is it not possible, please let me know..
    Thanks
    Venu

    Hi Scott,
    You are right, the first one do not need # character.
    In the Doc it is mentioned as....
    Pass the value on a URL reference using f?p syntax. For example:
    f?p=100:101:10636547268728380919::NO::MY_ITEM:ABC
    I am using the following URL, it pops up the external application, but it is not passing the APP_USER value to the page item of that application.
    javascript:popupURL('http://htmldb.oracle.com/pls/otn/f?p=35129:1::P_ASK_U:&APP_USER.');
    sorry I still do not know what I am missing..
    Thanks
    Venu

  • How do you get all downloads from one computer to another

    How do I get everything on iTunes from one computer to another?

    You've posted to the iTunes Match forum, which your question isn't really related to. However this KB article will help:<http://support.apple.com/kb/HT4527>.

  • How do you share size properies from one object to another?

    Hi guys,
    I've currently coding my own shoot 'em up game where if enemy is killed,  enemy turns to a block. I want to set it up so the size properies will  pass over to the block (same object size - height and scale) but also  changing the collision properies so the player will be enable push the  block around the screen but I'm not sure how to implement such  functionality/feature. I've experimented with two ways so far;
    1.) The enemy changes to a frame of a block when he dies (illusion of a  different object but the same object with a different frame on the  timeline) using the same size properies but I can't seem to the change  the collision properies from it's prior setting of causing damage and  re-bound/bounce to the player.
    2.) The enemy is removed completely from the game and a new block object  is added in the same position where enemy died but I can't share/code  the same size properies to this new block object making obvious that is a  different object.
    Here is a code I've what I've done so far (which is attempting to do first approach);
    Code:
    function onEnterFrame(event:Event):void
    Collision.block(player, enemy);
    function checkCollisionWithEnemies(bullet:MovieClip)
    if (enemy.hitTestPoint(bullet.x, bullet.y,true))
         if (player.char_type == 1)
           enemy.meter.width -= 10;/// Damaging enemy
           enemy.gotoAndStop(2);
           removeChild(bullet);
           bullet = null;
            if (enemy.meter.width < 1)  //// Dead enemy
         enemy.stop();
         enemy.gotoAndStop(3); /// enemy goes to block frame
         enemy.enemy_char_type = 3; /// enemy becomes block
             if (enemy.enemy_char_type == 3)
             trace ("Hello");
             Collision.block(enemy, player); /// Trying to change collision settings
    Any suggestions/help would be greatly appreciated.
    Thanks
    Jonesy

    Hi kglad again,
    thanks for all your input and support so far, you're been very helpful. Using your code as reference, I either occur a 1046 error - "Type was not found or was not a compile-time constant: DisplayObject" or the new code added doesn't seem to function at all.  I've been puzzling over this all day, seeking for a solution, I was wondering if you point me in the right direction but anyhow here below are my two attempts -
    This 1st code attempt below leads to: a 1046 error - "Type was not found or was not a compile-time constant: DisplayObject"
    <code>
    function checkCollisionWithEnemies(bullet:MovieClip)
                 var block:Block = new Block();
                 block.x = enemy.x;
                   block.y = enemy.y;
             if (enemy.meter.width < 1)
                            enemy.stop();
                            swapProperies(enemy,block);
                            removeChild(enemy);
                            enemy = null;
                            addChild(block);
                           _tweenX.removeEventListener(TweenEvent.MOTION_FINISH, onMotionFinishX);
                           _tweenY.removeEventListener(TweenEvent.MOTION_FINISH, onMotionFinishY);   
    function swapProperies(dobj1:DisplayObject, dobj2:DisplayObject):void
               var propertyA:Array=["x","y","width","height","rotation"]
                for(var i:int = 0; 1>propertyA.length;i++)
                dobj2[propertyA[i]] = obj1[propertyA[i]];
    </code>
    I imported a new class "import flash.display.Object;" to the package to confirm/declare the DisplayObject, but remains to display the same error message.
    2nd attempt - This is where I thought I would directly apply the code to the enemy and block: MovieClips like other objects in the rest of the code, but this attempt leads this new code not to function at all but able to compile/play the game without any errors, I only changed the function swapProperies (the rest of the code is the same) -
    <code>
    function swapProperies(enemy:MovieClip, block:MovieClip):void
               var propertyA:Array=["x","y","width","height","rotation"]
                for(var i:int = 0; 1>propertyA.length;i++)
                enemy[propertyA[i]] = block[propertyA[i]];
    </code>
    Any suggestions?
    Thanks
    Jonesy 

  • How do you move apple configurator from one mac to another mac?

    I want to move the configuraton of apple configurator to a new computer. How?

    Thanks for the reply.
    burgback wrote:
    [...] Are you able to wipe a device manually and then plug it in to the laptop to re-configure without giving you to much of a hassle?
    I guess you mean whether I would be able to add one of the iPads to the new AC Mac by putting it in Restore mode and supervising it from that Mac? That will probably work. My problem is, that I've done that with the whole batch (60+ as I said earlier) when moving to a dedicated account within my own PowerBook some time ago. That takes an awfull lot of time, because it involves doing manual tweaking per iPad and adding the purchased apps again (in the Netherlands we don't have VPP so that is a manual process).
    I would really rather have the settings transfered and continue working on the Mac Mini than starting all over again.
    Regards, Eerk

Maybe you are looking for