LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

attaching binary arrays to a menu ring

I have been playing around with the menu rings and can't seem to get it to do the function that I want.  I am looking to making a pull-down menu for some user options for different resoultion modes for an intrument.  So for example one option will be "2 eV" and with this option on I need to send 011 to a instrument.  Should I store it as a binary string or array, and how can I do that?
 
Thanks in advance
0 Kudos
Message 1 of 4
(2,983 Views)
Do you always need to send a number to the instrument? If so do it this way:
For the menu ring go to its Properties >> Edit Items. In this dialog you can enter the displayed text and the assosiated number. So yo can pair 2eV with 11. The terminal will give you the number. From your example I assume that the instrument will see the number as text with three digits. Use the "Format into string" function. Set the format string to "%03d" which will give a number with three digits padded with 0 to the left. Inthe example choosing 2eV will give 11 from the terminal and "011" as result from the Format function.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 4
(2,963 Views)
You can create
- one Enum or Ring that contains your labels ("2 eV", ...)
- an array of strings (or any another data type that stores your commands).

Coding this in one VI makes you flexible to any changes.
Regards, Guenter
0 Kudos
Message 3 of 4
(2,962 Views)

Use a combo box rather than an enum.  Combo boxes are perfect for the user selecting one sting, but the control outputs another string on its terminal.

For example when they select "2 eV" the value your diagram would get would be "011" as a string.

Message 4 of 4
(2,955 Views)