LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array of Rings - Accessing Strings[] Property

I'm using LV 6.1.

I have several ring controls on my front panel.

I would like to build these into an array, then loop through the array and retrieve the string associated with each ring's value. These would be concatinated to construct a command message for an instrument.

I know how to create a reference to a ring object and use index array to retrieve the string, but can't figure out how to reference the strings for rings inside an array. I've attached an example of what I've done so far........
0 Kudos
Message 1 of 7
(5,447 Views)
Answered the question myself. Build Array is only and array of the VALUES, not the controls. I instead created a cluster, then a reference to that.

I connected a property node to the reference and selected 'Controls[]'. From here I could pass the array to my for loop and address each Ring item's Strings[] property.

NOTE: I had to typecast the 'Value' property of the object in order to select the specific string from the Strings[] array.
Message 2 of 7
(5,447 Views)
Looks like you figured it out, but you didn't need to use a cluster (unless it makes your diagram simpler). The attached is a mod of your original example. The difference is creating an array of values versus and array of references.

~Tim
0 Kudos
Message 3 of 7
(5,447 Views)
This is how I would do it.


"Phillip Brooks" wrote in message
news:506500000008000000ED740000-1042324653000@exchange.ni.com...
> I'm using LV 6.1.
>
> I have several ring controls on my front panel.
>
> I would like to build these into an array, then loop through the array
> and retrieve the string associated with each ring's value. These would
> be concatinated to construct a command message for an instrument.
>
> I know how to create a reference to a ring object and use index array
> to retrieve the string, but can't figure out how to reference the
> strings for rings inside an array. I've attached an example of what
> I've done so far........



[Attachment dmmCFG_mod.vi, see below]
Message 4 of 7
(5,447 Views)
The cluster works out better for me. I'm using this technique to create groups of commands for OLD 488.1 (and earlier?) instrumentation. These instruments do not implement any kind of state machine or persistance of settings. For example, if I change the frequency, I need to reset the nominal value, sampling rate, etc... By using a cluster, I can group the commands in the order they need to be sent as well as "remind myself" of the dependancies if I create a constant on my diagram. Thanks for the help!
0 Kudos
Message 5 of 7
(5,447 Views)
Your example worked great! A cluster works out better for me though. See my answer to Shan. Thanks for the help!
0 Kudos
Message 6 of 7
(5,447 Views)
Can anyone put these examples into 5.1 labview version. I am very interested in what was done.

Thanks
Bill
0 Kudos
Message 7 of 7
(5,447 Views)