Home AMX Forum AMX General Discussion
Options

TP-buttons

Hello all
I was wondering if there is a quick trick to turn the channel off for a range of buttons on a touch panel.ie from button 150 to 159.

Comments

  • jjamesjjames AMX Sustaining Engineer
    You could use a FOR loop.
    DEFINE_CONSTANT
    INTEGER nButtonRange[] = {150,151,152,153,154,155,156,157,158,159}
    
    FOR(nLoop = 1;nLoop<=LENGHT_ARRAY(nButtonRange);nLoop++)
    {
      IF(nSomeCondition) // some condition
        ON[dvTP,nButtonRange[nLoop]]
    }
    
    I'm sure you've already thought of this - but . . . that's how I would do it (maybe). Not sure if there is a way to group buttons / channels together. You would think that it *should* be like a DEV array, where you could send a command to all panels such as SEND_COMMAND dv_TP, "'@PPX'". Who knows! I don't think that's the case though.
  • mpullinmpullin Obvious Troll Account, Marked for Deletion
    The Netlinx Keyword help for OFF suggests that the channel parameter can be an array. Try OFF[dvTP,nButtonRange]
  • Thomas HayesThomas Hayes Junior Member
    thanks guys, I'm so brain dead from jamming code I can't even think up something as simple as to turn a relay on.
  • MathieuMathieu Junior Member
    could try that
    DEFINE_MUTUALLY_EXCLUSIVE
    ([PANEL,150]..[PANEL,160])
    
    ...
    
    On[PANEL,160] // all buttons from 150 to 159 go off ... 
    

    it could be a solution if the 160 button is not used, and if there no other mutually exclusive order
  • octothorpeoctothorpe Junior Member
    Simply turning on an array works.
    You could populate this integer array with specific events that are happening so that it's contents always varied if need be.

    INTEGER_ARRAY_BUTTONS[] = {159,160,161,162,163,164}

    BUTTON_EVENT[dvTP_12INCH,1]
    {
    PUSH:
    {
    ON[dvTP_12_5,INTEGER_ARRAY_BUTTONS]
    }
    }
Sign In or Register to comment.