LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Attribute nodes

Thanks. I'd put a Wait function but your approach is better. I'm not so used to the Event Structure but I'm learning it.

Now I have another question that follows the Property Nodes issue.

After I "discovered" the References, I tried to send to a SubVi references to several controls that I need, Picture and Numeric, so I can reuse the SubVi several times within my main Vi. I connected the references in the SubVi to their processes and everything seemed to work fine. Then I tried to be more sofisticated and created a Cluster with all the controls so I could send just one reference to the SubVi, instead of an individual reference for each single control. Inside the SubVi I got the reference to the Cluster, connected it to a Property Node to get the array of its controls and I thought that I could use an Index Array tool to separate each reference and use it. Then I realized that the individual references that I got are not recognized as specific references (for instance, I needed the DrawArea property of the pictures)

I'm attaching two simple Vis, the main Vi and it's SubVi, where I send three references, one picture, one knob and one cluster with copies of the two controls inside. The SubVi is just meant to show that, when the controls are within a Cluster, I cannot get to their specific properties.

I hope I was clear enough. I'd appreciate comments. Thanks much,

Marce
0 Kudos
Message 11 of 13
(666 Views)
While I couldn't see your VIs, I believe I know what your problem is. The reference for each type of control is different and seems to dictate what LV can and can't do with the property node. When you sent your references directly to the SubVI, you told LV exactly what kind of reference it was and it gave you the right options. When you put it into an array (through the cluster) it seems that you lose that. Another problem I think you would have encountered is that since you gave the SubVI a control (the cluster) as an input, I think it would create a new reference to that control and not to the one on the main VI. What you should do is bundle your references in the main VI, create a control, copy it to the SubVI and use that as your input. I'm attaching an example.

___________________
Try to take over the world!
0 Kudos
Message 12 of 13
(659 Views)
Hi Marce,

The reference to a cluster will only automatically give you the properties to the cluster itself. If you want to access class specific properties for the individual items in the cluster, you will have to know what class they are members of and then typecast the generic control reference to the specific class (see attached ReferenceSub.vi).

You can also use another method for minimizing the connections to the subVI. Bundle the references together and send the cluster of references to the subVI (see attached ReferenceMain.vi). Then you can access the references inside the subVI by simply unbundling the cluster (see attached ReferenceSub.vi).

For all you non-7.1 users: I also attached an image of the ReferenceMain.vi and ReferenceSub.vi in the ZIP file.

Hope this will enlighten you.
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 13 of 13
(636 Views)