NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you programatically add action steps?

I am trying to programatically add an action step to the main sequence of a sequence file in MFC. I have read the "Create Sequence Files" article, so I understand how to create and add steps. I do not, however, understand how to programattically tell the step to make a call to an arbitrary COM object. I would like the step to attach to a COM object already in memory, and make a method\property call using parameters that I specify. The attached sequence file shows the steps I would like to create programatically in MFC.

Thanks,

Aaron
0 Kudos
Message 1 of 3
(3,162 Views)
Hello Aaron,

As you may have already noticed, all the steps in TestStand have properties that store specific information. For example: the module you are calling, or the ActiveX server you are calling.

When you create a step programmatically, you need to fill all of this properties in order for the sequence to work.

For activeX servers, there is a property named TS.SDATA.CALL that stores all the information regarding the server you want to call. To call servers already in memory, you need to have a ActiveX reference to this server stored in a TestStand variable (ex. a Local Variable) And set this variable to TS.SDATA.CALL.ObjectVariable. You may also change the TS.SDATA.CALL.CreateObject property to not create another instance of the server.

I
guess the easiest way of figuring out what to put in each property is to manually create a step and configure it to use your server (right click on the step and select specify module). Then you browse the tree view and check the contents of all the TS.SDATA.CALL properties.

Once you know what to put in each property. You can incorporate it in your MFC code.

Roberto Piacentini
National Instruments
Applications Engineer
www.ni.com/support
0 Kudos
Message 2 of 3
(3,162 Views)
The ActiveX Automation Adpater also allows you to specify whether to "Create from File" or "Attach to Active", instead of "Create New". These options are used when you want to obtain either an ActiveX reference to an existing object from a file or to an active application, respectively. These options are described in the TS User Manual.

Of course if you want to create an ActiveX object reference from a file you will have needed to first store the reference in the file.
0 Kudos
Message 3 of 3
(3,162 Views)