09-19-2023 01:33 AM
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.
Solved! Go to Solution.
09-19-2023 01:43 AM - edited 09-19-2023 01:44 AM
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: