10-19-2016 09:15 AM - edited 10-19-2016 09:18 AM
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.
Solved! Go to Solution.
10-27-2016 07:10 AM
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.
10-28-2016 01:45 AM
Update:
now with Service Pack Support 🙂
10-28-2016 04:07 AM
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
10-28-2016 04:28 AM
Hi Dirk,
I missunderstood the question, then. The function you are looking for, doesn't exist,unfortunately.
11-07-2016 11:35 AM
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
11-09-2016 09:58 AM
Perfect, thanks!