LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining the current menu ring value from a cluster

Solved!
Go to solution

Hi,

I am trying to program a bunch of menu rings to use the same options and disable the same option in the other menu rings if it has already been chosen. It basically works as is right now, but it shows each button as using a "disabled" option because  Im disabling the option even in the buttons that have that value. I did this by using a for loop and property node and DisabledItems[] en masse. Now I want to skip the iteration of the loop for the menu ring which already has that value.

To do this though, I want to obtain the current numerical value of the menu ring and search an array of values. If the menu rings value is in that array, then I want to skip the current loop iteration. The problem I'm having is that when I try to use a property node and set the property to Value, instead of giving me a long 32 type output, it's giving me something called "Variant" which I have not seen before. I also am not sure how to search an array and see if the value I have is in that array. "Search Array" just seems to return an index, I think I want a boolean or something. I'm also not sure how to skip an iteration of the loop (although I imagine it will not be too difficult to figure out on my own, hopefully.)

I apologize if any of this is extremely obvious or if my message is unclear. I just began using LabVIEW a few weeks ago and I'm still learning. I've included an image of my subVI at the bottom.

Thank you,
NathanProblem.png

0 Kudos
Message 1 of 4
(2,944 Views)
Solution
Accepted by topic author NRC_Nate

Use Variant To Data to convert the variant to a numeric (whatever representation you need).

 

Search 1D Array returns -1 if the item was not found.  So you just compare the index with Greater Or Equal To Zero and the result will be if the item was found in the array.


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 2 of 4
(2,932 Views)

Crossrulz is too fast for me (stupid trackpad) but here is a snippet showing what you can do.

 

Variant to Data.png

 

Also, if you want to "skip" the loop iteration, you can just use a case structure where you don't do anything on the iterations you want to skip.

 

Edit: The Error case is just a Clear Error function

Matt J | National Instruments | CLA
0 Kudos
Message 3 of 4
(2,924 Views)

He replied first so I accepted his as the solution, but thank you as well. Really appreciate it.

0 Kudos
Message 4 of 4
(2,915 Views)