12-05-2009 10:59 AM
On Windows I can use App.kind to find out if the VI is running in the development environment or in the runtime system.
On a RT target I get always Embedded LabVIEW.
The default directory on a RT Target is C:\ni-rt\system when runinng in the development environment and C:\ni-rt\startup when running in an application. How can I get the information in which context the VI is running?
Hardcoding the folder is the last option to choose.
12-07-2009 07:37 AM
I dont have a rt target on my PC right now but tou might be able to do this by stripping the path of the top level vi. The application should run from the startup path. There is also an app.application.directory shat should give you the path of the application but I have not used this with RT. Usisally when I run on a RT target I strip the top level path to get a path I can use for file IO.
12-07-2009 09:59 AM
Hi Waldemar,
whether you run the VI as an rtexe or from the dev. system, the VI will run on the RT system, meaning that the App.Kind property will always be Embedded.
You could simply read in the current path and check whether you're in startup or system, which would tell you what type of application it is.
Regards,
12-08-2009 03:27 AM
We made a further investigation into this case.
From File I/O >> File Constants >> Default Directory will give us the following paths:
New installed system or no startup application defined in C:\ni-rt.ini -> C:\ni-rt\system
Startup application defined in C:\ni-rt.ini -> The folder where the startup application is located, normally C:\ni-rt\startup
The folder will not change regardless whether you will use the primitive Default Directory from the startup application or afterwards from the development system.
12-09-2009 06:40 AM
Hi Waldemar,
I may not have understood your last post correctly. I understand from the first part that the default directory path works as you want it to, but then you seem to say in the last sentence that it doesn't change, and so is not what you want after all.
Could you please reformulate the post? Have you found the answer to the original question?
Thanks!
Regards,
12-10-2009 02:34 PM
Hi Joseph,
no I haven't found an answer to the original question how to find out on RT Target if a VI is running in the development environment or as standalone application.
Meanwhile I think I do not need to know this at least not for the case I need. Maybe when telling the history it will get clearer.
We have a PXI-System with a new installed LV RT 2009. The application needs to read in some configuration data at startup. We choose to use the Default Directory to store the files. We were starting development and at the first test we saw that the Default Directory is "C:\ni-rt\system" a place which we will never use.
Next we created a standalone application deployed it, set it as startup and rebooted the system. This time the Default Directory is "C:\ni-rt\startup". This was the point I started the thread.
Meanwhile we did some more development and when deploying the VIs from LV and starting it we also get "C:\ni-rt\startup" although the VIs are now running in the development environment.
Next I created a standalone application and deployed it to C:\ni-rt\MyTest, set it as startup and rebooted the system. Now I get "C:\ni-rt\MyTest" until I set a new startup application or unset the startup application.
LV RT starts an application at boot time and the folder where this application is located will get the Default Directory until you boot the controller again. That's why I think we do not really need to know if the VI is running from the development environment or as standalone application.
12-11-2009 08:13 AM
Hi,
thanks for the clarification. I'm glad you found a solution, even if it is not the original one you were looking for.
12-11-2009 09:57 AM