From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get <Common Data> directory at runtime

Solved!
Go to solution

Hi, is there an API function to get the <Common Data> directory path?

I know it's usually "C:\Users\Public\Documents\National Instruments\NI VeriStand 2015" but instead of hardcoding that path I want to retrieve it at runtime (so I don't have to touch the code again when we switch to a different VS version).

 

Thanks.

0 Kudos
Message 1 of 7
(3,855 Views)

Hi Krid,

 

unfortunately, there is no function that does this, but I wrote a little vi, that you can use for thet. see attachement.

 

I check the directory for the latest installed Version of VeriStand and provide the path.

0 Kudos
Message 2 of 7
(3,779 Views)

Update:

 

now with Service Pack Support 🙂

0 Kudos
Message 3 of 7
(3,761 Views)

Hi Gregor,

 

thank you very much for your help. It works very well. My only concern is that this simply returns the "newest" VeriStand Folder and not the folder of the VeriStand version that is currently running. This could be a problem when multiple VS versions are installed/used on a computer. Anyway, currently this is not really an issue for me.

 

Thanks again,

Dirk

0 Kudos
Message 4 of 7
(3,754 Views)

Hi Dirk,

 

I missunderstood the question, then. The function you are looking for, doesn't exist,unfortunately.

0 Kudos
Message 5 of 7
(3,751 Views)
Solution
Accepted by topic author Krid

There's a method in one of the shipping APIs that returns the directory.  It's not a public API, but I don't think it's likely to change, so it should be safe to use.  The directory returned will depend on the version of the API used, so if you call the 2106 version of the API you will get the "NI VeriStand 2016" folder, while using the 2015.1 version of the API will give you the "NI VeriStand 2015" folder.

 

Read the "CommonDocuments" static property from the DirectoryUtilities class in NationalInstruments.VeriStand.Internal. See attached image

 

 

Message 6 of 7
(3,681 Views)

Perfect, thanks!

0 Kudos
Message 7 of 7
(3,642 Views)