NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify the step's module automatically?

I'm working on creation of sequence automatically from a files tree. In general each subfolder of the tree's root should be created as a subsequence of the MainSequence, the MainSequence should call them with Sequence Call and so on up in tree.
I have the problem with configuring the step's module for the sequence call step. The Step.SpecifyModule or Module.Specify methods just "opens the Specify Module dialog box for the step". I don't see other methods to setup the step Module for Sequence Call step (in my case set Use Current File to True and select a created subsequence). Dialog doesn't work for me because the tree is huge.
Please see the attached sequence.
0 Kudos
Message 1 of 10
(4,387 Views)

Hi,

Have you look at the example in the TestStand\Examples folder SequenceBuilder

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 10
(4,377 Views)
Hi Ray,
 
The Sequence Builder is a very interesting example, but it does not answer to my specific question: is there any Method (or workaround) to setup step's module automatically (without using of the Specify Module dialog popup window)


Message Edited by skof on 05-22-2008 02:13 PM
0 Kudos
Message 3 of 10
(4,366 Views)

Hi,

If you are using TS4.x then yes, there are some Adapter Classes you can use in the API.

Regards

Ray Farmer

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

Here is the answer to my question http://zone.ni.com/devzone/cda/epd/p/id/830 , the ActiveX Automation Adapter example is 1628.zip file.

The clue is to set TS.SData values for the Sequence Call step, first call the method Step.AsPropertyObject and then use method PropertyObject.SetValString (or SetValBoolean etc) to set TS.Sdata.<variable>.

0 Kudos
Message 5 of 10
(4,275 Views)
skof,
 
While you can use the TS.SData properties to set this information, I would recommend against doing so.  The SData property is the internal representation of the step's data, and might change in future versions of TestStand.
 
The safe way to change this information will be to use the TestStand API.  If you have the step object of the sequence call, you can use the following pseudocode:
 
Step.Module.AsSequenceCallModule.SequenceName
 
to get or set the sequence name that the step will call.  Please see this help page for more information about the SequenceCallModule object.  Using methods and properties of this class will allow you to configure all of the step's information.
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 6 of 10
(4,273 Views)
Sorry Josh, I can not find the SequenceCallModule object. Could you give me an example how to do what you described with TS ActiveX adapter?
0 Kudos
Message 7 of 10
(4,267 Views)

The Help says: "Use the Step.Module property to obtain a reference to a SequenceCallModule object. To access the properties and methods of a specific module class, query the Module object for the interface of the module-specific interface you want to acquire."

How to "query the Module object for the interface"?



Message Edited by skof on 06-04-2008 02:33 PM
0 Kudos
Message 8 of 10
(4,265 Views)

skof,

There is a separate ActiveX server for the Module Adapters.  Instead of selecting NI TestStand API x.x (Ver 1.0) as your Automation Server, you will need to select NI TestStand Adapter API x.x (Ver 1.0) as the Automation Server to use.  That server then contains the SequenceCallModule class.



Message Edited by Josh W. on 06-05-2008 12:48 PM
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 9 of 10
(4,240 Views)
Thank you Josh, I just found that by myself a couple hours ago.
0 Kudos
Message 10 of 10
(4,237 Views)