Home AMX User Forum NetLinx Studio

Can DEVs be Included in DEVCHANs?

DEV dDSET[]={dvDEV1,dvDEV2}
DEVCHAN dcDCSET[]={{dDSET,1},{dDSET,2}}
....Or something to that effect?

This is for the sake of generating feedback for groups of buttons on multiple UIs without combining so that I can still know from which device a PUSH came from.

Thank you.

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    No, you can?t stuff a DEV[] array into a DEVCHAN. It doesn?t fit. A DEVCHAN is a container (a data type/structure ? a block of memory) that only has enough room to hold one DEV and one INTEGER. You can have a DEVCHAN[] array (a bunch of these containers) but each item in the array has to be one DEV and one INTEGER (one DEVCHAN.)

    I don?t use DEVCHANs myself (not that there is anything wrong with them) but instead I opt to keep the DEVs separate from the channels/buttons and do something like this.
    DEFINE_DEVICE
    
    dvTP1	= 10001:1:0
    dvTP2	= 10002:1:0
    
    DEFINE_CONSTANT
    
    INTEGER nButtons[]	= {2,4,6}
    
    DEFINE_VARIABLE
    
    DEV 	dvTPs[]	={dvTP1,dvTP2}
    
    DEFINE_EVENT
    
    BUTTON_EVENT[dvTPs,nButtons] {
    
       PUSH: {
       
          //to find out which device generated the push you can use
          //BUTTON.INPUT.DEVICE
          
          //or to find out the index into the array of devices you can use
          //GET_LAST(dvTPs)
    
          //to find out which button was pushed you can use
          //BUTTON.INPUT.CHANNEL
          
          //or to find out the index into the array of buttons you can use
          //GET_LAST(nButtons)
          
       }
    }
    

    HTH
  • TurnipTruckTurnipTruck Posts: 1,485
    Nice! I like the method you are using.

    Thanks for the info! It's well worth the cost of admission to these forums! :)
Sign In or Register to comment.