Path to Executable from Dynamicall​y called VIs

QUESTION: How can I retrieve the path to an executable that is called from a VI that was created by dynamically loading a VI template?
The application is a bit too complicated to post, so I will try to describe...
I have a built executable. It dynamically calls VITs that are insides LLBs and executes them. Because they are dynamically called from a VIT, the VI loaded into memory this way is only a copy of the VIT on disk - there is no path information to the loaded VI. This all works fine.
I would like to programmatically get a path to the calling executable from within one of these dynamically called VIs (or one of their subVIs). I have so far been unsuccessful.
Call Chain only gives the names of the callers. I couldnt' find a way to get the path info to the EXE from just the name.
The VI property "Caller's Paths" gives me an empty array of paths
Constant paths are unacceptable - I need these modules to figure out the absolute path to data support folders of the calling executable. Not only will they be called by different executables at different times, any one of those executables may be in a different locatin depending on how/where it's deployed, i.e., all over the danged place!
Any answer is appreciated, even if it's "no way, not going to happen"
Thanks in advance!

You need two application properties:
Application.Directory Path and Application.Name
Together they will form the total path of the calling executable
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

Similar Messages

  • Project conflict with dynamicall​y called VIs

       I have a largish project in LV 2010 in XP and W7.  It's all in a project, as I build the main VI into an .exe.  There are numerous other top-level VI's that are called dynamically.  I use source code distributions to build them with their diagrams removed.  The .exe then calls them from a directory similar to "C:\DMT\My Project\Utilities".  (I never did find a good utility for discovering user directories across XP, W7, etc., so we ended up right in C: for config files and support files, stuff that often used to get put in with the .exe in XP and earlier OS's.)
       Besides the top-level VI's, I also have a set of VI's that can be called dynamically to do custom calculations.  The interface to each VI is simple and defined, so users with LV can create their own calculations, put their VI (and sub-vis) in "C:\DMT\My Project\Calculations", and my program can make a call to it.
       My problem is in how the project handles these VIs.  I need to include them in the project, since I need source code distribution builds to assemble a directory of the VI and all its dependencies.  So the actual source is in one place (under SVN), then I build them to another location, which I then deploy to "C:\DMT\My Project\Calculations".  The problem is, if I run the main program from within the project (rather than as an .exe), it links up to these calculations in "C:\DMT\My Project\Calculations" and then the project has conflicts.  The Calculation VI's in the project are now trying to point to "C:\DMT\My Project\Calculations" (which isn't in SVN) instead of to the true source code.  Every time I run the program from the project, I have to remember to go and manually fix the project.
       Sorry if that's a bit complex to describe.  But does anyone have suggestions on an alternate architecture that would eliminate this issue?
    Thanks,
       DaveT
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.
    Solved!
    Go to Solution.

    Thanks!  I'll try that.  (Wondering why I didn't think of that...)
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

  • Error in prepare cursor stmt, when executed from a cgi called from web apln

    We are facing with the following error message:
    Error Prepare cursor SELECT message FROM OPS$SVEERAMA.ERRORCODE ORDER BY message; error code: 549755810774, offset: 180388626432
    549755810774 is the sqlca.sqlcode when printed as long and is -3114 (negative) when printed as int.
    We are trying to execute a cgi from the web application, the cgi in turn tries to connect to the oracle database. The cgi script, tries to establish an oracle connection, and tries to execute a prepare cursor statement.
    We are using oracle 10g and proc - Pro*C/C++: Release 10.1.0.5.0, on linux x86_64 machine. We have two sqlca.h header files, one which has the struct sqlca's variables defined as long and the other as int. we are using the int one.
    Any help is much appreciated. Also if you can let us know what are essential for establishing a db connectivity from a cgi script.(any env variables, etc)

    All oracle error messages are negative number.
    /home/oracle>oerr ora 3114
    03114, 00000, "not connected to ORACLE"
    // *Cause:
    // *Action:I suspect that you have not successfully established a connection to the database. Unfortunately, I don't actually know what you need for CGI. I would check for other errors in the portion of the code where you establish the connection.
    John

  • Is it possible to call a VI that is inside a LabVIEW executable from a TestStand sequence?

    I have created a custom TestStand operator interface and have modified the default sequential process model to display a UUT information dialog that prompts for more information than just the UUT serial number.  This UUT information dialog is a LabVIEW VI.  To distribute the operator interface, I build it into an executable.  As part of the build process, I make a copy of the UUT information dialog VI (which is part of my operator interface project) and place it in the same folder as the executable.  I have then configured the sequential process model to call the dialog VI from this location.  It would be really nice if I could embed the UUT information dialog VI inside the operator interface executable so that I could distribute just an executable instead of an executable and separate VIs.  Is this possible?  In other words, is it possible to call a VI that is inside a LabVIEW executable from a TestStand sequence just like a standard LabVIEW VI call?

    Ryan,
    The dialog that you've created isn't being directly called by the OI at all and shouldn't need to be included in the same directory as the OI for distribution. Since you are modifying the PreUUT of the default process model, you will give the path to the VI in that step, create a deployment and then manually copy the VI to the directory referenced in the step. The VI is considered a support file for the process model and is not related to the OI at all.
    Test Engineer - CTA

  • How can I call a LabVIEW executable from within another LabVIEW executable?

    I have a customer requirement for two LabVIEW executables. Based on their current setup, they need to run executable "A" or "B", both of which are under independent revision control. I have created a third "selection" executable that allows the operator to choose between one of the two, but I am receiving errors when I attempt to call a LabVIEW executable from within a LabVIEW executable using either the "System exec" VI or the "Run Application" VI. If I call a non-LabVIEW executable (such as Windows Explorer) everything works fine.

    > I have a customer requirement for two LabVIEW executables. Based on
    > their current setup, they need to run executable "A" or "B", both of
    > which are under independent revision control. I have created a third
    > "selection" executable that allows the operator to choose between one
    > of the two, but I am receiving errors when I attempt to call a LabVIEW
    > executable from within a LabVIEW executable using either the "System
    > exec" VI or the "Run Application" VI. If I call a non-LabVIEW
    > executable (such as Windows Explorer) everything works fine.
    As with the other poster, I suspect a path problem. You might try the
    path out in a shell window, and if it works, copy the complete absolute
    path to LV to see if that works. LV is basically passing the comma
    nd to
    the OS and doesn't even know what is in it, so you should be able to get
    it to work.
    The other poster commented on subpanels, which is a good suggestion, but
    without going to LV7, an EXE can have open more than one VI. You can
    use the VI Server and the Run method to fire up another top-level VI.
    The decision is whether you want both to be in unique processes.
    Greg McKaskle

  • Calling DOS executable from TestStand

    I have read the forum under TestStand.  I have version 3.0-- I am unable to get a DOS executable tool to work when I call it.  I can create a seperate seq file and call Notepad fine but when in that seperate and unique seq file I put the call to my tool and try and pipe (>) the results to a screen it doesn't work-I've tried what seems like every option for threading etc .  So I even put my DOS program under a directory and naming structure that conforms to the old 8.3 DOS standard.  I try to pipe(>) information to a text file and it doesn't work.  It also doesn't wait the 30 seconds that I tell it to either despite trying every option etc.  I've done everything I've seen in the help but have had no luck.  Do I need to create a VB or C++ DLL wrapper, if I do then what challenges do I face?  I am close to telling my manager that TestStand is not a tool that we can use.
    Thanks
    JL

    I got it working.  Thanks for you input.  I believe I simply was missing a command on the command line (it takes about 5 parameters).  It was falling through and I wasn't able to catch what was going on.  I thought it was a thread issue within teststand that I needed to set.  I also didn't realize the default location that it executes from any my paths were explicit.  I also wasn't clear on some other details but have now figured them out pretty much.
    Thanks again
    Jim
    ~~~~~~~~~~~
    Are you using the call executable step type? If so please provide more informations about how you have it configured, if not please explain what you are doing. By DOS executeable do you mean an old 8-bit DOS program (what version of windows are you running this on?)? Or do you mean a windows console application? Are you getting any error messages? How are you verifying that your executeable isn't being called? Or is the problem just with the IO redirection?
    -Doug

  • How TO CALL c++ EXECUTABLE FROM XI(VERY iMPORTANT)

    hI ALL
    pLEASE DO GIVE SUGGESTIONS AND DOCCUMENTATION LINKS  THAT <b>HOW TO CALL c++ EXECUTABLE FROM XI</b> .THIS IS VERY IMPORTANT AND YOUR HELP WILL BE REWARDED.
    WITH REGARDS
    SUBRATO KUNDU

    Hi Subrato,
    AFAIK you can call C / C++ methods in Java using Java Native  Interface (JNI).
    Please refer the following links for how to do the same.
    <a href="http://www.nag.com/IndustryArticles/CallingCLibraryRoutinesfromJava.pdf">For C:</a>
    <a href="http://www.javaworld.com/javaworld/javatips/jw-javatip17.html">For C++:</a>
    Regards,
    Ananth

  • How do I run a labview executable from C++

    I have an application written in C++ that runs some VIs in the Labview Development Environment. I'm using Labview 6.02 and VisualC++ and the runtime engine is installed. What I want to do is not use the LDE and just call the LV executable from C++. I found some documentation but what I tried is not working for me. What I am looking for is a good example of C++ code that runs a LV executable.
    The help would be appreciated.

    > I have an application written in C++ that runs some VIs in the Labview
    > Development Environment. I'm using Labview 6.02 and VisualC++ and the
    > runtime engine is installed. What I want to do is not use the LDE and
    > just call the LV executable from C++. I found some documentation but
    > what I tried is not working for me. What I am looking for is a good
    > example of C++ code that runs a LV executable.
    > The help would be appreciated.
    >
    One possibility is to think of the LV executable the same as an
    executable built with any other development tool. Invoke it using the
    command function that launches via the command line or a fork command.
    Another possibility is to make a DLL instead of an EXE.
    Finally, you have the option of using the VI Server through a
    ctiveX.
    This will work better if you have only one of the executables or the LV
    editing environment on a particular PC.
    Greg McKaskle

  • VI seen as not executable from LV runtime, correct in LV development

    My current problem is the following:
    On the same PC, having TestStand 4.0 & LabVIEW Development 8.5, I try running a sequence with both adapters: LV development 8.5 and LV runtime 8.5.
    My sequence steps call VIs that call subVIs in a full hierarchy (let's say 1500 VIs are involved in a test sequence).
    The sequence runs with the development adapter, and with the runtime, I got a -18002 LabVIEW error: Vi not executable, broken, etc.
    Of course, when I open the VI within the development environment, everything is correct.
    As I'm testing both adapters on the same PC, the full hierarchy, including LV libraries provided with LV development are at the same location.
    Due to the large amount of VIs I use, I cannot guess which LLB could be missing or not inaccessible.
    Is there a way to investigate the cause, despite the fact that everything is correct under the development environment?
    Is it possible to tell the LV runtime where it should search for LLBs or other required dependencies that the LV development seams able to find?
    Thanks in advance for your help,
    JJD
    Solved!
    Go to Solution.

    Hello,
    I've seen this error when two VIs withthe same name were loaded in memory; this VI was called from a TestStand sequence and from the user interface (very poor design of a customer that I will not mention ^^).
    I'm not sure to understand youy problem: everything works fine when you are using Developpment system (Active Version 8.5) but, do you have this error when you set the adapter to LabVIEW Run-Time Engine 8.5, right? Are LabVIEW and/or VIs used in your sequence open when you run your sequence in Run-Time mode?
    Cordially,
    .mrLeft{float:left} .mrInfo{border-left:solid 1px #989898;font-size:x-small;color:#989898}
    Mathieu R.  
      CTD - Certified TestStand Developer / Développeur TestStand Certifié  
      CLAD - Certified LabVIEW Associate Developer  

  • Can I use SubPanels to display and run multiple executables from the same GUI?

    I have two Labview executables that performs some A/D I/O, each using an independent USB-6008.  I would like to run both of these executables from a single UI.  Is this possible usin SubPanels?  Or some other method?
    I found KB regarding exe's and VI Server but can't seem to get the suggested workarounds implemented.
    http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C?OpenDocument
    I am using Labview2009
    Thanks
    Dan
    Solved!
    Go to Solution.

    DBerry wrote:
    No, of course I am not sure yet.  I have only begun testing this method. 
    Not sharing common hardware (separate USM-6008s).
    Here is the whole picture:
    I have developed a top-level VI that performs Daqmx IO using a single USB-6008.  The top-level VI references a Project Daqmx Task that points to the desired 6008.  I would like to create a single UI that uses this top-level VI to control twoUSB-6008s simultaneously.  I thought I could build the top-level VI into 2 separate exes, where the only difference between the exes is the hardware it points to (one exe to each of the 6008s).  But I have been unsuccessful at running these two exes within a single UI.  I attempted use subpanels on a tab control to do this but I am unable to obtain a reference to the top-level vis once they have been built into an exe.  I have also tried building a dll and exporting the top-level vi from the dll build but i can't seem to get that to work either.  In both of these cases my Open VI reference function returns errors (Error 1445).  I am aware of the changes in referencing VIs from within an exe/dll since LV8.2 - http://digital.ni.com/public.nsf/allkb/8545726A00272EB0862571DA005B896C
    The link seems to suggest that I should be able to obtain a reference to the top-level vi within the dll but I can't get it to work.
    So I then moved on to the above method (making all the subvis reentrant).  I just haven't figured this all out yet.
    If you have suggestions on other problems I may run into please share.  I think I can eliminate my FGs but haven't gotten back to this yet.
    Thanks
    Dan
    When I am designing apps of the type you described I have kept the ned goal in mind from the begining since of the issue you are mentioning. I also don't want to tell you to throw it all away and start over. So with that in mind I have been looking at your posts and only offering the least destrutive ideas first. With that in mind I would like to invite yo uto look at the code i posted in this thread (reply #18 has a zip).
    That code shows how to realize un-dockable GUI regions but it passes the ref of the top level VI to a reentrant VI it instanciate for each undockable region. It may have enough hints and technique to give you some ideas that will work for you.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • An error occurred when executing a REMOTE FUNCTION CALL.

    Dear all,
    We have two syetms called DXD and GRD , we have a remote enabled function module in the DXD system , when i am trying to call this Function module from
    GRD system it is going for the short dump, and giving the follwing error,
    <b>Error analysis
        An error occurred when executing a REMOTE FUNCTION CALL.
        It was logged under the name "RFC_NO_AUTHORITY"
        on the called page.</b>
    But i do have the access for the DXD system also, i am really struggling to solve this problem, if any lights are there to help me , i will be thank full for then,
    some body suggested for me that we need to maintain the Trusted system tables in the target system.
    Thanks & regards
    Satya.

    first u( user id ) have to get the Authorizations to use RFC ?
    object will be  like S_RFC or some thing like this.
    when u get this kind of error just call /NSU53 then u will come to know which Authorization Object is missing from ur User Profile.
    Regards
    Prabhu

  • Linux net command showing incorrect output if executing from java.

    I am trying to execute a net rpc registry on red hat linux box from java using Runtime. I have stored the command in a String variable. When the execute the command from java it throws an error saying that "Invalid registry path" however the same command works fine when executed from linux command terminal.
    CODE
    import java.io.*;
    public class ChkBpower {
         public static void main(String[] args) {
         checkBpower(128);
         public static void checkBpower (int TTL){
              int ttl = TTL;
              System.out.println("Hello3");
              String ip = "20.198.36.28";
              String[] reg={"\\","HKLM","\\","SOFTWARE","\\","Marimba"};
              System.out.println(reg);
              String credentials ="bpwrlab/Administrator%Confmgmt1";//"asiapac/gjagdeosingh%M@nu2281";
              String chkBcmd = "net rpc registry enumerate '\\HKLM\\SOFTWARE\\Marimba' -I " + ip + " -U " + credentials ;
              String chkBstatus = "net rpc service status cscmarimba -I " + ip + " -U " + credentials + "| grep -b 'service' | awk '{print $4}'";
              String startBpower = "net rpc service start cscmarimba -I " + ip + " -U " + credentials;
              if (ttl>=100 && ttl<=128){
              System.out.println(ttl);     
              System.out.println(chkBcmd);
              try {
                   Runtime r = Runtime.getRuntime();
                   Process p = r.exec(chkBcmd);
                   InputStream stderr = p.getErrorStream();
         InputStreamReader isr = new InputStreamReader(stderr);
         BufferedReader br = new BufferedReader(isr);
         String line = null;
         System.out.println("<ERROR>");
         System.out.println(br.readLine());
         while ( (line = br.readLine()) != null)
         System.out.println(line);
              System.out.println("</ERROR>");
              int exitVal = p.waitFor();
              System.out.println("Process exitValue: " + exitVal);
              catch (Throwable t)
         t.printStackTrace();
    }

    Use exec(String[]), not exec(String), whenever you have argue,nets. Saves all that mucking around and second-guessing and escaping ...

  • Is it possible to execute a transaction by calling a irpt page?

    Hi,
    Is it possible to execute a transaction by calling a irpt page?
    If possible, is there a sample code (.irpt code) for MII 12.1?
    Thanks.

    You can use a SERVLET Tag in your irpt to execute an xacute query.
    Here is the help file from 11.5 but this works in all the versions.
    [http://help.sap.com/saphelp_xmii115/helpdata/en/Advanced_Topics/Report_Generation.htm|http://help.sap.com/saphelp_xmii115/helpdata/en/Advanced_Topics/Report_Generation.htm]

  • How to run an executable from command-line

    I'm learning how to use the Terminal and I got stuck in a silly thing (I suppose it is). How can I run an executable file from command-line in Terminal?
    For example: I have a file named "Hello" in the folder /sample. If I use the ls command (ls sample), I can see the file Hello. Then I move to the directory (cd /sample) and try to run the file Hello (typing "Hello") but I got "command not found" message.
    If I drag the Hello file from Finder to Terminal and hit Return, it runs perfectly. And if I type the full path to the file (even if I'm already inside its directory), it also runs.
    So, my doubt is if there is any command to run an executable from command-line.
    Thanks

    KJK555 wrote:
    Hi VK:
    Can you enlighten me on why it's neccessary to do the "./" thingy in OS X when in unix/linux
    I never had to resort to doing that?
    Kj
    I took the trouble of reading *man bash* and it explains the issue. to add the current directory to PATH you need to add an empty path to PATH like this
    PATH=$PATH::
    you can add it to ~/.bash_profile so that it's executed automatically when you start bash. I suspect the linux system you are talking about had this set up by default or had it added to PATH in /etc/profile which defines PATH globally.

  • Query assigned to role. Doesnt execute when try to execute from under role

    Hi Experts,
    We have some queries assigned to a role in PFCG.
    Now the anomaly is as follows:
    some of the queries that are assigned, do not show any technical names in the Bex role window. When we click on these queries under this role, nothing happens. no execution, nothing.
    The same queries if executed from under the Infoareas->infoprovider->query path, execute correctly.
    This would point to incorrect assignments in PFCG, BUT thats not the case.
    <bsp_protcl>://<bsp_server>/sap/bw/BEx?sap-language=<language>&bsplanguage=EN&cmd=ldoc&INFOCUBE=Z1&QUERY=ZQ1
    <bsp_protcl>://<bsp_server>/sap/bw/BEx?sap-language=<language>&bsplanguage=EN&cmd=ldoc&INFOCUBE=Z2&QUERY=ZQ2
    The details of the query assignments to the role are as above.
    Query ZQ1 shows in Bex role with a technical name and executes properly.
    Query ZQ2 doesn't show a technical name under that role in Bex and doesnt execute.
    Also if I execute ZQ2 from the PFCG, it executes correctly.
    What are we missing here?
    All help appreciated!

    The query name is correct.  The assignment seems to be correct too.
    But for this particular assignment, the bex role doesnt show a technical name for the query. neither does the query execute.
    Why don't the assignment via PFCG work?
    Edited by: CC on May 22, 2008 6:04 PM

Maybe you are looking for