rrojas Posted November 15, 2004 Report Share Posted November 15, 2004 I have thirty-eight (38) controls on my front panel that I wish to be able to access, and change particular vaues of, in a sub-VI. What I am doing is creating references for each of the controls on my main VI. Then I am creating controls for each reference and putting each of these reference controls into a cluster. Then I created a reference to that cluster or reference controls and fed that reference into my sub-VI. I then used a property node to extract the "value" of this reference, which is a cluster. Then I use Unbundle by Name in order to select a particular control reference. I feed this reference into a new value property node to attempt to change its value, but at this point LabVIEW tells me that the object reference is invalid. Am I going about this the right way or is there a better way to do it? The image of my sub-VI and the place where I get an error message is attached. Thanks in advance. Quote Link to comment
didierj Posted November 16, 2004 Report Share Posted November 16, 2004 I think you're making things much toooooo complicated. To modify the content of a control in a sub-vi, just create a reference from the control and feed it to the sub-vi. In the sub vi, use this ref to modify the value/property. In your example add a bundle before the sub-vi, feed the cluster to the sub-vi, and in the sub-vi unbundle your cluster. Didier Quote Link to comment
rrojas Posted November 16, 2004 Author Report Share Posted November 16, 2004 I think you're making things much toooooo complicated.To modify the content of a control in a sub-vi, just create a reference from the control and feed it to the sub-vi. In the sub vi, use this ref to modify the value/property. In your example add a bundle before the sub-vi, feed the cluster to the sub-vi, and in the sub-vi unbundle your cluster. Didier 2653[/snapback] I tried that, but I still get an invalid object reference when I unbundle-by-name and feed the reference into the property node. But just to make sure you and I aren't thinking about different things, what exactly is entailed in making a cluster out of these references? In my block diagram when I created a reference for each of the controls, I was unable to wrap a cluster structure around them. I had to create controls for each reference, which then appeared on the FP, and then I was able to jam these controls into a cluster. Is there a way I can directly stick the references into a cluster on the block diagram? Quote Link to comment
Michael Aivaliotis Posted November 17, 2004 Report Share Posted November 17, 2004 I tried that, but I still get an invalid object reference when I unbundle-by-name and feed the reference into the property node. But just to make sure you and I aren't thinking about different things, what exactly is entailed in making a cluster out of these references? In my block diagram when I created a reference for each of the controls, I was unable to wrap a cluster structure around them. I had to create controls for each reference, which then appeared on the FP, and then I was able to jam these controls into a cluster. Is there a way I can directly stick the references into a cluster on the block diagram? 2665[/snapback] You have to use the bundle function on the diagram and wire each control reference control into the bundlw function. I think the problem occurs when you grab the controls and put them into the cluster. You must do this programmatically as I state. Quote Link to comment
didierj Posted November 17, 2004 Report Share Posted November 17, 2004 In my block diagram when I created a reference for each of the controls, I was unable to wrap a cluster structure around them. I had to create controls for each reference, which then appeared on the FP, and then I was able to jam these controls into a cluster. 2665[/snapback] As Michael stated, wire the references to the "bundle" not "bundle by name". Now on the output of the "bundle" right click and create a control. You directly get a correct cluster-control on your front-panel thich you can copy-paste to your sub-vi. Afterwards just delete the control on your main-vi, since it's not used anymore. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.