LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set default value on combo box

Solved!
Go to solution

Hello,

 

I have a VI with a listbox and a combobox. On combobox I have 12 numbers, each number represent one month, I'm trying to set the actual month as a default value but i can't do it, for exaple, right now we are on July, so when I click on run VI, i want to see the info about this month displayed on the listbox. 

Mocte117_1-1688258650919.png

Mocte117_2-1688258683410.png

I tried to use a property node called Value (Signaling), and it set the actual month, but when i want to select another month it is not posible.

Mocte117_0-1688258612641.png

 

Any one has an idea about how to resolver this? 

 

Thank you.

 

0 Kudos
Message 1 of 3
(1,223 Views)

I think we have a problem with terminology. You just want to se a value when the program starts. (A "default value" for a control is what it has when you open the VI from disk. It is saved with the VI. Changing the default value would require modifying the source code!)

 

Why exactly are you using a combobox instead of an enum? (The number and order of months in a year is universally fixed, right?)

 

The code you have attached has no resemblance to what your images show and you did not attach any of the text files. How are we supposed to troubleshoot?

 

Most of your code is questionable and overly complicated. For example instead of a case structure with 12 cases, you could just do the following, right?

altenbach_0-1688301254686.png

 

Why is there no event for the stop button? Why do you wire the listbox terminal to a structure?

 

To get the current month, all you need is the following:

 

altenbach_0-1688301542023.png

 

0 Kudos
Message 2 of 3
(1,172 Views)
Solution
Accepted by topic author Mocte117

See if this can give you some ideas.... (Instead of reading the file, I faked some listbox data)

 

Note that you could just format the Enum, which would give you filenames such as "July.txt", which would be more self-documenting.

 

altenbach_0-1688302673685.png

 

Message 3 of 3
(1,161 Views)