06-23-2006 04:43 AM
06-23-2006 06:59 AM
Thomas,
I have seen nothing to indicate that they will have more than one value for an input to a case structure. It is up to the developer to put in the pre-logic before getting to the case structure. With multiple enums there can be many choices so I guess the best way to handel it is to use nested case structures.
Matt
06-23-2006 07:13 AM - edited 06-23-2006 07:13 AM
I like that idea. It could be another optional feature at the edge of the case structure.
I have given it some thought and implemented like this
The main problem is keeping the valid conditions and the enum for case selection sync'd together.
David
Message Edited by David Crawford on 06-23-2006 01:14 PM
06-23-2006 07:15 AM
06-23-2006 07:26 AM
06-23-2006 07:34 AM
One method of doing this is converting to strings and concatinating the cases. Now you should be able to handle any permutation of inputs with a single case structure.
Paul
06-23-2006 07:39 AM
here is a workaround ....
BUT you loose the flexibility to use type defs . its bad for debugging ......
I did that years ago as an state MC ( one enum for status another for action) and NO NO NEVER AGAIN
Since that time I always found a nice way to do my state MC with one enum.
Use a nested case as an subvi to merge to one enum, or ....
06-23-2006 07:49 AM
here is an example using the string format functions, it allows you to combind any number of enums and treat them as a single string. You can even handle ranges of cases. See the "Auto+"..."Auto+~" which should handle any color string enum value. I used the '~' because it has the highest ASCII code and will allow for almost any color string name. This is a good question made me think and this is the first thought that came to my mind. I am curious to see how others approch this problem.
Paul
06-23-2006 07:51 AM
whow 6 answers in 40min and David had a nice solution that results to ONE case selector
06-23-2006 08:02 AM
And this although it is friday afternoon.. :D:D
Anyway - some nice solutions. Maybe a member of the "blue bars" could also give a comment. Will see...