LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read Event Handling Loop controls on VI startup?

I am using the Queued Message Handler architecture for an application. Accordingly, the Event Handling Loop (EHL) logs front panel control value changes and sends the appropriate message---typically the NewVal of the control---to the Message Handling Loop (MHL). I require that the MHL receive an value from every front panel control upon VI startup. My approach is to place each control on the far-left side of the block diagram and wire each control to a Val(Sgnl) property node. Thus a Value Change event for each control is generated upon VI startup, and the MHL receives initial values for each control.

 

What I've described above works, but the block diagram gets pretty crowded when I have a large number of front panel controls (See attached screenshot). Is there a more sophisticated way touse the EHL to process front panel controls, but allow for the initial values of the front panel controls to be read and passed to the MHL on VI startup?

 

Much Thanks in Advance!

0 Kudos
Message 1 of 2
(2,581 Views)

I would have a init case where I would do the operations that is performed by firing the events for the 1st time. If you still want to handle the operations in the MHL then I would write all those messages to the Queue (without firing the events) before starting the while loop. So once you start the loop the MHL will process the messages and execute it once. This way you can totally remove the property nodes and keep the controls inside the respective event cases.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 2
(2,539 Views)