06-29-2006 12:05 PM
06-30-2006 10:30 AM
06-30-2006 10:57 AM
07-06-2006 09:53 AM
02-18-2008 01:05 PM
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
09-14-2009 11:02 PM - edited 09-14-2009 11:04 PM
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