Ignition 8 Password enabled button


I am just feeling my way with Ignition 8. I need a login button, that brings up a number pad to enter a 6 digit code. Once the correct password is entered a button will be enabled to change the status on each press between cleaning mode or available. Can someone give me a clue how I start to do this.

Thanks Laurie

It might help to clarify whether you are using Vision or Perspective to accomplish this.

Perspective is what I am using.

Okay, I can help with that.

Your example is a little unclear as to how you want items arranged and what buttons need to be in what Views, but this process should get you on your way:

  1. Before creating any Views, click the gear icon present in the Perspective workspace context toward the bottom of the Designer in the central panel.
  2. If you don’t see a panel called the “Perspective Property Editor”, use the Designer menu to open it, and scroll down to the bottom of the editor so that you can see SESSION CUSTOM.
  3. Click the “Add Custom Property” and select “value”.
  4. Right-click the “key” and supply a key name of “cleaningAvailable”.
  5. Click into the accompanying value area and set the value to “false”.
  6. Create two Views, “ViewMain” and “NumPadPopup”.
  7. In ViewMain, place a Button component.
  8. Right-click the Button and select “Configure Events…”.
  9. Select the onActionPerformed Event.
  10. Click the “+” icon, and then select the Popup Action.
  11. In the “Select View” dropdown, select the NumPadPopup View.
  12. Set the Identifier field to a value of “NUMPADPOPUP”.
  13. Set the Title to whatever you want.
  14. Click OK to save the changes.
  15. Place a second button which will be your cleaning/available button.
  16. On this new button, set props.enabled to value of “false”.
  17. (I’m going to take tis opportunity to push the Ignition Exchange because I have personally already made a keypad available for public use).
  18. Select the NumPadPopup View.
  19. In the property Editor, add a new custom property and provide it a key of passcode and a value of an empty string (just delete the value it has right now).
  20. Now, in NumPadPopup, place 1 button.
  21. Set props.text to a value of 0.
  22. Right-click the Button and select “Configure Events…”.
  23. Use the onActionPerformed Event again, but this time select the Script Action.
  24. Use the following code for the script: self.view.custom.passcode = str(self.view.custom.passcode) + str(self.props.text)
  25. Now copy this button nine times, and be sure to change the text of each button to be the next number (so that you have 0-9)(You do NOT need to change the script at all).
  26. Place two more buttons, and set their text properties to be “Clear” and “Enter”.

From this point, you only need to do three things, and how you do them is up to you:

  1. The clear button will need a script which uses the following script: self.view.custom.passcode = ''.
  2. The Enter button will need a script which compares the current passcode (self.view.custom.passcode) against the expected passcode (I don’t know if this is project or user specific, or even where you’re storing this value).
  3. The Enter button will also need two more lines of code which should be invoked ONLY if the passcode matches the expected value:
self.session.custom.cleaningAvailable = True  # make sure "True" is capitalized here!
system.perspective.closePopup(id='NUMPADPOPUP')  # make sure this is al caps to match what you set earlier!

Hi, i am also struggling to get a password setup for button that can allow anyone to move some manual motions. I am using Vision and have already created all pages in ignition softwares. I just need something to prevent someone from going into manual motion screen without login. Can you please help me out with that ?