LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Front panel objects not responsive

Solved!
Go to solution

Hi All,

 

I have a VI that has some front panel objects that are no longer responsive. Front panel objects are enabled and never get disabled. I am not sure why and everything seems to check out on the block diagram. I know the program is operating because my task states are triggered. Any thoughts or insights would be greatly appreciated.

 

Thanks in advance,

 

Anton

0 Kudos
Message 1 of 8
(4,413 Views)

I looked at it.  So big.  So messy.  I couldn't figure out how to make myself care about it.

Your best bet is probably to start over.  Probably a producer/consumer and/or state machine architecture would suit your needs.  Also, be sure to use subVIs where appropriate in order to have cleaner block diagrams.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 8
(4,407 Views)
Solution
Accepted by atrinh

Just as I thought.

 

Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help

 

You have an event structure buried in a loop in a case structure.  It has an event for Mouse Move (that is going to happen all the time in your VI!), and it is set to Lock the Front Panel until event is complete.

 

Well, if your line of execution doesn't have you in that while loop in that case, you have no way of getting to it because it will lock your front panel up cold.

 

Don't bury event structures in cases.

Message 3 of 8
(4,404 Views)
Solution
Accepted by atrinh

@RavensFan wrote:

Don't bury event structures in cases.


Technically, don't bury *statically registered* event structures in cases. It's perfectly valid to dynamically register for an event inside a case, then unregister for it within the same case. Not that I recommend that for the OP, as this doesn't come up super often, just being pedantic 😉

Message 4 of 8
(4,379 Views)

True.  But the people who use dynamic events probably know how to use event structures properly.

The people who get stuck on hung up front panels because of the annoying default of "Lock front panel" probably don't even know dynamic events exist since they don't even know about the "lock front panel" setting.

 

Another adage is to not have multiple event structures in a VI.  Actually you can.  I have several projects where I do that.  But until you know what you are doing, don't put multiple event structures in a VI.

Message 5 of 8
(4,348 Views)

Thanks for the insight. It never occurred to me the Event structure was running and hanging up my program. A quick disabling of that case allowed me to work with the front panel objects. I took a stab at the Dynamic Event Registration (do you ming looking at the sample VI); this is useful to me because I want to initialize the "task" state but not collect any data until the user moves the cursor. I then want to cap the collection at X ms and go back to an "idle"/"wait" state. I apologize for the large code previously. I am adapting another colleague's code and they generally throw everything into one giant while loop 🙃

0 Kudos
Message 6 of 8
(4,308 Views)

And to add, when dynamically registering an event for a UI element (the unholy combination of dynamic and static), the "Lock UI" flag is available only via right-click menu of the "register for Events" node.

 

Took me years to find that one out.

Message 7 of 8
(4,294 Views)

@Intaris wrote:

And to add, when dynamically registering an event for a UI element (the unholy combination of dynamic and static), the "Lock UI" flag is available only via right-click menu of the "register for Events" node.

 

Took me years to find that one out.


Thank you Intaris.

I have been working with LabVIEW for more than 14 years and did not know that.

UliB

0 Kudos
Message 8 of 8
(4,279 Views)