LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an event based on a control reference?

Solved!
Go to solution

Hi,

 

I have a GUI displayed to the user with several control elements. This VI is amost exclusively to display data and the decisions are made in the process control VI (PC.vi).

 

To easily update the GUI.vi controls and indicators I passed the control references to the PC.vi. This works pretty well (ignoring the fact that it not clear for the first sight where the data is coming from) but at a given point my PC.vi should wait for a button press on the GUI.vi. The PC.vi has the reference to the button(s), but is it possible to create an event structure event from a reference? (note that I'd like to have the event structure in my PC.vi and not in the GUI.vi otherwise I could just use the signaling property)

 

The second question is: how would you solve this problem cause however using the references in the PC.vi works well, I'm not convinced that its the best way. (First I used events so the PC.vi updated the GUI.vi using events the problem with this is that it doesnt make the code much cleaner since its still not very clear where the data was coming from and I had the same problem that my GUI.vi needs to know about some button presses. I can create events going the other way (GUI to PC), but that again adds complexity.)

 

Thanks.

0 Kudos
Message 1 of 2
(496 Views)
Solution
Accepted by topic author 1984

Hi 1984,

 


@1984 wrote:

The PC.vi has the reference to the button(s), but is it possible to create an event structure event from a reference?


You can register for events by using the RegisterEvents function. Then wire the EventRegistration to the DynamicEvents input of your event structure:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(494 Views)