LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a ring/listbox that behaves like a listbox in html?

Dear Sirs:

I have an arrays that represents people's names with associated values:

ID, Name
2, Sara
4, Marx
6, Jackson
9, Lisa
... and so on.

All I want to do is to populate a ring or listbox (btw, which one is the correct?) that displays only the names and tell me which is the value associated to the selected name by the user.

(That's pretty much the expected behaviour for those who are familiar with html).

An extra issue: How can I tell the ring/listbox which name to display as default?

Thank you so much!

Best regards,

Javier Mauricio
(Using Trial LabView)

PD: The enclosed VI shows that I have been only able to detect wich element number was selected (not
the ID).
Mauricio Vidal
VIDAL & ASTUDILLO Ltda.
http://www.vidalastudillo.com
0 Kudos
Message 1 of 3
(2,721 Views)
Hello, Javier!

I'll do my best to answer your question.

Your sample VI was close. Since you can detect which element number was selected, the only thing that you need to do to display the value associated with the selected user name is to wire the element number to an Index Array function. Use the element number to select the correct row of the ID column. This gives you the value associated with the selected user name.

To tell the ring/listbox which name to display as default, you just set the Value property for the control to the value that you want as the default. You do this by creating a property node. Then select the Value property (by default, the Value property is set to read). Right-click the Value property in the property node and sel
ect Change to Write. Then you can wire your default value to it.

The attached VI shows how to do what you want to do.

Hope this helps.

Mark Ridgley
Message 2 of 3
(2,721 Views)
Mark:
Thank you so much for your answer... It was very clear and enough.
I wasn't able to try your example (my labview vers. is 6.0.2). Anyway I followed your directions, and everything went perfect.
Best regards,
Javier Mauricio
Mauricio Vidal
VIDAL & ASTUDILLO Ltda.
http://www.vidalastudillo.com
0 Kudos
Message 3 of 3
(2,721 Views)