Open VI reference and paths problem

Hi,
in my project I need to have a VI running independently from the calling VI so I use VI Server and "Open VI reference" to run the VI. However this is not without problems. The VI that I run is not in the same folder, as the caller VI and also not on a fixed location on disk, so I use relative paths (something like "..\subfolder\myVi.vi"). This works in the project and .exe but not e.g. in a .llb file where there seems to be no folder structure anymore.
Actually I'd prefer if this would not use paths on disk at all but if I could somehow create a reference to another VI in my project and it would even work if the VI's location on disk changed (and is updated in the project). I think it is quite confusing that I have to care about physical location of the VI here when I use the project browser for everything else. Is there a way to accomplish this? Or is there even a better way to start a VI that keeps running even after the caller stopped?
Thanks,
Tobias

As far as I've seen, every VI has the path ../Application.exe/currentvi.vi when you are running in a build.  Therefore, to open another VI you have to strip the current vi's path once, and add the other vi. 
I have written a VI that determines whether or not I'm running from a build, it is attached.  It returns true if you're in a build, and also the current vi's path stripped once giving you ../Application.exe.
The way I use the VI is pictured below.  I send the stripped path Is Executable returns and the relative path (minus the vi name) into a Select icon which is wired to the boolean Is Executable returns.  Then I add the other VI name to the path.
Message Edited by elset191 on 04-21-2009 10:43 AM
Tim Elsey
LabVIEW 2010, 2012
Certified LabVIEW Architect
Attachments:
Is executable.vi ‏8 KB
untitled.JPG ‏7 KB

