Creating A Password for a Pushbutton in Edge Vision

Hi all,

I am trying to figure out how I can bind a password to a pushbutton in Vision only. So far, I know I can bind a tag (the password in this case) to the enable/disable of a pushbutton. However, I do not know how I can script the pushbutton to accept and check a user entered password. Does anyone have any advice or know how to accomplish this? I am using Ignition Edge 8.1.10.

The function of the system should also be as follows. A password needs to be entered and accepted in order for the pushbutton to be enabled.

Cheers,

Alex

One approach would be to create a password entry field and a submit button, then validate the password something like this.

if event.source.parent.getComponent('passEntry').text == "password":
	event.source.parent.getComponent('Button 1').componentEnabled = 1
else:
	event.source.parent.getComponent('Button 1').componentEnabled = 0

This is a very basic example and does not mask or clear your entered password after you type it in.

Either use system.gui.passwordBox() or add role-based security to the button

1 Like

Oh that’s great, i didn’t know about system.gui.passwordBox().

Thanks mates!

I do like the idea of using system.gui.passwordBox. So with that, once the pushbutton is pressed, the popup would appear to enter the password. The password gets entered and then I am thinking I could use the system.nav.openWindow(“new_screen”) to open a new screen that has the 2 pushbuttons connected to the tags that are actually controlling something in the PLC. Then once they close the popup, they would have to enter the password in again in order to get back to that screen. What are your thoughts? Like that’s how it would work if I used this sample code right?

password = system.gui.passwordBox(“Please enter the password.”)
if password == “open sesame”:
system.nav.openWindow(“new_screen”)

Also, this code would go in the script of the component right?