VI High 2 (2 of 2): Enhance User Interface Usability through Disabling and Enabling Front Panel LabVIEW Objects
The promised second part…
Experience Level: Basic
“Oh, welcome back. Now as I run this VI I can see that before I run the test, as before I can change these controls. But when I run the test and the test is running I can’t change them until the test is finished and they are re-enabled.
Looking at the block diagram, we can see that I just used the property node for the other controls, and passed the same constant to them. I use the Run Test button to stop the loop that was polling the Run Test button, gathered together the error clusters, and use the error cluster to determine execution order. In this case I say the test is running for three seconds, and when it’s finished I use a dialog box to say so, and then re-enable these controls and check back for errors.
I’ve made this architecture very simple to clearly show what’s happening. But this may be better served in a state machine with the idle case waiting on the Run Test to occur, with a separate state to return and re-enable the buttons. If the idle state is only waiting on user interface actions, we would do well to put an event structure in there.
Well that’s it for this episode, but in the next episode we’ll answer a question which may have already come screaming into your mind: Isn’t there an easy way to modularize what I’ve done, and access the same disable properties on all of these objects, instead of using three separate property nodes here and here? There is indeed a way using references, refnums, and explicitly linked property nodes. We’ll take a look at that next time.”