LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use env variables in the 'include paths' project settings?

In VS I can do
 
 
$(MySwPath)\Include
 
where 'MySwPath' is an env var....
 
How can I do something similiar in LW>?
 
Thanks
0 Kudos
Message 1 of 5
(3,491 Views)
Hi mikieB,

This KnowlegeBase article talks about what you need:
"Working with Environment Variables in LabWindows/CVI"
http://digital.ni.com/public.nsf/allkb/6BE05EADFCC66623862565F60061C96A?OpenDocument

Basically, you'll need to use the function getenv.

for example, you'd do: getenv(MySwPath).

Let me know if you have any questions.


Kristen
National Instruments
0 Kudos
Message 2 of 5
(3,462 Views)
'Hi mikieB,

This KnowlegeBase article talks about what you need:
"Working with Environment Variables in LabWindows/CVI"
http://digital.ni.com/public.nsf/allkb/6BE05EADFCC66623862565F60061C96A?OpenDocument

Basically, you'll need to use the function getenv.

for example, you'd do: getenv(MySwPath).

Let me know if you have any questions.



 

Kristen
National Instruments
Applications Engineer
'
 
 
Nope, that is not it....try it..it does not work...
 
I want to access the enviornment vars from the
 
options->enviornment->includePaths
 
Window...
 
 
anyone else
 
 
 
0 Kudos
Message 3 of 5
(3,459 Views)
Hello mikieB,

I checked with R&D and unfortunately LabWindows/CVI does not support using environment variables when specifying include paths.  If you'd like you can can create a product suggestions and R&D will consider including this in a future version of CVI.  Here is a link to the Product Suggestion Center.

Please let me know if you have any questions.


Kristen
National Instruments
0 Kudos
Message 4 of 5
(3,434 Views)
A partial workaround is to use the subst command to map a drive letter to the root of a directory tree you want to access, e.g.:
 
subst X: "C:\Program Files\National Instruments\CVI85"
 
(This would have to be done each time the computer is rebooted I think).
 
You would then be able to use this drive letter in your include paths. Later, if the path changes (e.g. if you are moving to a new CVI release) you can just change the subst command you use. You can use subst multiple times to map different drive letters to different folders.
 
A similar thing can be done by mapping a network drive to the folder, but that is a bit over the top for local folders.
--
Martin
Certified CVI Developer
0 Kudos
Message 5 of 5
(3,418 Views)