11-24-2008 01:20 PM
I can only guess that your event is configured to fire on any change of teh cluster so the ref you are getting back is a ref to the cluster and not the booleans inside the cluster.
You could configure the event to just fire of any of the booleans inside the cluster (done while configuring event structure such that it has as many events as there are booleans in the cluster, which is what I suspect is happening inside Ton's example only he is doing it dynamiclly.
Another approach would use an event for the cluster changing but when it does, compare the old an new values to see whcih boolean changed and thenuse a "Controls[]" from the cluster to select the element that changed AND THEN cast it as a boolean to get its name.
Ben
11-24-2008 01:24 PM
Without the actual code I am unsure how this happens.
The event I made was registered to the Cluster\AllControls value change event.
I know in earlier version of LabVIEW (7.x??) it is not possible to register for sub-cluster elements.
Ton
11-24-2008 01:30 PM - edited 11-24-2008 01:30 PM
This image illustrates my previous described approach.
Ben
11-24-2008 01:36 PM
TonP had the right idea, the problem was that the control reference coming out of the Event structure is pointing to the cluster, not the controls within it. Bob's method is also spot on but we can do one better because we have all the indices we need for the controls that have been pushed thanks to the OpenG search 1D array. This will give you what I think you're looking for.
11-24-2008 01:37 PM - edited 11-24-2008 01:38 PM
Sorry my bad,
I assume that is was possible to register for value change events for all the controls inside a cluster.
It seems this is only possible in a way comparable to my previous example.
Ton
11-24-2008 01:46 PM
TonP,
That is a terrific idea, I did not know you could do such a thing. I'm going to be adding that to my bag of tricks, thanks!
11-24-2008 01:57 PM
11-24-2008 02:15 PM - edited 11-24-2008 02:21 PM
Yes, there is a screen capture there. Thats odd you cant see it because it comes up fine for me and when I throw the link into the browser, the picture comes up. Anyway, although my method works nicely, TonP was nice enough to give us a new method by registering for dynamic events. This method is alot more flexible. I decide to throw all the ideas together in this attached VI. It will give you 3 ouputs of which you may or may not want to use all of them. TonP will have to be nice enough to tell us how he got the Boolean property node to be of strict type so that we don't have to use the 'Varient to Data' VI. Nevermind, I figured it out. Apparently you just need to pick off a Reference from one of the Booleans inside the cluster and use that on the "To More Specific Class" VI. The attached VI now includes this.
11-24-2008 02:29 PM
SiegeX wrote:Yes, there is a screen capture there. Thats odd you cant see it because it comes up fine for me and when I throw the link into the browser, the picture comes up.
Your original screenshots came up okay for me also. But I see that you had them on some 3rd party web server. Don't do that. Always attach your images to your message, then insert the image links to the location on the NI discussion forum location. Otherwise some people who might have that website blocked by their company firewalls won't be able to see it. Or who can guarantee that website will still exist 5 years from now if someone comes across this message and want to see what you were talking about.
11-24-2008 02:33 PM - edited 11-24-2008 02:34 PM
Ahh, yes that makes alot of sense, I originally just attached them and assumed it would also pop-up on the thread but it did not. I just assumed people were using 3rd party sites to host them so I did the same. Your method of pointing back to the NI server is a superior way of doing that, but that requires editing the message after the fact does it not? Or is there an easier way to figure out the URL of the image before submitting.
Here is the same picture but hosted on NI's site for all to see.