LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set a ring enum to the first item, regardless of its value

Hi everyone,
 
I am trying to set a ring enum to the first value.  During run-time, I dynamically update the entries in a ring so I don't know the strings or the values ahead of time.  How do I force the ring to select the first element, which may have a value of '3', for example?
 
Thanks,
 
Jason
0 Kudos
Message 1 of 14
(4,289 Views)
You mean a text ring or an enum?

As far as I know enums always go from 0 to n-1, so the first element is always 0.

With a text ring, you can use a property node to get "data range.minimum" and set the ring to this value.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 14
(4,281 Views)

I tried playing around with that and it didn't yield the right result.  BTW, I am working with a text ring.  The data range.minimum is the minimum allowable in the properties sedtion - not the value of the first entry.  I did find out the only way to get that is to use "strings and values", extract the first element, and then choose the "value" field.

Thanks!

Jason

Message 3 of 14
(4,280 Views)
Here is a solution. But... shhhttt... don't publish it, it's an NI secret !
 

Message Edité par chilly charly le 03-23-200606:55 PM

Chilly Charly    (aka CC)
Download All
Message 4 of 14
(4,274 Views)
Yeah, nice and simple!  For some reason, under LabView 8.0, there is now property called "Values",  Only "strings and values".
 
Jason
0 Kudos
Message 5 of 14
(4,270 Views)
How surprizing ! Here is a LV 8.0 version. As you can see, the "Values" property exists ! 😉 :D:D:D
Chilly Charly    (aka CC)
Message 6 of 14
(4,263 Views)
Sorry, just mixed up everything. Here is the right file
Chilly Charly    (aka CC)
Message 7 of 14
(4,259 Views)
I don't have the Values (OR strings and values) property in LV 6.1, and to be honest, I can't see a way of doing this in LV 6.1.

Someone tell me I'm being slow today.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 8 of 14
(4,243 Views)
As CC said, although not in so many words, the Values[] property is a private property. The Strings and Values[] property isn't, but if it did exist in 6.1, it probably was private. You might be able to extract the enum data from its type descriptor or maybe by flattening it to a string. I would look at the OpenG data manipulation VIs.

___________________
Try to take over the world!
Message 9 of 14
(4,238 Views)
Wow, it's kind of extreme having to dig up the TD to do something like this.

Hmm.  The reasons to upgrade are increasing.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 10 of 14
(4,236 Views)