LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing enum from ini file

I'm creating a user interface where the user selects a type of sensor from an enum.
The type of sensor is important for all measurements.

I've got a .ini file containing among others:
[sensor]
sensor1=FALSE
sensor2=FALSE
sensor3=TRUE
sensor4=TRUE

my program gets the sensor list and checks for a true or false setting.
FALSE means the sensor is no longe in use and should not be shown in the enum.
So after all this I've now got an array of strings containing which sensors need to be shown in the enum control.

I know I can set the strings[] property from the enum using vi references, but will this also work when I build an executable?
Also, is there an easier way of creating a pull down type of menu from an array of strings, w
here the user can select one of the elements?
0 Kudos
Message 1 of 4
(3,429 Views)
1. I cannot think of an easier way than assigning an array of strings to a menu ring. I tend not to work with enums, preferring Menu rings. The string values work fine in case statements, but be sure to click case insensitive match!
2. You mention "true or false setting" Beware!! you should prefer to check True or Not True. If you happen to have a misspelt True you will get different actrion if you sometimes check for True and in other places check for False!
Message 2 of 4
(3,429 Views)
Thanks, all my hard work for nothing, menu rings, great, now why couldn't I have noticed one of those 4 hours ago. 😉

Seriously though, thanks alot, the menu ring works great.
0 Kudos
Message 3 of 4
(3,429 Views)
Hi,

It whould be much easier to use a ring list instead of an enum. The elements
of ring list can be changed on the fly, with the strings[] property.

Regards,

Wiebe.



"Arend" wrote in message
news:506500000008000000C9F50000-1079395200000@exchange.ni.com...
> I'm creating a user interface where the user selects a type of sensor
> from an enum.
> The type of sensor is important for all measurements.
>
> I've got a .ini file containing among others:
> [sensor]
> sensor1=FALSE
> sensor2=FALSE
> sensor3=TRUE
> sensor4=TRUE
>
> my program gets the sensor list and checks for a true or false
> setting.
> FALSE means the sensor is no longe in use and should not be shown in
> the enum.
> So after all this I've now got an array of strings containing which

> sensors need to be shown in the enum control.
>
> I know I can set the strings[] property from the enum using vi
> references, but will this also work when I build an executable?
> Also, is there an easier way of creating a pull down type of menu from
> an array of strings, where the user can select one of the elements?
0 Kudos
Message 4 of 4
(3,429 Views)