From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
SFK

Enum Size (or "length") Primitive

Hi all,

 

 

I am using Enums a lot to index values in an array or cluster (e. g. in an FGV), and have a merge VI for the typical process needed to initialize an array at the length of the enum size (string count):

 

Get_ENUM_Size_1.PNG

Using the type cast prevents false outputs if one were to add enum items after the currently selected value.

 

I would prefer having a real LabVIEW primitive to do the measureing, as a SubVI would be bound to the specific enum's data typedef. With a primitive, the same code would look something like that:

Get_ENUM_Size_2.PNG

 

Any thoughts on this one?

 

Best regards,

Sebastian

 

2 Comments
tst
Knight of NI Knight of NI
Knight of NI

> Any thoughts on this one?

 

 

Mainly that it has already been suggested - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Function-to-Count-Number-of-Items-in-Enum/idi-p/110305...


___________________
Try to take over the world!
Darren
Proven Zealot