07-01-2023 08:02 PM
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.
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.
Any one has an idea about how to resolver this?
Thank you.
Solved! Go to Solution.
07-02-2023 07:35 AM - edited 07-02-2023 07:40 AM
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?
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:
07-02-2023 08:00 AM
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.