11-17-2015 12:29 PM
Hello,
I'm using an "Enum Control" on Front Panel of an executable application built with application builder of LabVIEW 2013 full professional development system. I want Enum Control to remain enabled before execution of that application so that I can select any value from the available list of numerical values, but when I run that application; Enum Control should become disabled so that user can not select any other value from the list of given values while application is running so that pre-selected value remain unchanged during execution of that application. Enum Control should also become enabled when application is stopped/aborted so that user can select any value.
Could anyone pls suggest a solution to this problem? If I select Enabled state" to "Disabled" from Appearence tab then all listed values become disabled.
Regards
Jamal
Solved! Go to Solution.
11-17-2015 12:40 PM - edited 11-17-2015 12:41 PM
Hi Jamal,
This is how you disable and enable a control (grayed out is a preference of mine, so the user doesn't think something is frozen up):
However, there is certainly a better way to perform user interface interlocks. It may take a little more effort, but a good application should close when the user stops it, and the user should not have to use it in a sort of "developer" mode. If you are running a test, you can have the the Enum grayed out when the user hits "Start Test" and have it enabled again when the test completes, for instance.
11-17-2015 12:44 PM
I would suggest using the Disabled property node. You can then disable the enum at the start of the program and then enable it as part of the shutdown.
11-17-2015 01:01 PM
Thank you for response. I am using Enum Control inside a case structure which is nested in the while loop. Could you pls explain the purpose of wait function used in the 2nd frame of flat sequence structure? Could you pls suggest " better way to perform interlocks on controls of the front panel of an executable application".
Regards.
Jamal
11-17-2015 01:05 PM - edited 11-17-2015 01:06 PM
The wait function was just so that you could see it disable for a second and then enable again (to simulate your program running). Generally I avoid sequence structures unless error wires are unavailable.
If your program is working for you, then you can stick with that for now. When you want to look into creating more responsive user interfaces, you can research the event structure, which you can tell to respond to different events. The events can be a button press, for instance, so that something happens as soon as the user presses a button.
11-17-2015 01:05 PM
Thank you for response. I mean when I run executable application; Enum Control automatically become disabled, and when I stop/abort application; Enum Control become enabled so that I could select any of its given values.
Regards,
Jamal
11-17-2015 01:10 PM
Yes, then you will want to put the disable at the beginning of your diagram (often far left), and the enable at the end. The sequence structure is one way to do this. You would make it larger and put your program inside the middle frame. A better way is to take the error wire from the property node and wire it to your while loop (which I understand keeps your entire program running). You would want the "enable" property node to wait for an error out from your while loop, but then right click the property node and select "ignore errors..." to make sure the property node executes.
11-17-2015 01:10 PM
I want to keep Enum Control disabled as long as application is in running, and I want to keep it enabled as long as I do not hit run button to run application.
Regards,
Jamal
11-17-2015 01:12 PM
11-17-2015 01:13 PM - edited 11-17-2015 01:27 PM
As I mentioned in my previous reply; I am using Enum Control Inside the case structure which is nested within the while loop. So the Enum control is also inside the while loop. Could you pls suggest how to do that?
Thanks for response.
Regards
Jamal