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

cancel
Showing results for 
Search instead for 
Did you mean: 

strict enums as inputs

Hello:
I'm adding new functionality to a very large Labview application. It requires creating new strict type enums that will be passed around to many sub vis. They are passed by value (controls to the child vi).

I would like to be able to modify just the subvi that takes the control rather than chase down all instances of where the enum is passed into the sub vi.

 

Inside the subvi I would like to be able to dynamically change the enum input to either the old type or the new type, make it a polymorphic sub vi.  I've played around with Varients but no luck.

Thanks,

Mike

 

0 Kudos
Message 1 of 6
(2,882 Views)

Hi, Mike,

 

Similar question was in discussion today:

http://forums.ni.com/ni/board/message?board.id=170&thread.id=418654

 

Andrey.

0 Kudos
Message 2 of 6
(2,877 Views)
I'm sorry, I don't quite understand your question.  Is the issue that the "old" enums are not linked to a type definition, and you'd like to use an strict type enumeration going forward without replacing the existing ones?  If so, it's probably worth the time to update all the code to use the same enumeration type definition.
0 Kudos
Message 3 of 6
(2,857 Views)

the application uses this sub vi many times. This sub vi takes in a strict enum as a control. I have to create a new enum that has new strings and number of elements and use that enum under certain conditions or still use the original enum control under certain situations.

I've followed the previous poster's link and that seems to be what I'm after but I try it out and can't seem to understand how to create a generic ref to the enum contol

0 Kudos
Message 4 of 6
(2,851 Views)
Any chance you can simply add your new values to the end of the existing enumeration?  Having two enumerations that both overlap or represent some of the same things seems likely to cause confusion later.
0 Kudos
Message 5 of 6
(2,848 Views)

yes, I have that has my plan B. I just have to keep the strings that match with the old in the same index I guess, thanks for your help. I will do it that way and save alot of hastle.

MIke

0 Kudos
Message 6 of 6
(2,844 Views)