NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically Launching the Specify Module Dialog

I am calling some ActiveX modules written in VB6 from TestStand 3.1. I am developing a user interface (UI) in VB6 that reads the specific instruments I have installed on my station (from StationGlobals) and allows the application developer select which instrument to configure. I have worked out how to read the type library for these modules and to programatically set the TestStand hidden properties for Server, coClass and Interface ID's. What I'd really like to do now is to call the ActiveX specify module dialog from within the VB6 UI so that the application developer can select the applicable methods/properties and parameters.

Does anyone know if this is possible (e.g. in a method similar to the way the expression browser can be programatically launched using the TS Engine.DisplayBrowseExprDialogEx method)?

Thanks,

David
0 Kudos
Message 1 of 3
(2,832 Views)
If you have a reference to a step, you can call Step.SpecifyModule for that step.

Depending on what you are trying to do, you can obtain a step reference from either:

1) An existing sequence
2) Creating a new step from the engine

Allen P.
NI
0 Kudos
Message 2 of 3
(2,827 Views)
Thanks Allen.

Yes - that did just the trick. I found that I was able to obtain a reference to my current step using the sequence class's GetStepByUniqueId method, and passing the step's TS.ID property. I was then able to call the specify module method, which displayed the specify module dialog for this step. For anyone interested, code similar to that below worked for me in VB6.

Dim objSeqContextPO As PropertyObject 'reference to TS SeqContext property object
Dim objSeqContextSequence As Sequence 'reference to TS SeqContext Sequence
Dim objTSStep As TS.Step 'reference to TS step

Set objSeqContextPO = SeqContext.AsPropertyObject()
Set objSeqContextSequence = SeqContext.Sequence

'Obtain a step reference and call the Specify module box
Set objTSStep = objSeqContextSequence.GetStepByUniqueId(objSeqContextPO.Step.TS.Id)
If Not objTSStep.SpecifyModule(0) Then
'log an error
End If

Thanks again for your help.

David
0 Kudos
Message 3 of 3
(2,820 Views)