Home AMX User Forum NetLinx Studio

Modules & non required channels - correct convention

I have a module that requires about 60 input channels specified in an array for the relevant touchpanel buttons, which is common practise.

However, the module provides significant functionality above what i actually require so do not want to have 60 buttons on the touch-panel when only a handful of them will ever be used. When creating the array for the input channels, what is the safest way to code for the 'missing, non-required' channels?

hope that makes sense!

Comments

  • Is this a pre-packaged module? Sometimes there is a "NO BUTTON" option. I think the "NO BUTTON" number is 256 or something like that. Definitly do not want to use a 0. I took the pre-packaged Tandberg MXP modules and removed all of the "fluff" that we don't use. For that, I just had to make sure the buttons I wanted to use matched up with their proper place in the array. A little tweaking of the Tandberg UI solved that problem. Can't remember everything word for word, but all I had to do was declare an array of buttons, something like:
    INTEGER nTandberg_Buttons[] = {x, x, x, x, x, etc}
    
    And in the UI:
    
    BUTTON_EVENT[dvTP, nTandberg_Buttons]
    {
        PUSH:
        {
              nButton_Index = GET_LAST(nTandberg_Buttons)
              SWITCH(nButton_Index)
              {
                     CASE 1: 
                     {
                          Do Something
                     }
                     CASE 2:
                     {
                         Do Something
                     }
              }
        }
    }
    

    Don't know if that helps or not.
  • hodeyphodeyp Posts: 104
    thanks, it does help although I was trying to find a way of not having to rewrite the UI module. Sounds like the safest option though if there is no way of not declaring a button for unwanted functionality.

    thanks!!
  • AMXJeffAMXJeff Posts: 450
    Create one button on the TP that is considered a Button that is never used. You will have to also compare if the channel is the "NO_FUNCTION_BTN" in your feedback section. Because alot of traffic will happen to turn on and off that channel multiple times each pass of mainline. So an if will need to be used to force stop feedback.
    DEFINE_CONSTANT
    
    NO_FUNCTION_BTN = 4000;
    
    DEFINE_VARIABLE
    
    INTEGER nTandberg_Buttons[] = 
    {
       100, 
       101, 
       NO_FUNCTION_BTN, 
       103, 
       104
    }
    
    DEFINE_EVENT
    
    BUTTON_EVENT[dvTP, nTandberg_Buttons]
    {
        PUSH:
        {
             IF (BUTTON.INPUT.CHANNEL != NO_FUNCTION_BTN)
             {
                nButton_Index = GET_LAST(nTandberg_Buttons)
                SWITCH(nButton_Index)
                {
                     CASE 1: 
                     {
                          Do Something
                     }
                     CASE 2:
                     {
                         Do Something
                     }
                 }
             }
        }
    }
    
    DEFINE_PROGRAM
    
    IF (nTandberg_Buttons[1] != NO_FUNCTION_BTN)
        [dvTP, nTandberg_Buttons[1]] = (SOMETHING = SOMETHINGELSE)
    
    
Sign In or Register to comment.