LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference Functional Global Variable

Solved!
Go to solution

Hello Crossrulz,

 

can you give me a sample code for this benefit "Another benefit of the User Event is that you may find another process that needs that data and all you will have to do is register for that User Event.  Every place that is registered for the event will see it"

 

regards!

0 Kudos
Message 21 of 25
(1,886 Views)
Solution
Accepted by alre

alre wrote:

can you give me a sample code for this benefit "Another benefit of the User Event is that you may find another process that needs that data and all you will have to do is register for that User Event.  Every place that is registered for the event will see it"


Here is a snippet showing the function.  I have plenty of applications that actually use this.  The easiest example I can think of is I have a module for reading data from an instrument.  I have another module that processes that data for whatever the application needs to do with it.  Along comes a requirement to log all of that read data.  So I have to make a logging module.  Since I used User Events, I do not have to create another resource for passing the data. I just register for the Read Data Event and log it when I get the event.

 


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 22 of 25
(1,872 Views)

gregoryj wrote:

And for anyone: Where do you destroy the events? It seems a good place would be at the end of the VI that is generating the event, but I was wondering if anyone had a different preference. One use case where the Event seems simpler than a Message Queue would be stopping a program with many parallel processes. With one project I have 7 different instruments so I send 7 "Exit" messages, with the event it is just generating a single Exit event. Thank you all for your help!


Depends on the purpose of the event.  But most commonly, I destroy the event as the very last thing an application does.


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 23 of 25
(1,865 Views)

Thanks! I have understood

0 Kudos
Message 24 of 25
(1,851 Views)

me too

0 Kudos
Message 25 of 25
(1,664 Views)