NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programmatically display the specify module dialog?

I am writing a C++ class that programmatically adds steps to a sequence file. The steps are ActiveX Automation types, making calls to properties and methods on a COM server.

I have been successful in creating a step, filling in the TS.SDATA.CALL parameters and adding it to the main sequence. When I open the sequence in the TS sequence editor and bring up the specify module dialog, all of the dialog fields fill out properly.

However, I've recently been wanting to bring up the specify module dialog programmatically. I have a smart pointer to the step object ( TS::StepPtr ) and tried calling spStep->SpecifyModule(0). This hangs the app, which leaves me scratching my head wondering what TS is objecting to. Rememb
er I can then go to the TS sequence editor and successful bring up the specify module dialog on the very same step.

I pretty sure the window handle I've passed to the engine is valid. I can successfully display the engine options dialog programmatically.

Any idea? Do I have to call some setup function before calling Step::SpecifyModule( long specModOptions )?

Thank you much.

Aaron
0 Kudos
Message 1 of 2
(3,007 Views)
Hello Aaron -

The short answer to your question is 'no you should not need any special configuration commands before calling Step::SpecifyModule( ). Once you have a valid step object you should be able to call the method. However it is worth mentioning that the function help for SpecifyModule points out that there are different restrictions on each type of step as far as what options are available. For TestStand 2.0.1 for example, the ActiveX Automation Adapter steptype will make no use of the options set, so setting it to 0 is ideal. Other issues with using this method may be the result of working with an active sequence. Are you adding steps to a new file on your harddrive? Or are you working with a sequence already loaded into TestStand? Asking to 'specify module'
of a step already loaded for execution can result in some different behavior, most commonly a 'user-defined' error code of '0'. Checking to see that you are doing this, or if you have any file references (via Get SequenceFile ) that are not closed (with Release SequenceFile) before discarding the object handle they may also be a source of your hang-behavior.

To have a better idea of what is happening on your system I would need more information about your version of TestStand and also about how you are creating your sequence but any other information about the error would be helpful in troubleshooting further.

Regards,
Elaine R.
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(3,007 Views)