Follow the steps from the picture below to create the program :
In the Front panel, create three control button :
- Numeric control : Control button that need to be protected
- Boolean control : Unlock button to be able to enter the password to enable changing the value of numeric control
- Boolean control : Stop button to stop the program
In the Block Diagram :
- Create a Flat Sequence Structure, then right click on the numeric control button in the Front Panel that need to be protected, select Create >Property Node >Disable. Then, right click on the Disable property node and select Create >Constant. Select Disable on the constant to disable the numeric control from changing value when the program runs.
- Create a While Loop and and Event Structure inside the While Loop. For the Event Structure, create two event for blank button (unlock button) and stop button. Right click on the Event Structure, select Add Event Case and add Value Change event for both numeric control and stop button.
- To make a dialog box to enter the password, find the Prompt User for Input Express VI and enter the following information like the picture below :
- Wire the password that need to be match to the equal function and connect it to the case structure.
- In the true case structure, create another Disable property node and connect it to enable constant. If the password enter is correct, the numeric control will be enable and you can change the control button value.
- Lastly on the stop event, wire the stop button to stop the program if the button is pressed.