From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-22-2022 08:17 AM
Hello
I'm trying to create my own "menu".
In the config file from which i'm reading there'll be a section with commands and their values. What i want to do is populate a ring (or something else more appropriate) with names of commands and their values for example:
command: speed, value: 0x4E (or in decimal 78)
I managed to change the names with property node but the values elude me. What is the proper way to do this?
Also each time the config file is read, the old values should be purged from the list and new ones added.
Solved! Go to Solution.
02-22-2022 08:50 AM
02-22-2022 09:12 AM - edited 02-22-2022 09:13 AM
<edit> Oops, too late -- queued up a bunch of tabs, then it took a while to getting back to them.
-------------------
In addition to the Strings[] property (which you seem to be using), there's also a "Strings and Values[]" property node that let's you set or query them as an array of clusters...
-Kevin P
02-22-2022 11:36 AM - edited 02-22-2022 11:37 AM
Note that his doesn't work with an enum control. Enum's look like rings, but there items are part of the type, and can't be changed when the control is running.
02-22-2022 09:35 PM
You could use a Ring or String combo for the UI Control, and a map to store the actual value. Nice thing about the String combo is that its value is the string, not just a number.
02-23-2022 01:32 AM
uh, duh.. didn't see it all the way at the bottom... Thanks
Is there any way to select a "default" value (the one that shows as selected)? Currently it just displays <0> until i select something by hand.
02-23-2022 01:44 AM
You can right-click on any control -> Data Operations-> Set Default (something like that). Or you can use a local variable to initialize it.
02-23-2022 02:04 AM
Played around a bit and you can set the value to display programmatically by using Property Node --> Value and wire one of the values you input to StringsAndValues[].
Quick demo: