LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a combo box input

Hello. I am creating a VI that reads / writes an EEPROM using the USB-8451. I have a VI written that allows me to read and write but what I would also like to do is update my inputs based on what is read from the EEPROM. For example, I have a combo box from which I select from several options and then write the corresponding value to the EEPROM. I would like to also be able to read from the EEPROM and have this combo box updated to whatever was read. Could someone explain how to accomplish this?

0 Kudos
Message 1 of 7
(2,920 Views)

Example_VI.png

to update a combo box at run time simply use a property node to write StringsAndValues


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(2,914 Views)

Or if the values match the strings (default), just use the Strings[] property.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(2,904 Views)

Thank you both. I am a labview beginner, so I think I have done a poor job of explaining this. I think I understand what you are saying but its not what I am looking to do. I have attached a stripped down example of my VI. Currently, a user can select a value from the combo box (Identifier) on the second tab of the interface and then by selecting (Start Write) on the first tab, write that value to an EEPROM. I would also like to be able to select (Start Read Full EEPROM and Update Tables) and read an EEPROM value and then update the combo box based on this value (indicator labeled element). Is it possible to have a combo box that can be used as both an input and an output?

0 Kudos
Message 4 of 7
(2,891 Views)

That isn't a combo box.  It is a menu ring.  A combo box is string while a ring's data is a number (in your situation, a U8).

 

If you are not updating the strings for the ring, then you just want to set its value?  Use a local variable.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(2,877 Views)

 Thank you crossrulz. Yes, I have several types of boxes in the actual VI but this particular example is using a ring. I have cleaned up the example a bit and reattached it. Could someone explain or possibly even show me how to wire this up so that the ring menu will update and display the corresponding value that is read from the EEPROM after selecting the "Start Read Full EEPROM and Update Tables" button. I understand how to create a local variable from the output named 'element' but not sure how to make this variable update the menu ring and display the value read on the front panel. Thank you.

0 Kudos
Message 6 of 7
(2,868 Views)

Its not going to work like that.

 

a ring must have unique values (no duplicates)

 

What you seem to be looking for is a "Current Values Table" and there are many examples of a CVT implementation.  NI has a rather nice one over here 

 

It has more features than you really need for a simple application but, it is the right price 


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(2,855 Views)