LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract value from programmatically created text ring

Solved!
Go to solution

Hello,

I have a spreadsheet from which I would like to extract a single row. The first column of the spreadsheet has non-evenly-spaced time values and I feed these time values into a property node that is fed into the Strings[] property node of a text ring indicator. The purpose of this is because I want the user to only select times for which data was collected and, conveniently, the zeroth time point on the list corresponds to the zeroth row.

However, when the user selects an item from the text ring, the control passes along the string selected, and not the associated value, despite using the "Value" property node. Do you have any idea why this might be happening? I know I could use the search 1D array VI to fix this, but I'm more interested in why this doesn't work. I've attached some example data as well as the VI in question for reference. Thank you very much for your assistance! 

 

EDIT: It appears that this may stem from the fact that the strings I am feeding into the Strings[] field are numbers. When I made I swapped out the times with random text strings, it worked just fine. Curiouser and curiouser...

Download All
0 Kudos
Message 1 of 5
(4,121 Views)

You simply forgot to assign "Values"

!1.png


"Should be" isn't "Is" -Jay
Message 2 of 5
(4,111 Views)

Sorry, I don't understand your question at all. The code looks like it's doing exactly what's expected. Why are you using the Value property node in place of the control terminal? Just wire the control directly to index array.

 

I don't see anywhere in your code where it is "passing along the string selected." When you select an element from the Ring (the menu), the value of the control is the index of the selected value, which is what's happening here. What were you expecting? Maybe it would help if you show the code that you meant when you said you could fix this with Search 1D Array, so we can see the behavior you think you should get.

Message 3 of 5
(4,110 Views)
Solution
Accepted by topic author Damrauer

Jeff and Nathand,

Thank you both for your replies. I actually was just able to solve the problem on my own by swapping out the Array Subset VI with the Index Array VI. It works perfectly now, even with the Values unassigned (though that was an excellent suggestion, Jeff). Nathand, in regards to your question, the indicator that I had attached to the Select Time control wasn't displaying the value (0,1,2...) as I expected but the selected string itself, (-800, -750...) which confused me into thinking that something was wrong. I've attached the fixed VI for reference.

0 Kudos
Message 4 of 5
(4,103 Views)

@Damrauer wrote:

Nathand, in regards to your question, the indicator that I had attached to the Select Time control wasn't displaying the value (0,1,2...) as I expected but the selected string itself, (-800, -750...) which confused me into thinking that something was wrong. I've attached the fixed VI for reference.


As you may have figured out, what (I'm guessing) happened here was that you created an indicator directly from the Ring control, so it duplicated the Ring. Not surprisingly a Ring indicator operates in reverse of a Control - the value is an index, and it displays a corresponding string. Replace the Ring indicator with a normal numeric indicator (get it directly off the palette) and you'll see the index you expect.

Message 5 of 5
(4,092 Views)