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.
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.
07-17-2018 08:11 AM - edited 07-17-2018 08:12 AM
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).
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
Solved! Go to Solution.
07-17-2018 09:57 AM
What happens if you make the typedef strict?
07-17-2018 10:17 AM
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".
07-17-2018 10:23 AM - edited 07-17-2018 10:28 AM
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.
07-17-2018 02:47 PM
Can't tell what's wrong. Post VIs, not pictures. Pictures can't be debugged.
07-18-2018 01:45 AM
@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
07-18-2018 07:00 AM - edited 07-18-2018 07:02 AM
If you right-clicked and went to properties on that constant, didn't the dialog page have a Label entry?
07-18-2018 07:23 AM
@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.
07-18-2018 08:02 AM - edited 07-18-2018 08:06 AM
@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.
07-18-2018 08:07 AM
yes, it worked. I could see the wrong name doing that.
Thank you !