NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Show popup dialog at step type dropping to the sequence

Solved!
Go to solution

I have a LabVIEW step type with some module parameters and step's variables what needs to be setup to configure this step. Can I make it to display the popup dialog to enter the required values at the moment when I drop the step type to a new sequence?

 

Examples: 1. I have TestID in steps variables what needs to be setup. Popup dialog is more convenient than going to Variables and searching for the TestID in tree. 

2. I have one step type which does a different actions depending of the enum parameter in the LabVIEW module. This parameter is set to default in steptype. I'd like the step name in my sequence to be the value of the enum. Something like RunState.Step.TS.SData.ViCall.Parms["Configuration Update"].ArgVal in the step type Default Step Name Expression helps and displays the enum text as step name when I drop the step type in the sequence. But changing the Configuration Update parameter in this step to another value does not followed by changing the step's name, looks like the step type's Default Step Name Expression is evaluated only once when step is created from the step type.

0 Kudos
Message 1 of 5
(4,038 Views)
Solution
Accepted by Sergey_Kolbunov

Yes, you can add code to your step type that gets called whenever an instance of it is inserted into a sequence. Create a custom substep on the step type and name it OnNewStep. TestStand will then call this substep whenever a new instance of the step type is inserted into a sequence.

 

The default name expression is only evaluated when the step is first inserted, that is correct. I do not know of a way that you could make the name of the step automatically update based on the parameter value of the module specified for it. You could write some sort of tool that updates the names of all such steps within a sequence and run that periodically, but I don't think there is any way to have your code called directly from the action of a user specifying a code module. You could create your own UI to specify things on the steps using an edit substep and that edit substep could update the name, but I'm not sure that's a practical solution for your particular use case.

 

Hope this helps,

-Doug

Message 2 of 5
(4,036 Views)

Thank you Doug, your advise works just perfect for the first case. OnNewStep, who may think about it? Is it documented somewhere?

For the second case it is not so straightforward. I don't care so much about automatic update of the step name when it is already in a sequence, setting this name and the appropriate module's parameter at insert will be enough. Tool to update names is not a problem, I'm using such kind of tool to automatically update sequences when my step types got changed. I need the subject feature because I'm trying to create a custom sequence editor for end users with minimal knowledge of TestStand.

 

Talking about second case, it's look like setting of module's parameter via expression does not work. Now I'm trying to set it using TestStand API in the OnNewStep substep.

 

Now I have another problem. How to access the TestStand Adapter API automation server in LabVIEW? I'm trying to get Sequence Context ->Step ->Module ->Parameters but to get Parameters property of LabVIEWModule class the TestStand Adapter API server required while I see properties list for the Module class of the TestStand API server. It seems to be very easy to switch server in TestStand but how to do it in LabVIEW?

 

 

0 Kudos
Message 3 of 5
(4,029 Views)

OnNewStep is documented in the reference manual pdf (search for OnNewStep or go to the step type properties dialog substeps help section). I agree it could be made into a more obvious feature though.

 

You need to do what is effectively a QueryInterface from the Module interface to the LabVIEWModule interface. You can use the Variant To Data LabVIEW ActiveX node. wire up the Module interface to it and wire up the interface you want to Query for (in this case LabVIEWModule) and it will work as long as the object supports that interface. NOTE: You need to close the new reference to the new interface that you get from Variant To Data once you are done with it.

 

Hope this helps,

-Doug

Message Edited by dug9000 on 06-29-2009 01:13 PM
Message 4 of 5
(3,997 Views)

I've created the OnNewStep substep for my second case.

 

Thank you Doug, you helped me a lot.

 

OnNewStep.PNG

Message Edited by skof on 06-29-2009 10:32 PM
0 Kudos
Message 5 of 5
(3,988 Views)