NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

custom step type description

For a custom step type that has a LabView VI as the default module, how can I set the step's description to display the input parameters of the VI.  For example, if I made a custom step type with the default module being a VI called WriteLog.vi with an input parameter named "logtext", I'd like the step description to say something like
WriteLog(<logtext>)
where <logtext> is the value of that parameter for that particular step instance.

Is it possible to do this?

Thanks,
Melissa
0 Kudos
Message 1 of 8
(2,660 Views)

Hi Melissa,

When you create a custom step type, you can right-click and select Properties. Within this window, you can modify what the description will show.  For the VI that you are creating, where is the data coming from for that input parameter?  Is it coming from a TestStand variable or another VI?

0 Kudos
Message 2 of 8
(2,640 Views)
We have several custom step types with VI's as default modules.  Depending on the usage, the data could come from a TestStand variable or be "hard-coded"... it depends on the engineer writing the test sequence.

I guess I was unclear in my first message... I know where to modify the description for a custom step type, but is there a lookup string(s) I can use in the description that allows access to the actual parameter values?  This way the engineer using the custom step doesn't have to bring up the "specify module" dialog each time he wants to know what values are actually being passed in to the code module.

Thanks again,
Melissa
0 Kudos
Message 3 of 8
(2,635 Views)

Hi Melissa,

Try putting this expression in the description field.  You will need to amend it to reflect your parameter name.  My parameter was named ‘Log Text’.  This expression checks to verify that the parameter has a value.  If it does, the description is set to the VI Name + Parameter Name.  Otherwise, it sets the description to be the Module Description.  Let me know how this works.

PropertyExists("Step.TS.SData.ViCall.Parms[\"Log Text\"].ArgVal")? Step.TS.SData.ViCall.VIPath + "(" + Step.TS.SData.ViCall.Parms["Log Text"].ArgVal  + ")": "%ModuleDescription"

Message 4 of 8
(2,616 Views)
Thanks Terry, that's exactly what I was looking for.

The only remaining issue is that if "default" values are used (ie. the default box is checked for one of the parameters in the "specify module" dialog), that parameter shows up as a blank in the description field.  Is there a way around this?

Thanks again,
Melissa
0 Kudos
Message 5 of 8
(2,610 Views)

Hi Melissa,

You can add this expression to the other one to test for a default value.  You will not be able to show what the default value is, since that is coming LV, but you can at least show “default value”.  Try adding this to the other expression:

(Step.TS.SData.ViCall.Parms["Log Text"].UseDefaultValues)? "Default Value": Step.TS.SData.ViCall.Parms["Log Text"].ArgVal

0 Kudos
Message 6 of 8
(2,593 Views)

Hello,

 

I know that this Topic is very very old 🙂 But I think my question is similar to the starting question.

 

What is the best way to display all elements in an (no fixed size) array in my description?

(My first idea was something with "Step.TS.SData.ViCall.Parms["Data"].Elements.Item()". Within a For-Loop this is how I do it in a LabVIEW VI. But I don't know how to automatically get access to all elements in a TestStand expression)

 

Thanks,

Elmar

--
Certified LabVIEW Architect
www.merecs.de
0 Kudos
Message 7 of 8
(1,799 Views)

You could theoretically create a recursive expression similar to what is described in this example: https://decibel.ni.com/content/docs/DOC-5826

 

However, recursive expressions like this are difficult to create and might not be easily understandable if another developer looks at the expression later. Another option would be to hard-code an expression that is capable of displaying a maximum number of possible elements in the description.

Daniel E.
TestStand Staff Product Support Engineer
National Instruments
CTA/CLD
0 Kudos
Message 8 of 8
(1,795 Views)