03-25-2010 02:33 PM
Hi all,
I am kind of curious about how an enum is stored. If I choose U8 for my enum, I know that I need at least 8 bits to store the number. Where is the string portion of the enum stored? And how is it stored?
I tried to do a U32 type cast on the U8 enum, and I found what I didn't expect. I found that the original 8 bits became the MSB of the new 32 bits, instead of the LSB. Why is that? See attached.
Yik
03-25-2010 02:38 PM
03-25-2010 02:46 PM
In this thread Greg McKaskle talks about enums.
This explains how the type descriptor is formatted.
And this used to work for pulling out the strings.
Ben
03-25-2010 02:55 PM
Hi Ben,
Good information. How do you get the type description information in hex from in LV?
Yik
03-25-2010 03:05 PM
"Flatten to string" and choose (pop-up) the old version. The new thinks we don't need to know that anymore.
Ben
03-25-2010 06:55 PM
Ben wrote:"Flatten to string" and choose (pop-up) the old version. The new thinks we don't need to know that anymore.
Fortunately we now have modern tools that can take an enum as an input and give us the list of strings: vi.lib\utility\VariantDataType\GetNumericInfo.vi