NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Teststand API to get files dependencies of a workspace

Solved!
Go to solution

Hi all,

 

I'm having a really hard time with the Teststand API to make it do what i want. I need to automate the deployment of workspace(s) in our Labview system, I need to get the path of all the dependencies used in a workspace to make a Label in Perforce (SCC) for version control before deployment.

 

As for now i've managed to: Open the workspace > Get the RootWorkspaceObject > NumContainedObjects then GetContainedObject (in this case the project files) > again NumContainedObject then GetContainedObject (in this case the folders inside the project) > NumContainedObject then GetContainedObject (in this case the files inside the folders).

 

The problem is the following: I can get the project DisplayName and Path from the project file reference by property node. However, from the folder object I receive the name and no paths, and with the Items objects I only receive the name and what looks like a relative path. I want that absolute path, on the second line, for each items in the picture below...that is, the properties menu of one of the items.

WhatImlookingFor.png

Once I get those file paths, I would like to do the same with a sequence to get the associated VIs. If I can get those I think that I can manage to get their sub-dependencies in Labview and will be able to build a Label in perforce for all dependencies.

 

P.S we use LV8.6

 

Thx

Message 1 of 5
(4,936 Views)

Hi, 

 

TestStand Deployment Utility is a tool you can use to create a deployable image of a TestStand system and an optional installer that contains the deployable image of your test system.

 

Have you tried using the TS Deployment Utility to create an image of your system? 

 

Regards

Anand Jain

National Instruments

 

 

 

0 Kudos
Message 2 of 5
(4,922 Views)

Hi,

I don't know how the deployment utility would help me getting a version labelling for all dependencies in Perforce, maybe you could be more specific. I try to use at minimum the deployment utility since it doesn't support automation.

 

I need to get the paths of thoses dependencies not just their names. The created image with TS deployment utility only show name of files not their original path (paths of original files). I want to specify that the label is for the originals files not the image ones.

 

The overview is the following:

 

we have lots of reeuse VI's that we use in our TS projects, Once the engineer is ready he does a deployment, at the deployment time we take a snapshot of the depencies in our reeuse and put a Label in Perforce on the listed VI's and then the release begins towards all the stations with the created image from the deployment utility.

 

thx

 

0 Kudos
Message 3 of 5
(4,908 Views)

Mart,

 

The TestStand WorkspaceObject has a method GetAbsolutePath that lets you get the absolute path of the object. You can call that method to get the information you need. I am attaching a modification of your VI which calls this method and gets the correct absolute path names. The VI I am attaching is only a proof of concept for the method, it should not be used in production code as it currently is leaking property objects and it is using the app manager instead of the engine directly (I am assuming the VI was part of a bigger UI you were using in which case that makes sense). 

 

As far as automation of the Deployment Utility we do support a limited way to automate builds since TestStand 2010. We are working on adding features to it, but for now you can at least create a build automatically if you want to. You have to use the following command line command:

 

"<TestStand>\Components\Tools\Deployment Utility\DeploymentUtility.exe" build "C:\path\to\my.tsd"

 

As an aside, you could use the information in the advanced status log which includes VI path transformation for all LabVIEW files which were deployed in case you require this information. This information is included in TestStand 2010 or later, when using LabVIEW 2010 or later. Unfortunately as of today this would require you to manually save the advanced file log, however, we are working on improving the information you can access from the Deployment Utility in future versions. 

 

As far as the last part of your problem, after getting the VI absolute path you can open a VI reference and use the method Get VI Dependencies in the VI reference or, in older versions of LabVIEW you can use the property node Callees. 

 

I hope this helps,

Francisco

Message 4 of 5
(4,897 Views)
Solution
Accepted by topic author mart22

Ok all, first thx Francisco, I tried this invoke node (GetAbsolutePath) but it look like for a reason i didn't put it at the right place the first time...

 

So now:

1- we can get paths of any files included in the workspace folders.

2- we can get files top dependencies from a sequence file, (with slight modification, to subsequences too).

3- we can get top files subs (Vi in this case) dependencies.

 

This is only a proof of concept since all references aren't closed properly. I updated "TSDependencyGet.vi" to reflect the solution of the 3 assumptions above. This exemple only look for VI's Modules no other code.

 

It assume that your workspace is alway at the root level of the "projects files", and that the first search path is "current workspace - sub folders selected" and second search path is "*reeuse root directory* with sub selected".

 

In my case the workspace has 1 project with 7 folders, the sequence is in the 5th folder. Specific VI's are in sub directory of the root workspace folder and reuse Vi's in another path (second search directory).

 

 

I hope this exemple can help others.

 

Martin

 

Cheers

0 Kudos
Message 5 of 5
(4,875 Views)