Home AMX User Forum NetLinx Studio

Keypad on panel

If i create a keypad that I want to use to store number data would it look like this?

DEFINE_EVENT
Button_Event[dvPanel,100]
{
Push:
{
SEND_COMMAND dvPanel,"'AKEYP'"
{


}
}
}

This pops up my keypad but how do i store each button i hit on the keypad as a variable?

Buttonpushes = (Get_last,buttonpushes)

1
14
147
1478
14789
etc...

?

Comments

  • Spire_JeffSpire_Jeff Posts: 1,917
    You need to create a data_event for the touch panels on port 1. The numbers entered with the keypad will be sent as a String: event from the touch panel. The format of the text will be KEYP-###### where the #s will be the numbers entered.

    Once you have the text, you can break it apart as needed of convert it to numbers using ATOI or similar.

    Jeff
  • davidvdavidv Posts: 90
    Keypad issue

    Is this correct?

    DEFINE_EVENT
    BUTTON_EVENT[dvPanel,69]
    {
    Push:
    {
    SEND_COMMAND dvPanel,"'AKEYP'"
    }
    }


    Data_Event[dvPanel]
    {
    Online:
    {
    Wait 25
    Clear_Weather_Data()
    }
    STRING:
    {
    LOCAL_VAR CHAR cBuffer[10]
    cBuffer = DATA.TEXT
    SELECT
    {
    ACTIVE (FIND_STRING(cBuffer,'KEYP',1)):
    {
    REMOVE_STRING(cBuffer,'KEYP-',1)
    ZIP_NUM = ("cBuffer")
    cZip = ZIP_NUM
    }
    ACTIVE (FIND_STRING(cBuffer,'KEYB',1)):
    {
    REMOVE_STRING(cBuffer,'KEYB-',1)
    }
    }
    }
    }
Sign In or Register to comment.