TP Password-Protected buttons


I need to program a system that sequencially starts some devices in specific time intervals. this project is pretty standard, and it has some particular things:

1) the main page should only contain 2 Password-Protected Buttons: ON and OFF.
2) while the devices are starting, both of these buttons should be blocked (greyed out), so the user cannot push them while starting/stopping.

i have some questions:

1) how can i set these buttons to be Password-protected? i read that i should use the Setup port/advanced channel code/Panel setup/password # Set , but i haven't used this before and i don't know how to do it this way.

2) how can i set these buttons to be Greyed out until the system finishes the sequence?

Thanks in advance for the help.


  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,152
    there are quite a few things to unpack here. Firstly, I would probably do all of it from code myself, not TP design. (That's just my preference) I would create a tracking variable that would tell the program when it is okay for the user to hit the button or not. I would then encase all the code that does something when the button is pressed within an IF statement with the "Can they hit the button" variable - thus making the program ignore the button hit during those times when they aren't supposed to hit it.

    Next, I'd have the button hit bring up the keypad/keyboard for the user to enter the password. I'd create another flag variable to indicate that the user is going to enter a password. then when I get the string from the panel with the proper pasword, I'd check against the flag, and if the flag is high, I'd do whatever the button press is supposed to do. (power on/off/etc...) Then reset the flag to zero.

    Thirdly, I'd also send the ^BMF command to make the button greyed out. (Perhaps Opacity to 50% or change the color) when the tracking variable is set to "don't allow user to hit" then set it back to normal when it goes to "safe to hit the button"
  • DraugarDraugar Junior Member Posts: 25
    Roughly soumething like this is what I would have done

    button event dvTP
    integer i =
    send_command dvTP "Open keypad"

    data event dvTP

    IF(find:string(data.text, 1234))
    send_command dvTP, "set button i = opacity 50%
    send_command dvTP, "set button i = disabled"

    wait 600
    send_command dvTP, "set button i = opacity 100%
    send_command dvTP, "set button i = enabled"
  • jrodriguez15jrodriguez15 Junior Member Posts: 4
    ok, makes sense. i am using a timeline event for the ON and OFF sequences, i think i will use the opacity and disable/enable commands inside it.

    i like This password method. maybe i can make a popup page to appear in case the user does not use the correct password.

    Thanks guys
Sign In or Register to comment.