LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combo box output items name instead values

I met a problem with combox application.

 

By selecting the combox item name, I wish to get the corresponding values. But always the combo box gives item name, even if I use its property node(value).

 

LV2012SP1

WT

0 Kudos
Message 1 of 8
(3,505 Views)

Occasionaly, If I uncheck "Allow undefined values at run time"  under the combo box propeties "Edit Item" tab, then it output values instead of item names.  After this, with  "Allow undefined values at run time"  checked, it output values, too.  Strange behaviour!  

This is not always working.

 

WT

LV2012SP1

0 Kudos
Message 2 of 8
(3,498 Views)

Attached please find the combox VI. Please take a look to check the problem.

 

WT

LV2012SP1

0 Kudos
Message 3 of 8
(3,484 Views)

What is the VI supposed to show?

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(3,438 Views)

When you uncheck the box, did you actually define values for your control?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(3,432 Views)

The VI (string2 and string3) is supposed to show the values which is defined in the item table.

 

I found the solution. To achieve this purpose, one have to use the Text.text property node to choose the item in the combo box. With a string given to the combo box, it doesn't work. This seems to be contrary to one's general thought.

0 Kudos
Message 6 of 8
(3,423 Views)

Dear all. There is a way to make it work with the text combo box, but it is a bit cumbersome. If we create a property node of strings and values, this outputs an array of bundles, which contains both the text and the items. We can then unpack the bundles and perform operations with them. I have attached a VI, that accepts both the array of bundles (named binning) and a property node:text.text (binning) which will look though the array of bundles and check if a desired text is there. It will then return the value.

 

Hope this helps

 

Robert

0 Kudos
Message 7 of 8
(135 Views)

It is not helpful to post a response to an 11 year old thread with a relatively dysfunctional VI that cannot run on its own.

 

  • Autoindexing on a FOR loop (showing the conditional terminal) would be significantly simpler than a while loop randomly limited to 21 iterations. Can't the input array be larger?
  • You can wire the stop condition direction to the comparison output. No need  for all these boolean constants.
  • terminals assigned to connectors should reside on the toplevel diagram, not inside structurers.
  • There is no terminal called "binning" or any property nodes. Did you really attach the correct VI?
  • ...
0 Kudos
Message 8 of 8
(122 Views)