LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enums and loops

Hello,

How do I loop thru all items in a enum. I have some instrument drivers which selects senors with enums and now i want to loop thru all sensors.

BRG Anders Olme
0 Kudos
Message 1 of 4
(3,072 Views)
An enum has a numeric representation. You can right click on a enum control and select Visible Items>Digital Display if you want to know the numeric values assigned to each string value. All you have to do for example, is to wire the iteration terminal of a while or for loop to the enum input of the driver.
Message 2 of 4
(3,072 Views)
On your VI diagram, right click on the enum control and select Create->Property Node, then select the property "Strings[]". This will return an array of all the choices in the enum. You can then feed this array to a For loop and inside that put a case statement for each possible choice (if each choice does something different). Inside the For loop, you can program whatever you want, actually.

Is this more what you're looking for?

Rob
Message 3 of 4
(3,072 Views)
Thanks for the help it worked quite well!

BRG Anders Olme
0 Kudos
Message 4 of 4
(3,072 Views)