LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Strings[] of Menu Rings in a Cluser and Array of Clusters

I need to progmatically set the Strings[] property for a Menu Ring control that is within a cluster and also within an array of clusters.  How do I access this property progmatically within my labview program.  Attached is the code I'm working on. 

Also, I need to have these control clusters across this diagram.  Is there anyway to bundle them together on the block diagram so I can step through them progmatically as if they were an array rather than having to write code to work with each one individually?  In some cases I can bundle them together in the block diagram to do some looping across them, but in other cases...i dunno, it seems complicated and I'm not into extra unneccessary repetive coding if there is a way around it.

Thanks for your input!
-Nic
0 Kudos
Message 1 of 10
(4,362 Views)
Anything in an array has to have the same properties.  In this case, all of your ring controls must have the same strings values.

If you write a lot of your coding in subVIs, then you won't have a lot of recoding to do.  If you want to do it in a loop nature, you could create a huge cluster which has all your other clusters in it and use cluster to array to process the values.  But, this is not the way I would do it.  You can use the event structure and subVIs and minimize your code development.
0 Kudos
Message 2 of 10
(4,358 Views)
I want all my menu rings in my clusters in my array to have the same string[] values.... but I need to set that progmatically.  I've been trying to get to that specific property reference and cannot seem to find it.


Message Edited by Nickerbocker on 11-06-2007 01:25 PM
0 Kudos
Message 3 of 10
(4,353 Views)
Just right click on the ring in the array and choose Create->Property Node->Strings[]
0 Kudos
Message 4 of 10
(4,346 Views)
Here we go.  I figured it out.

For someones future reference, if you make any property node you can re-link it to a different front pannel object by right-clicking and going throught he "Link" submenues.  See attached image.

Gotta love NI!


0 Kudos
Message 5 of 10
(4,345 Views)
I'm not sure how you right-click the specific "menu ring control" in my array of clusters in order to get to the create property node submenues from the block diagram...  maybe you could post a screen shot of what you are talking about.  If you index the array, and then unbundle it all you have access to is the values of the objects...not a reference.  Creating any property node, relinking it using that submenu, and then assigning the "Strings[]" property worked for me.

Also, placing my diagram, and all my controls in a cluster was a really good idea.  You didn't seem to think that this was a good approach.  Would you mind elaborating on your reasons why?  I like it as it keeps those elements together...

-Nic
0 Kudos
Message 6 of 10
(4,337 Views)
As I said, I right-clicked on any pull down in your array, right-click, and navigate to Create->Property Node->Strings.  It creates a property node on the block diagram which is the reference to the Strings property of the Ring control in your array of clusters.




Message Edited by Matthew Kelton on 11-06-2007 02:04 PM
0 Kudos
Message 7 of 10
(4,323 Views)
Ok...this is getting complicated, but if I can solve this problem it will greatly simplify a number of programming projects that I'm working on so I need someones help :P.

What I have is a mechanical diagram of a high pressure system that I'm developing software for that is previously posted and described.  The diagram is contained within a cluster and within that cluster are these "control clusters" that contain two LEDs, a toggle switch, and a reference using a menu ring.  Also contained in this diagram cluster are numeric "indicators" (i use the word in "" because it is actually a control cluster due to the functionality of the toggle switches).

As previously discussed, I want to set the Strings[] property of the menu rings within these control cluster progmatically set.  This can be accomplished through linking.  However, since there is a "collection" of these within this diagram cluster what I would really like to be able to do is set all the Strings[] of the menu rings to the same collection of strings by somehow looping through an array of references to each menu ring and setting the strings[] property in a loop.

I think that this should be possible, but I'm loss as to how exactly. 

Attached is an image of a subVI I wrote that takes the Controls[] reference of the diagram cluster and outputs an array of "control clusters" while ignoring the numeric "indicators." 

I think my desired algorithm goes something like:

* Get an array of references to each control in the diagram cluster.
* Process the array so that I only have an array of "control cluster" references.
* Obtain an array of "menu rings" references for each "control cluster" reference.
* Loop through the "menu rings" references setting the Strings[] property for each reference.

Sounds complicated but if I solve this one, it will greatly simplify maintainability of a lot of systems that I work with.

Thanks for all your input!

-Nic
0 Kudos
Message 8 of 10
(4,298 Views)

Hi Nic,

In this Nugget I talked about getting at any data type in any type of structure.

That Nugget may give you some ideas on how you solve your riddle.

The only difference between your data structure and what that code works with is your data structure is fixed while that code handles un-known strutures

and

you are after the property while that example was after the data.

I hope that helps,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 10
(4,291 Views)
Thanks for the link, Ben!

I actually recall reading that earlier and had already started towards something that resembled the lessens learned.

Got my code to work.  I'm pretty surprised how simple, easy, and just plain graceful LabVIEW is.  Works like a champ and the code is easy on the eyes so should be maintainable.

Attached is my implimentation as an image.


Message 10 of 10
(4,287 Views)