02-03-2015 12:33 PM
I have a typedef enum that defines what the DUT is for my automated test fixture. This enum is used all over my code in order to decide which tests to run and how to interpret results, etc. I also have a typedef tab control (well tab indicator to be precise) which has a page for each of the DUT's with different indicators for each test that will be run on that specific DUT.
I would like to use the typedef enum to select which page of the tab indicator to display. I am able to do it with brute force of just a U32 converter like this:
But would prefer (due to my anality) to eliminate that ugly red coercian dot (and based on the size of the code, any memory I can save helps too).
I have tried many things and none seem to work. This way, using a type cast, doesn't work.
And neither does this using variants (though it does work with this little piece of example code, maybe because my test fixture is an executable?):
With the variant version, my test fixture throws an error 91 saying the data types are not compatible.
Anybody have an idea how to convert between these two without that ugly coercian dot?
Solved! Go to Solution.
02-03-2015 12:36 PM - edited 02-03-2015 12:37 PM
I guess I should also say, unlike my sample code above, the enum and the tab control have different number of values. ie:
Enum Tab
page 1 page 1
page 2 page 2
page 3 page 3
something 1 something else
something 2
02-03-2015 12:50 PM
Why not write a little VI with Enum input and Tab output? It would just have a case structure internally. You can make the icon small so it does not take much more space than the to U32 conversion.
Lynn
02-03-2015 12:50 PM
Make sure that both your enum and tab control have the same representation (e.g. both U32 or both U16, etc)
02-03-2015 12:53 PM
I very much like this proposal.