Similar Messages

  • Open VI Reference and Stand-Alone

    Hi!
    Using LabView 7.1 under XP I made a vi which creates a report in Excel format.
    The vi runs correctly but, If I do a Stand-Alone application of that vi, an error 7
    (problem occured at Open VI Reference in New Report.vi) appears when I launch the exe. Why ?
    Someone has any idea ?
    Thanks

    I my particular case, I only add the vi's that are dynamically called in the Source Files list of the Build Application (see attachment). I did nothing else !
    On the other hand, I have Oslo observed that the "Current Vi's path" gives for example:
    c:\directory1\directory2\Library.llb\viName.vi
    when testing within LV while it gives
    c:\directory1\directory2\Application.exe\viName.vi
    when running the EXE. I have first expected to get
    c:\directory1\directory2\Application.exe
    when running the EXE and thought it was a bug of LV. However, there is no bug (here) and "Current Vi's path" works as described in the documentation:
    "...If you build the VI into an application, this function returns the path to the VI in the application file, and treats the application file as a VI library.".
    Regards,
    Frédéric
    Attachments:
    ScreenShot.jpg ‏149 KB

  • Quirk, Open VI Reference and LLB

    I found a strange quirk opening a VI Reference (on a PXI).  The "normal" method of doing this is to Open Application Reference (to find the remote site) then to Open VI Reference with the path to the desired VI.  Darren Nattinger pointed out (in 2006) that you can use just the name of the VI, provided the VI is on the same folder or LLB as the current VI.
    Caveat -- this behavior is present in LabVIEW 7.0 (I'm maintaining some "legacy code").  I suspect it will be present in later versions, but haven't (yet) tested it.
    Quirk 1 -- if the VI in question has been downloaded (or deployed) to the remote site, and hence is in memory, then the "path" information isn't used, only the VI name.  Thus if you have a path "C:\ni-rt\startup\MyVI.vi" specified in the Open VI Reference, but have absolutely nothing in the startup folder on your PXI, but have "deployed" your Project, this call will work, even though the "path" part of the argument is not valid.  Useful when testing.
    Quirk 2 (and the "real" reason for this post) -- if the VI is embedded in an LLB, it depends on whether or not it is a "Top-level" VI or not.  Suppose the path is C:\ni-rt\startup\MyLib.llb\MyVI.vi.  Consider two VIs in this LLB -- TopLevel.vi and SubVI.vi (where TopLevel is at the top level of the LLB, whereas SubVI is not).
    Case A -- the LLB has actually been downloaded to the remote site.  Doing an Open VI Reference, with either the full path or just the VI name, works, whether or not you are calling TopLevel or SubVI.  Nothing surprising here.
    Case B -- you are taking advantage of Quirk 1, and have not actually put the file on the Remote site (i.e. there is nothing at the path specified).  You have, however, downloaded the LLB to the Remote.  Doing an Open VI Reference with SubVI, whether with full path or just VI name, works fine.  However, trying to open TopLevel fails, with Error 7 (File Not Found), whether using full path or VI name.
    Summary -- Quirk 2 is that Quirk 1 has a quirk if the VI being referenced is a top level VI in an LLB.
    [My apologies if this is common knowledge -- I failed to find this behavior documented, but may have overlooked something].

    Bob Schor wrote:
    I found a strange quirk opening a VI Reference (on a PXI).  The "normal" method of doing this is to Open Application Reference (to find the remote site) then to Open VI Reference with the path to the desired VI.  Darren Nattinger pointed out (in 2006) that you can use just the name of the VI, provided the VI is on the same folder or LLB as the current VI.
    Caveat -- this behavior is present in LabVIEW 7.0 (I'm maintaining some "legacy code").  I suspect it will be present in later versions, but haven't (yet) tested it.
    Quirk 1 -- if the VI in question has been downloaded (or deployed) to the remote site, and hence is in memory, then the "path" information isn't used, only the VI name.  Thus if you have a path "C:\ni-rt\startup\MyVI.vi" specified in the Open VI Reference, but have absolutely nothing in the startup folder on your PXI, but have "deployed" your Project, this call will work, even though the "path" part of the argument is not valid.  Useful when testing.
    Quirk 2 (and the "real" reason for this post) -- if the VI is embedded in an LLB, it depends on whether or not it is a "Top-level" VI or not.  Suppose the path is C:\ni-rt\startup\MyLib.llb\MyVI.vi.  Consider two VIs in this LLB -- TopLevel.vi and SubVI.vi (where TopLevel is at the top level of the LLB, whereas SubVI is not).
    Case A -- the LLB has actually been downloaded to the remote site.  Doing an Open VI Reference, with either the full path or just the VI name, works, whether or not you are calling TopLevel or SubVI.  Nothing surprising here.
    Case B -- you are taking advantage of Quirk 1, and have not actually put the file on the Remote site (i.e. there is nothing at the path specified).  You have, however, downloaded the LLB to the Remote.  Doing an Open VI Reference with SubVI, whether with full path or just VI name, works fine.  However, trying to open TopLevel fails, with Error 7 (File Not Found), whether using full path or VI name.
    Summary -- Quirk 2 is that Quirk 1 has a quirk if the VI being referenced is a top level VI in an LLB.
    [My apologies if this is common knowledge -- I failed to find this behavior documented, but may have overlooked something].
    This will likely not apply at all to >= 8.0. LabVIEWs Open VI Reference will now distinguish cleanly between absolute path and just the VI name itself. If you use just the VI name the VI needs to be in memory or for a built application included in the app. The quirk about VIs in the same LLB as the currently active VI sounds very strange to me but it may still work.
    However if you specify an absolute path, Open VI Reference will bark with an error if the VI can not be found at that location or if the VI already loaded in memory with that name has not the same absolute path. This is supposedly to make it very hard to create cross linking even when using VI server.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Adobe CS4 won't open "An unexpected and unrecoverable problem has occurred because of a disk error.

    Photoshop CS4 will not open, when I try and open it I get "An unexpected and unrecoverable problem has occurred because of a disk error. Photoshop will now exit." Bridge is working fine?

    No reset window came up it get's as far as initializing and then this window comes up

  • CR Developer 2008 extremely slow to open... and other problems

    Hi all,
    I'm having problems with Crystal Reports 2008
    When I click on the icon, the CR window opens straight away, but it takes a full 8 minutes before the Start Page loads. During this time, I can't click on anything (theres just an hour glass).
    I've tried uninstalling and reinstalling (twice) and I'm still having the problem.
    Also, once it eventually loads, I can't get to the Page Setup options. It just comes up with an "Out of Memory" error. I've tried removing all the printers as suggested elsewhere on these forums and reinstalled (as mentioned before) but the problem remains..
    Any help would be greatly appreciated.
    Kyle.

    Disabling the 'Check for Updates' option has solved the issue of CR taking a long time to load but the Page Setup 'Out of Memory' error remains.
    I'm not sure I 100% understand what you're suggesting Graham.
    I have 6 printers installed, all work fine with other software. I have tried removing and reinstalling them but the problem remains.
    I've even removed all the printers, reinstalled CR with no printers installed (so it just has 'Fax Printer' and 'Microsoft Office Document Image Writer' in the Printers and Faxes window) and the problem still occurs.
    Any other suggestions?

  • Challenging Lexical Reference and SQL Problem

    Hi,
    I am trying to build a product hierarchy master report but I have a challenging problem at hand. To generate the report I need an SQL statement with lexical references and before parameter form. Basically, my SQL statement looks something like this:
    Select &Columns
    From &Tables
    Where &Criteria
    Before Parameter:
    In If X='1',
    &Columns := A.NAME, B.NAME, C.NAME
    &Tables:=A,B,C
    &Criteria:= A.CODE=B.CODE, B.CODE=C.CODE
    In If X='2',
    &Columns := A.NAME, B.NAME, C.NAME, D.NAME
    &Tables:=A,B,C,D
    &Criteria:= A.CODE=B.CODE, B.CODE=C.CODE,C.CODE=D.CODE
    In If X='3',
    &Columns := A.NAME, B.NAME, C.NAME, D.NAME, E.NAME
    &Tables:=A,B,C,D,E
    &Criteria:= A.CODE=B.CODE, B.CODE=C.CODE,C.CODE=D.CODE, C.CODE=E.CODE
    I need to build a group left report and group by A,B and up to E if X='3'.
    Any idea how can I accomplish this? Any kind of help or advice is urgently needed. Thank you in advance.

    Siak,
    build a kind of maximum modell. Set the initial values of your Parameters to the maximum (like for columns:
    a.name as aname, b.name as bname, ...., e.name as ename)
    and build a layout for this. Then in a before report trigger set the paramters you want and fill the not needed with dummy values. For example if X=1 then
    :columns := 'a.name as aname, b.name as bname, c.name as cname, ''x'' as dname, ''x'' as ename'
    In the layout supress the output of non used fields with a format trigger or use dependent from your X three different layouts. I've not tested it, but it's a chance ...
    regards
    Rainer

  • Command line parameters and path problem

    hello ....
    I have to execute an application from my java program. My application called "AIMSS" takes 2 command line parameters. Now, when i mention those parameters with complete path to my executeable, windows reports that "unable to open the shortcut". Below is what i am trying:
    private static final String WIN_PATH = "rundll32";
    private static final String WIN_FLAG  "url.dll,FileProtocolHandler";
    private String cmd = null;
    private String url = null;
    public void runMyFileWithMessage(String msg)
        try
    url = "C:\\Program Files\\Raytheon\\AIMSS 4.0\\Runtime\\Standard\\aimss40.exe" + " AAAVIETM 3457";
                 cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
                 System.out.println(url);
                 Runtime.getRuntime().exec(cmd);
            catch(IOException io)
                System.out.println("AIMSS problem. Below is the Stack Trace.");
                io.printStackTrace();
        }Although, when i tried to run the executeable from Start->Run, by giving it same complete path and 2 arguments, it runs fine. Any help would be greatly appreciated.
    Raheel.

    Passing multiple paramters in a String to exec() doesn't work. Use the exec method that takes a String array instead and pass the call and each parameter in as a separate String.
    Off the top of my head (check the api) it will be something like
    String[] cmd = {"C:\\Program Files\\Raytheon\\AIMSS 4.0\\Runtime\\Standard\\aimss40.exe","AAAVIETM", "3457"};
    Runtime.getRuntime().exec(cmd);

  • Getting Java set up - javac and PATH problems..

    Just as the title suggests, I am brand new to Java. I am getting the seemingly "classic" newbie Java error in comman prompt: " 'javac' is not recognized as an internal or external command, operable program or batch file." I have read help sites and threads, and I do believe it must be something wrong with my PATH environments, but I can't figure out what. Also, I have tried several different java versions, so I can only believe that my current version is jdk1.6.0_03 (According to the official website I have 6, Version 3). I am running Windows XP (Service Pack 2).
    Here is the exact text as listed in the variable PATH: C:\ WINNT; C:\ WINNT\ SYSTEM32; C:\ jdk1.6.0_ 03\ bin
    I also have another variable called CLASSPATH, which is: .;C:\Program Files\Java\j2re1.4.2\lib\ext\QTJava.zip
    A friend suggested that I learn with DrJava, because he said that is the way he learned, but of course that only helped with learning some basic code, and it only postponed the problem I am now having to face.
    I know I am utterly useless, and I am sure that whatever alien language I just put up there must be just way off base, but please bear with this poor beginner. Any help is useful, literally any, and I am going to wipe any previous thoughts of what I thought was correct away.

    Are you able to set the PATH without any errors on command line ? Or another best way is to set the path in the user and system variables.
    Go to
    MyComputers->Properties->Advanced (tab)and click the
    Environment VariablesAbove you will see
    User variables
    IF there is already a variable name PATH then add the
    C:\jdk1.6.0_03\binElse
    Click the
    New type PATH as the Variable Name
    and the C:\jdk1.6.0_03\bin as the variable value.
    Re-start your command prompt and check with the javac or java commands.

  • Since upgrading my Mac OS 10.9 and Mavericks, I am unable to open App Store and other problems.

    My computer has gone haywire since upgrading to Mac OS 10.9 and adding Mavericks. Mail was a big problem with my not being able to read messages, but now there has been a mail upgrade to solve that. However, still cannot open App Store from my Dock and cannot open Software Update from the apple menu. Lots of other screwy things going on and Apple seems of no help to try and resolve these issues. Anyone with similiar problems or issues?

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain models.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Open vi reference sub-VI problem

    Hi,
    I am trying to make a splash-screen front to one of my applications. I use the scheme in the attachments. It works well when in development mode, but when I create an executable, I get the error attached. It seems that the executable can't find some of the toolkits I use, but I don't know how to solve it. 
    I hope you can help me.
    Solved!
    Go to Solution.
    Attachments:
    error.png ‏167 KB
    Startup.vi ‏23 KB

    Problem solved. 
    The Main VI of the program, loaded after the splash Screen, had a lot of dependencies, which where not loaded when called via ref in the setup.vi
    To solve the problem, I had to chech the "Use LabVIEW 8.x file Layout" in the Advanced section of the build specification, it solves the problem and the child VIs now have their dependencies at runtime.

  • JAR and Paths problem

    Hi, I wrote an app and jar it in a file. However when the code tries to instantiate objects in another jar file (which is in the classpath) it throws a java.lang.NoClassDefFoundError. Arggh...its frutstrating when it works "unjar".
    BTW inside the app I created images using ImageIcon e.g. ImageIcon imageIcon = new ImageIcon("xxx.jpg"); Will the code automatically look into the jar file for the image file? Thanks

    While I cannot currently speak to the files within a separate JAR file, I can speak to loading the images from within a JAR file.
    You should try the following:
    ImageIcon image = new ImageIcon((new Object()).getClass().getResource("/<path_to_the_graphic/image.gif>"));where the path to the graphic would be the same as the classpath. For example, if the classpath to the graphic was:images.image.gif you would type "/images/image.gif"This will actually pull the graphic as a URL location from within the JAR file.

  • Open Excel read and write problem

    I am trying to deterimine what is causing excel files to open up as "Read Only" using Labview, when I excplicitly state to open as "ReadWrite"
    It seems to work well in the development environment, but not so well on some PCs in the application environment. 
    Attachments:
    lv_excel.jpg ‏122 KB

    Are you using a template file? Is the file marked as "read only"?
    Do you or the application has proper admin rights in the PC where it used?
    Guru
    Regards
    Guru (CLA)

  • Using Open VI Reference to run a VI, on an RT target, with sub-VIs not loaded

    I've been using Open VI Reference and Call By Reference Node to remotely run VIs on my RT controller.  I
    usually wire string data to the vi path input, but this
    requires the VI to be in memory.  I understand (from LabVIEW help) that I can wire a path to this terminal and specify a VI that is
    not in memory, but is on the disk.  NI has an example that
    confirms my understanding.  I get errors when I attempt to do the same
    with VIs that have sub-VIs; I suspect that the problem is that
    the sub-VIs aren't in memory and that the top-level vi doesn't know where to
    look for them (because the paths aren't specified).  All of the sub-VIs are on the RT system (in the same directory), they're just not in memory.
    Is there a way to get LabVIEW to look for sub-VIs on the disk?  I don't want to rely on using a startup application and rebooting to get my VIs into memory.
    Thank you,
    Jim Carmody
    Software Engineer
    G2 Technologies
    www.g2tek.com
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

    Hi Jim,
    It sounds like you are going about calling VIs remotely the correct way.  It would be very helpful if you could post the errors you are receiving.  I also wanted to know if you saw the note at the bottom of the article that says your VI library must contain everything your top level VI calls.
    Eric A.
    National Instruments
    Distributed I/O Product Support Engineer

  • Open VI Reference for a Project Library VI

    Hi,
    my code calls some subVIs by reference by using "Open VI Reference" and "Call by Reference" VIs. Now, "Open VI Reference" expects a path to the VI:
    When the SubVIs sit in the same folder as the calling VI, it is easy to simply supply the name of the SubVI. However, I would like to call a SubVI that is part of a project library sitting somewhere else on the disk. I could give the relative path, but this make the code pretty inflexible and if the relative path changes all the paths would need to be ammended. Ideally, I want to utilize the fact that I am using a project library. The help for Open VI Reference states that
    vi path accepts a string containing the name of the VI that you want to reference or a path to the VI that you want to reference. If you wire a name string, the string must match the full delimited name of a VI in memory on that target. If you wire a path, LabVIEW searches for a VI in memory that you previously loaded from that path on the same target.
     I thought that the underlined path was my ticket and tried something like this:
    but this did not work and I got
    "Error 1004 occurred at Open VI Reference in MainVI.vi:
    Possible reason(s):
    LabVIEW:  The VI is not in memory.
    To load a VI into memory with the Open VI Reference function, a path must be wired for the VI Path input."
    Wiring a path is not desirable as per reasoning above. Is there a way around the issue?
    Thanks in advance!
    Solved!
    Go to Solution.

    tst wrote:
    That should work, but you have to pay attention to something that's stated both in the help and in the error - if you use a string, the only way for LV to know what to access is if that something is already "in memory" (sometimes also referred to as "being loaded"). In the case of standard libraries, that means the VI itself or one of its callers has to be loaded. In the case of classes and XControls, loading the library (as in having it in an open project) should be enough to also load all of its members.
    Hm, thanks, I am not advanced enough to know about classes and XControls, but I will check it out. My VIs are part of a library but obviously don't get loaded because, as you said, all their calls are dynamic.
    tst wrote:
    What I usually do is use a static reference to a VI to get its name, because that ensures that it will be statically linked, included in executables, etc. That might not work for you if you want dynamic loading and then you will need to use some other means.
    Hm, this actually gives me an idea! I could add an enable input to all these dynamically called VIs so that the logic runs only when enable is ON; otherwise the VI is called but does nothing. Then I call the VI first statically with enable=OFF just to load it in memory and then proceed with my dynamic call. A little ad-hoc, but should work and serve my purposes, I think.
    Thanks!!

  • 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!

Maybe you are looking for

  • InDesign CS5, can't open file due to plugins problem

    Hi folks! I'm on Max OSX 10.5.8 and i am currently using a trial version of CS5 (Design Premium) while work sorts out the cash for the upgrade. I work inhouse, and I needed to send an artwork file to an external design agency. I saved the file in CS5

  • N85 pictures not showing up in gallery

    The pictures that I take on my N85 are not showing up in the photo gallery. Using the file manager, I can see that they are being saved to my memory card, but they do not show up in Photos. Really annoying. -Ben

  • Tomact connection

    I have problem of odbc. i have tomcat 4.0.When i go through menu and start the tomcat then my jsp working fine. But when i go to window 2000 Services then start the Apache tomcat service and after that i run jsp then it so error.This is error type Ex

  • Using a RV180W to encrypt data passing thu an existing VLAN

    Hi, I have a customer with an existing VPN across 20 sites that has been implemented using ADSL lines and routers. The VPN is used to view confidential CCTV data. This VPN, which I will call the security VPN, must be upgraded to use the customer's ex

  • 'error 2001' What does that mean?

    I get the message 'error 2001' when updating Acrobat. Using MacBook Pro with IOS Mavericks. What does that mean? / Sawant P