LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem nesting combo boxes between them LabVIEW

Good evening, everyone.
I want to make a VI with nested combo boxes, that is to say that when I click on combo box 1, I would have a drop-down menu of 'NAM1, NAM2, NAM3 ...' when I fill in for example NAM2 in this drop-down menu and I click on combo box 2, it will have the drop-down menu of combo box 2 that will make show all the ATPs of this NAM chosen previously in this case NAM2 in this example, and so on for all the string elements that I want to fill in because the saved file will be a file of the type: NAM_ATP_Environnement_FT_Signal_Reptopo.lvm
and this file is a .lvm file that records the voltage of a signal that is seen with a scop using the Read Measurement From File function. I'm attaching some of the code that I've tried to do, really I'm trying to make a code so that the boxes are nested so that the user is not typing the file name directly into my IHM, but rather who chooses the files saved in the directory and sort according to what it fills out in the combo box.
Thank you for your help and reading.
Cordially
Download All
0 Kudos
Message 1 of 7
(259 Views)

Hi Problem,

 


@Problem LabVIEW wrote:
I want to make a VI with nested combo boxes, that is to say that when I click on combo box 1, I would have a dropdown menu of 'NAM1, NAM2, NAM3 ...' when I fill in for example NAM2 in this dropdown menu and I click on combo box 2, it will have the dropdown menu of combo box 2 that will make show all the ATPs of this NAM chosen previously 

You describe a series of steps that you want to execute:

  1. Fill combobox1 with some "names".
  2. Let user select an item from combobox1.
  3. Upon chosen item you want to fill combobox2 with some "ATPs".
  4. Let user select an item from combobox2.

Defining those steps easily provides the way to create a simple state machine, with one state per step!

You could use property nodes to enable/disable controls so the user is guided where to click and select…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(133 Views)
Hello GerdW,
Thanks for your answer, the ideal would be that when I enter the information of the strings boxes in the upper right on the PNG file I sent and click the button to save them so that they appear in the list boxes nested.
The problem is that I don't see what I could bring to the code to get there and I want it done dynamically i.e. I put a While loop and an event case but it doesn't work.
0 Kudos
Message 3 of 7
(109 Views)

Hi Problem,

 


@Problem LabVIEW wrote:
the ideal would be that when I enter the information of the strings boxes in the upper right on the PNG file I sent and click the button to save them 

  • In the "upper right" I only see ComboBox terminals. There are several strng controls in the upper left of the block diagram image!
  • Which button do you "click to save them"? There only is a switch that defines either appending or replacing a file…
  • You wire a path to an Excel XLSX file but you use file functions for CSV files: typically this will not work as expected (in the long run)…

@Problem LabVIEW wrote:
so that they appear in the list boxes nested.

  • Which strings should appear in which comboboxes?
  • You write strings to a CSV file, but read numeric data from the same CSV file???
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(102 Views)

To be more clear I have made another code that allows to save my CSV files by assigning the following name: NAM, ATP, Environment ... and I want this file to be found by having a drop-down menu, for example: it clicks on the list box NAM, it can have several NAM then this NAM will give other ATP files according to this NAM in question. In other words, it is dynamic, the operator fills the strings to assign the file that will save and when he wants to find it, he can go to the nested drop-down menus. I hope I have explained the problem better

0 Kudos
Message 5 of 7
(92 Views)

In this code, we save in XLSX, but in the main code it is a .lvm file that we try to find. The XLSX file is simply there to test if the code works but the ideal would be that this drop-down menu works for a .lvm file

0 Kudos
Message 6 of 7
(88 Views)
  1. At the program start, check the main folder location and get an array of names of all of the files in question.
  2. Populate the Strings[] of NAM with every possible value, and set the Strings[] of every other combo box to an empty array.
  3. When the user selects NAM, check your array of names to find all files with that NAM.
  4. Populate the Strings[] of ATP with every possible ATP value from those files, set Strings[] of every combo box after that to empty.
  5. When the user selects ATP, check the array of names to find all files with that NAM and that ATP.
  6. Populate the Strings[] of Environment with every possible Environment value from those files, set Strings[] of every combo box after that to empty.
  7. Continue to repeat this for every successive combo box.

 

Redhawk

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 7 of 7
(66 Views)