From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get name of Cluster in event structure

Hi,

 

I use an event structure. and I have 2 occurences of the same customized control. The customized control is a cluster of two controls.

Therefore I can monitor a value change of the controls in the event structure by looking at Occur1.Control1, Occur1.Control2, Occur2.Control1,  and Occur2.Control2.

Now I use Occur1.Control1 and Occur2.Control1 to trigger an event.

Depending on the triggering occurence I would like to change the value of Control2 in the same occurance.

I.e., if Occur1.Control1 triggers the event -> change Occur1.Control2; if Occur2.Control1 triggers the event -> change Occur2.Control2.

How do I find out if Occur1 or Occur2 triggered the event?

When I take the CtrlRef from the data node in the event structure, it just tells me Control1, but not Occur1.Control1 or Occur2.Control1.

 

Thanks,

Dan

0 Kudos
Message 1 of 11
(3,446 Views)
Dan can you post some sample code?
Herrlin

Just trying to spread the LabVIEW love.
Message 2 of 11
(3,442 Views)
Please see attached.
0 Kudos
Message 3 of 11
(3,434 Views)

Use a "Owner" property from the ref you get back from the event structure (this event is configure to fire on changes to a control inside of the cluster) and use "to More Specific" node to cast the owner ref as a cluster. Then use the "label.Test" of THAT ref (which is now point at the cluster holding your control).

 

Ben

Notice how I used a placeholder reply so I could squeeze out a couple of minutes to the post time.
 
Thanks Bill!
Message Edited by Ben on 04-09-2010 01:18 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 11
(3,431 Views)
You can use the Owner property to get at the cluster. You'll need to convert the refnum to a more specific class. See attached modification.
Message 5 of 11
(3,419 Views)

Use the property node for Owner, cast that to a control to get the label's text.

 

Ahh, the new knight just beat me!

Message Edited by Ravens Fan on 04-09-2010 02:18 PM
Message 6 of 11
(3,409 Views)

Another option.  You could make two event cases.

Message Edited by herrlin on 04-09-2010 02:20 PM
Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 7 of 11
(3,399 Views)

Another option.  You could make two event cases.

Herrlin

Just trying to spread the LabVIEW love.
Message 8 of 11
(3,398 Views)
Anyone know if there is away to delete a post?  Didnt mean to post twice.
Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 9 of 11
(3,395 Views)
Great. Looks good. What is the cleanest way to write to Control2 of the same Occur?
0 Kudos
Message 10 of 11
(3,393 Views)