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: 

Event structure: only first data node available when wiring a cluster of user event

Solved!
Go to solution

Hello,

 

I'm currently trying to find the best solution to send UI event to a SubVi. after some research the best way seems to be the user events.

I could make a small prototype that works as intended, however, I encounter some issues when trying to unclutter the wires.

 

Firstly, I created a cluster of user events and used this cluster to bundle all my event into a single wire.

I can then unbundle the desired event and work with it. It seems to work fine in most cases except when using the event structure: I can differentiate my cases without problem but only the value of the first one is available to work with.

 

In the linked image, i created 2 user events (A and B) and bundled them. I can use the unbundled events to send it without problem. However if I register to the event with the unbundled reference, I can't access the value of B (only A is available). If a reuse the wires from the event registration I don't have this problem (but in my final application it will become too cluttered).

 

user_event.PNG

 

Can anyone tell me if it is a bug or something that I don't understand properly and how I could solve that ?

 

Best regards,

 

Yannick

0 Kudos
Message 1 of 10
(2,435 Views)

What happens if you make the typedef strict?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 10
(2,417 Views)
Solution
Accepted by topic author YannickB

I am willing to bet you just created one reference (A) and then copied that control when building your type def cluster.  Right-click on your B control in the cluster on your type def.  There is an option to show the control.  If my hypothesis is correct, the control inside of the event will have a label of "A".  Now just edit that label to be "B".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 10
(2,408 Views)

Bundling multiple user events into a cluster doesnt make them a single user event - they are still completely separate events. You access the data from event 1 when an event was fired on the event 1 reference. To get data from event 2, you will need to fire an event on event reference 2. (And create a new event case for that event.)

 

 Edit - I may have misunderstood the problem - Crossrulz is likely right regarding the cause of seeing 'A' in your 'B' event case structure. 

0 Kudos
Message 4 of 10
(2,405 Views)

Can't tell what's wrong.  Post VIs, not pictures.  Pictures can't be debugged.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 10
(2,382 Views)

@crossrulz wrote:

I am willing to bet you just created one reference (A) and then copied that control when building your type def cluster.  Right-click on your B control in the cluster on your type def.  There is an option to show the control.  If my hypothesis is correct, the control inside of the event will have a label of "A".  Now just edit that label to be "B".


This is it ! So simple ... but well hidden.

 

Event if I show the control, I couldn't find any label associated with the control itself and the label of the event was changed. But I created the constant from event B instead of coping and renaming A and it worked as a charm !

 

I wonder though if this reference can be found and changed anywhere.

 

Thanks

0 Kudos
Message 6 of 10
(2,362 Views)

If you right-clicked and went to properties on that constant, didn't the dialog page have a Label entry?

0 Kudos
Message 7 of 10
(2,350 Views)

@RavensFan wrote:

If you right-clicked and went to properties on that constant, didn't the dialog page have a Label entry?


I can see it, but it appears correct. The reference seems to be held elsewhere.

0 Kudos
Message 8 of 10
(2,345 Views)

@YannickB wrote:

Event if I show the control, I couldn't find any label associated with the control itself and the label of the event was changed.


Right-click on the control inside of the User Event control (confusing enough?) and choose Visible Items->Label.  Now you can edit the label and that should update the Event Structure.

 

EDIT:  Just tried to make sure.  It turns out that you cannot edit that label when it is contained in the user event control.  You can copy out the control, edit the label, and drag it back in.  This will update the Event Structure the way you want it to.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 10
(2,334 Views)

yes, it worked. I could see the wrong name doing that.

Thank you !

0 Kudos
Message 10 of 10
(2,327 Views)