NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I generate documentation for a sequence file hierarchy?

I am trying to generate documentation for all of the sequence files used in my test suite. Some of the tests are kinda complex with nesting to eight to ten levels with hundreds of sequence files. The sequence file documentation tool will only let you document the active sequence file and there doesn't appear to be any way to recursively search for the sequence files in LV or TS. Does anyone have a way to do this?
0 Kudos
Message 1 of 13
(4,981 Views)
Hi lars,

In the Tools menu is a Documentation tool. It will generate a txt or html document of your sequences contained in a sequence file. You are able to select what to include in your document.

Also, the tool is actual a sequencefile and therefore you maybe able to customise.

regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 13
(4,971 Views)
That tool works fine for a single sequence file, I need to generate docs for all the files in a hierarchy. Ideally, I want something I can pass the name or path of the highest level sequence and it will automatically find all the sequences under that file and call the doc tools. I can make it work for two layers by using a LV program and parsing the sequence files directly, but that is prone to all sorts of problems and falls apart when you don't know how many layers or how many filenames will be encountered.

Is there a tool available that will generate a list of sequence file calls from a high level sequence? Not jsut the calls in that sequence, but all the calls for the entire hierarchy below that sequence as well (in other words, a recursive tree-style search that steps through the sequence files automatically.)

Lars
0 Kudos
Message 3 of 13
(4,966 Views)
Hello,

Currently the documentation tool will document all sequences in a particular sequence file. However, as Ray mentioned, the documentation tools is a sequence file that can be customized. The sequence files that do the documentation can be found in the TestStand/Components/NI/Tools/DocGen directory. Also, if you did make your own tool, you can add it to the tools menu by going to Tools >> Customize in TestStand. I hope that this information is helpful to you.

Regards,
Kevin L.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 13
(4,944 Views)
I have been through those files several times. Before I can document a hierarchy, I need to be able to find out what the hierarchy is. I fugured out a way to use the queue tool in LabVIEW to perform a breadth first tree traversal from a top level sequence file down into the lower level sequence files. So, I can now get a sorted, filtered list of the files in a test sequence. The next step I need is how to programatically feed these sequence files into the doc tool. Any suggestions?
0 Kudos
Message 5 of 13
(4,944 Views)
Hi lars,

For each sequencefile you will need to create a reference to it by use of the Engine.GetSequenceFile() method.
Next create a new context by using the SequenceFile.CreateNewContext(), use the SequenceFileObj reference returned by the GetSequenceFile() method.

Once you have the SeqenceContext reference, use this as the parameter to the second step which calls a dll in docgen.seq, (sorry can not remember what is called at the moment). The at the moment this parameter is ThisContext reference. Probably best to make a copy of this sequencefile (docgen.seq) and make the modification to the copy.

On the second step, open up the specify module dialog and change the ThisContext to your new variable holding your new SequenceContext. Close the sepecify dialog.

Some where in your cleanups you will need to set the New Sequence Context to Nothing and call the ReleaseSequenceFile() method passing it the sequencefile reference. Releasing the reference to the sequence file maybe a bit tricky because if the engine is still using the reference, then it will not be released.

I have tried this and it did generate a document of a sequencefile not previously loaded. My only problem was releasing the sequencefile.

I am not suggesting that this is a usable solution, because you wouldn't want the dialog window opening up for each sequence file. This maybe a starting point for you.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 6 of 13
(4,913 Views)
Thanks Ray, that's a method I haven't tried yet.

On a related note, what does creating a new context do for me? I've got most of the other parts of the API sorted out, but I haven't investigated that one yet.

Larry
0 Kudos
Message 7 of 13
(4,904 Views)
I just dug through the API docs and in the program and cannot find a CreateContext method. I'm using TS3.1, it may not be supported. Do you know of any equivalent functions?
0 Kudos
Message 8 of 13
(4,900 Views)
Hello,

I made an example for you in TestStand 3.1 and LabVIEW 7.1 which I think will help you out. The attached sequence file contains the method to call the documentation tool several times given an array of sequence files. The first step of this sequence is a LabVIEW VI where the user can enter in an array of sequence files. I am thinking that you could then replace this VI with the one you have already created which transgresses the hierarchy of your top-level sequence file. The array of sequence file paths is then passed into TestStand where the sequence uses the TestStand API to programmatically call the documentation tool by passing in the reference for each sequence file in the array. I think that this example is going to give you a good starting point, and you should be able to modify it to suit your exact needs.

Regards,
Kevin Leonard
Applications Engineer
National Instruments
0 Kudos
Message 9 of 13
(4,892 Views)
Hi lars,

Sorry, it was SequenceFile.NewEditContext.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 10 of 13
(4,889 Views)