LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate User Event from a Notifier

Hi!

 

I try to generate a user event from a notifier. Unfortunately, the code that I created doesn't work as expected... and I can't explain why!

Why the notification generated in the second loop is not transmitted through the user event?

 

Thank you in advance for your answers!

 

Gub156_0-1643384236914.png

 

 

Julien

0 Kudos
Message 1 of 6
(2,014 Views)

Your second loop generates a notification.  But nothing in your code captures the notification, and nothing generates a user event.

On top of that, I don't see any point in trying to make your code so convoluted.

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 6
(2,008 Views)

I agree with the "convoluted" comment.  I can't tell what you're trying to do, but I can almost guarantee there's a better (and very likely simpler) way.  Having an event case that includes a potentially infinite wait time makes it clear this hasn't been planned out properly.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 3 of 6
(2,001 Views)

If you look at the input where you have connected the notifier reference to "Create User Event" you'll see that it says "user event data type" instead of user event data. You have to actually generate the user event - it does not detect a change in the notifier.

 

As others have said I'm not sure what you're trying to accomplish, but there is almost definitely a better, simpler way to accomplish it.

0 Kudos
Message 4 of 6
(1,988 Views)

The way you generate a user event is by using the "Generate User Event" function. In this case, your event data is a notifier reference. If you generate a user event (using the event reference), you will feed in a notifier reference and that will come out in the data node of the event structure. You are passing around the notifier reference, not the boolean data as you intended.

 

The simplest thing to do would be to create a user event with boolean data, if that is what you want to pass around.

 

If you are married to the notifier for some reason, you could add another loop which waits for the notification, and generates the user event (with boolean data) when it comes in.

Message 5 of 6
(1,979 Views)

Hi!

 

Thanks for all your answers.

Maybe I should have started with this explanation: this example is a PoC that could be implemented in a much complicated application. As this was not functional, I though it would be easier to find the solution in this PoC instead of the final application.

 

Anyway, I changed the way it works by using user event only, without notification.

 

Thank you for your answers and help!

 

Julien

0 Kudos
Message 6 of 6
(1,922 Views)