NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Enumerator data types

I have a sequence file where I would like to create a parameter that is an enumerator. The goal is to have a drop down list appear as an input parameter to the sequence when I go to create a call to this sequence. I'm trying to avoid inputing a string but that would be my next best solution.

Does anyone have any thoughts on this?
0 Kudos
Message 1 of 6
(4,570 Views)
TestStand itself does not allow for the creation of enumeration data types.  The best solution is to use an array of strings that can then be used to populate the drop down list.

Regards,

Tyler T.
0 Kudos
Message 2 of 6
(4,555 Views)
Thanks for the reply. I had a feeling Enumerators weren't available.

Now in your reply you mentioned using an array of strings to fill the dropdown list. The actual datatype of the dropdown list isn't much of a concern for me but rather getting a drop down list to appear. I am beginning to think it's not possible to do what I'm thinking. Let me describe it a little different to see if you know of a way.

I've created a sequence file that contains a MainSequence and a SubSequence. The main has a call to the SubSequence. The SubSequence has three possible settings. The setting will be determined by the value passed in from the call in the MainSequence.

When I go to create the call from the Main I get a list of possible parameters that I need to set for the SubSequence. I would like on of those to be a dropdown list that allows the user to choose one of the possible three options. Right now I am passing in a string and using string tests to determine what the user passed in. That seems a little inefficient to me.

I know if I call a DLL that has an enumerator as a parameter I get a dropdown list and that is the type of functionality I am looking for when calling a subsequence from TestStand.

If you know of a way to do this then let me know.

Thanks,
Russ
0 Kudos
Message 3 of 6
(4,552 Views)
Russ,

The dialog for specifying a Sequence Call does not support drop downs for the parameters.   I assume this is because each parameter is is an expression, and this would allow you to place any expression in the Sequence Call.  The dialog itself is not editable, either.  The Sequence Call itself is just another adapter, but the Specify Module dialog is built into the adapter.

I have filed a Product Suggestion to our development team to include support for enumerated data types.  This may also include changing the Specify Module dialog for Sequence Calls to support drop downs for enumerations.  I know this doesn't help you much for your current project.  But the development team does pay close attention to Product Suggestions for future product goals.

Regards,

Tyler T.
0 Kudos
Message 4 of 6
(4,521 Views)

Here's an implementation that I use to emulate Enumeration Data Types in TestStand:

1) Start with a Custom Data Type and choose the name you want to use for your enum type, e.g MyEnum.

2) Select Container

3) For each enumeration value, create a numeric field e.g. ME_ENUM_01 (I used ME_ as the prefix to denote the first letter of each word in the enum type name i.e. MyEnum) and give it the desired value. Use all uppercase for the name (just like C Macros). Just to remind myself not to modify this value, I enter the comment "This is a constant, do not modify!". Repeat this for all of your enumeration values.

4) Enter one more field to represent the enumeration variable. This field should have a mixture of upper and lower case letters in the name (just like C variable) e.g MyEnumVariable.

5) Since this is a type it will have global scope.

6) To instantiate an enumeration type just create a variable (Local, FileGlobal or StationGlobal) of this type eg Locals.MyVar.MyEnum.

7) To assign a value a value to the instantiated variable, Select the variable's disclosure icon and Voila! The variable and all of its possible states are right there in front of you.

😎 Whenever I want to pass the instantiated variable in a sequence, just select it without opening it up.

9) Comparison is just as simple. Consider this: if (Locals.MyVar.MyEnum.ME_ENUM_01 == Locals.MyVar.MyEnum.MyEnumVariable)

10) Disadvantages: There is NO free lunch. With the convenience there is a memory penalty. Each enum value field takes up storage. But these are containers and so only the container reference gets moved around.

Hurst

Message 5 of 6
(4,241 Views)

Tyler T. wrote:
Russ,

The dialog for specifying a Sequence Call does not support drop downs for the parameters.   I assume this is because each parameter is is an expression, and this would allow you to place any expression in the Sequence Call.  The dialog itself is not editable, either.  The Sequence Call itself is just another adapter, but the Specify Module dialog is built into the adapter.

I have filed a Product Suggestion to our development team to include support for enumerated data types.  This may also include changing the Specify Module dialog for Sequence Calls to support drop downs for enumerations.  I know this doesn't help you much for your current project.  But the development team does pay close attention to Product Suggestions for future product goals.

Regards,

Tyler T.

 

Hi Tyler,

 

Do you have any update on this production suggestion to include suport for enumerated data types.

 

I'm a big fan of LV enum data type, and would like to have similar thing in TestStand as well.

 

Thanks and regards,

Osman

Message Edited by SpeeRose on 09-14-2009 11:04 PM
0 Kudos
Message 6 of 6
(3,939 Views)