Home AMX User Forum NetLinx Studio
Options

Open Popup After Holding Button For Designated Time

Howdy all,

I'm having trouble programming a button event where, after a user holds the button on the touch panel for 5 seconds, I want it to show a popup. Here is what the button event looks like thus far:


BUTTON_EVENT[devPanel,btnRoomControl] //Main - Room Control
{
hold[50]:
{
SEND_COMMAND devPanel,"'^PPN-Room Control'"
on[devPanel,btnRoomControl]
}
}

I've looked at a few other posts regarding similar topics, but none of what was suggested seemed to work. Also- this isn't possible to program in TPDesign, right? I didn't see a way in TPDesign to program a button to show popups after a specific hold time- just instantly after pushing the button. Did I miss a way to do it in there?

The system in question only uses 1 touch panel; an MST-701i.

Any suggestions or input is much appreciated.

Thanks,
Amina

Comments

  • Options

    By syntax, I can't see any error for that HOLD.

    Is the popup name spelled correct, does it really have a space between, and is upper/lower case correct?
    Is the popup opening when doing it in the PUSH or RELEASE section of the button_event ?
    Is the popup opening if doing it by "Control a Device" from Studio?
    Do you get that panel channel (feedback) on after holding the 5 seconds?

    TPDesign internally only allows to open a page on push or release, there is no way to delay the opening within panel design.

  • Options
    akirbyakirby Posts: 9

    Hi Marc- thanks for the reply.

    The popup name appears to be spelled correctly, has the space in between and is upper/lower cased correctly.

    Does HOLD need to be embedded within a PUSH event? At the moment the BUTTON_EVENT I listed above is exactly as it is within my NetLinx code. HOLD doesn't need to be embedded within a PUSH, does it?

    I'm not sure what you mean by the 'doing it by "Control a Device" from Studio' method; I'm still a bit of a newb with AMX programming. Can you elaborate more on this?

    I get the channel button feedback after 5 seconds, just not the popup- so the HOLD seems to be working, just not showing the popup.

    Thanks,
    Amina

  • Options
    HARMAN_ChrisHARMAN_Chris Posts: 598
    edited May 2023

    From the sounds of it, your command to trigger the pop-up is incorrect. Control a Device is a feature within Netlinx Studio under the Diagnostics header of the menu bar. You would enter the device number, port, and system for your panel. Within the large text box, you would enter your command to send and check the radio button for COMMAND (instead of string).

    ^PPN-Room Control

    then click SEND. This test removes your code logic from the equation and is a straight send command to the device to proof the syntax.

  • Options

    Marc means that you can open NetLinx Studio -> Diagnostics -> Control a device and send the ^PPN command as it is sent in your code:

    Essentially that way by-passes your code and sends the command direct to your panel to check if the popup name is spelled correctly...

  • Options
    richardhermanrichardherman Posts: 391

    @akirby said:

    Any suggestions or input is much appreciated.

    Thanks,
    Amina

    >
    The MST-701 is a G4 panel, so use '@PPN-Room Control', not '^PPN-Room Control', that's for G5 panels.
    It will work when you change that

    Richard

  • Options
    akirbyakirby Posts: 9

    Ah- '@PPN-Room Control' did the trick! Thanks again for the help and also for showing me the "Control a Device" tool- that will come in handy in the future for sure.

Sign In or Register to comment.