LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use a listbox?

Hi guys,

 

I am doing an assignment for uni and am having trouble with listbox.

 

My general idea is to list different levels of exercise (e.g. sedentary, mild, moderate etc.) on the front panel and each of these needs to correspond to a value which can then be used as the second component to calculate Recommended Daily Intake of Calories (RDI).

 

i.e. RDI = BMR + Activity level... I'v wired the calculations for BMR and need 5 inputs for activity level so that when an activity level is selected on the listbox on the front panel (1. sedentary, 2. mild, 3. moderate, 4. severe, 5. athlete), this can then multiply my BMR calculation by a percentage that corresponds to the level of activity to give RDI

 

I hope this makes sense, and I'm hoping I'm using the right application for this type of calculation. Any help would be greatly appreciated. 

0 Kudos
Message 1 of 4
(2,995 Views)
What exactly is the problem? The output of a listbox is an I32 so it does have a value associated with each item. You can add, subtract, multiply, etc. anything you want to it. You could wire it to a case statement.
Message Edited by Dennis Knutson on 05-30-2010 10:45 PM
0 Kudos
Message 2 of 4
(2,988 Views)

Isn't the output of a listbox an array of I32, as you can select several rows at once?

Anyway, listbox, ring control or Enum, the solution is rather similar any way.

With a text ring or menu ring you can set the value with the text and use that directly, so that's what i'd use.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 4
(2,972 Views)

Hey Sezhendo,

 

listbox, ring control and enum control all can be used in your application.. Text ring gives u additional option of defining numerical values, whereas you can define only the string values of items in an enum.

 

It is not clear about the problem u r facing .. please reply with specific.. still some guess solution from myside..

 

Items can be defined Programmatically as well as defined on front panel.. Incase u want to do programmatically use typedef for enum control and then
use application control VIs over this to add items as combination of arrays... Otherwise u can simply right click on front panel control and go for edit items..

 

Hope it helps

 

HS

0 Kudos
Message 4 of 4
(2,951 Views)