From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RECIPE SYSTEM

I am trying to implement a recipe system, I would like the user to choose from a listbox the recipe that they want, then use the index returned from that to select the values from a 2D array (128 recipes, 7 parameters).

First off would this be the best way to do this?

Secondly how can I change the index of the array being displayed so that as they click the listbox the values in the array will be displayed accordingly.

Ron
0 Kudos
Message 1 of 3
(2,853 Views)
One solution would be to use an event structure inside a while loop. Plenty of examples ship with LabVIEW that show how to do this. You just need to respond to the "Value Changed" event for your listbox.

As for changing the index of the 2D array being displayed, what kind of data is this? If it's string you may want to use a multicolumn listbox or a table as that's a better way to display the information. With a multicolumn listbox you just wire the listbox index to a local variable of your multicolumn listbox. You can then also set the TopLeft cell row to be that so that it automatically scrolls to that row.

Attached is a simple example to give you an idea. Embellish/change as necessary...
0 Kudos
Message 2 of 3
(2,831 Views)
You can progamatically set the index value of an array with a property called IndexVals. The easiest way to update the displayed array when the listbox is changed is with the event structure. Whenever the listbox value change or is double clicked, update the array. Here's a simple example.
0 Kudos
Message 3 of 3
(2,829 Views)