Home AMX User Forum AMX General Discussion

EVENT TABLES

This is an extension of: http://amxforums.com/showthread.php?t=3746&highlight=EVENT+TABLE but I'm starting a new thread just for the discussion of event tables.

Since I was curious as to how they actually worked and their limitations I decided to run some test to see what happens.

First for those that aren't aware an event table is limited to a max 4000 triggerable events, channels, levels, button event...... So in a button event for instance you can have a TP port 10001:1:0 w/ up to 4000 buttons. If you create a TP array you're limited to the number of TPs in the array * number of buttons must be <= 4000. A TP array with w/ 10 TPs that use 400 (or less) buttons is fine but any buttons over say button 401 won't work.

The code used for testing:
DEFINE_CONSTANT

ETABLE_NUM_BUTTONS		= 1200 ;

DEFINE_VARIABLE

PERSISTENT INTEGER nTableEvent_DeBug = 1 ;

VOLATILE INTEGER nTECurHoldTPIndx ;
VOLATILE INTEGER nTECurHoldBtn ;
VOLATILE INTEGER nTEHolding ;

VOLATILE INTEGER nETableBtnArry[ETABLE_NUM_BUTTONS] ;

DEV dvEventTableTPArry[] = {dvTP1_EventTable,dvTP2_EventTable,dvTP3_EventTable,dvTP4_EventTable,dvTP5_EventTable,dvTP6_EventTable} 

DEFINE_FUNCTION fnTableEventDeBug(CHAR iStr[])

     {
     if(nTableEvent_DeBug)
	  {
	  SEND_STRING 0,"'TABLE EVENT:  ',iStr,CRLF" ;
	  }
	  
     RETURN ;
     }

DEFINE_START  //initialize button array

     {
     STACK_VAR INTEGER i ;
     
     for( i = 1 ; i <= ETABLE_NUM_BUTTONS ; i ++)
	  {
	  nETableBtnArry[i] = i ;
	  }
     SET_LENGTH_ARRAY(nETableBtnArry,ETABLE_NUM_BUTTONS) ;// not really needed
     }
     
DEFINE_EVENT //TP/ARRAY

BUTTON_EVENT[dvTP1_EventTable,nETableBtnArry] 
BUTTON_EVENT[dvTP2_EventTable,nETableBtnArry]
BUTTON_EVENT[dvTP3_EventTable,nETableBtnArry]
BUTTON_EVENT[dvTP4_EventTable,nETableBtnArry]
BUTTON_EVENT[dvTP5_EventTable,nETableBtnArry]
BUTTON_EVENT[dvTP6_EventTable,nETableBtnArry]     
                
     {
     PUSH:
	  {
	  STACK_VAR INTEGER nTEBtn ;
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTEBtn = GET_LAST(nETableBtnArry) ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'PUSH: TP-',itoa(nTETPIndx),', tp/array, GET_LAST btn-',itoa(nTEBtn),', BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(!nTEHolding)
	       {
	       nTECurHoldBtn = nTEBtnBIC ;
	       nTECurHoldTPIndx = nTETPIndx ;
	       }
	  }
     HOLD [10,REPEAT]:
	  {
	  nTEHolding = 1 ;
	  fnTableEventDeBug("'HOLD: TP-',itoa(nTECurHoldTPIndx),', tp/array, HOLD btn-',itoa(nTECurHoldBtn),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  }
     RELEASE:
	  {
	  STACK_VAR INTEGER nTEBtn ;
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTEBtn = GET_LAST(nETableBtnArry) ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', tp/array, GET_LAST btn-',itoa(nTEBtn),', BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(nTEHolding && nTETPIndx == nTECurHoldTPIndx && nTEBtnBIC == nTECurHoldBtn)
	       {
	       nTEHolding = 0 ;
	       fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', Released Hold!   >-line-<',ITOA(__LINE__),'>'") ;
	       }
	  }
     }
     
     
DEFINE_EVENT //ARRAY/ARRAY

BUTTON_EVENT[dvEventTableTPArry,nETableBtnArry]     
     
     {
     PUSH:
	  {
	  STACK_VAR INTEGER nTEBtn ;
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTEBtn = GET_LAST(nETableBtnArry) ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'PUSH: TP-',itoa(nTETPIndx),', array/array, GET_LAST btn-',itoa(nTEBtn),', BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(!nTEHolding)
	       {
	       nTECurHoldBtn = nTEBtnBIC ;
	       nTECurHoldTPIndx = nTETPIndx ;
	       }
	  }
     HOLD [10,REPEAT]:
	  {
	  nTEHolding = 1 ;
	  fnTableEventDeBug("'HOLD: TP-',itoa(nTECurHoldTPIndx),', array/array, HOLD btn-',itoa(nTECurHoldBtn),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  }
     RELEASE:
	  {
	  STACK_VAR INTEGER nTEBtn ;
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTEBtn = GET_LAST(nETableBtnArry) ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', array/array, GET_LAST btn-',itoa(nTEBtn),', BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(nTEHolding && nTETPIndx == nTECurHoldTPIndx && nTEBtnBIC == nTECurHoldBtn)
	       {
	       nTEHolding = 0 ;
	       fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', Released Hold!   >-line-<',ITOA(__LINE__),'>'") ;
	       }
	  }
     }
     
     
DEFINE_EVENT //TP/0

BUTTON_EVENT[dvTP1_EventTable,0] 
BUTTON_EVENT[dvTP2_EventTable,0]
BUTTON_EVENT[dvTP3_EventTable,0]
BUTTON_EVENT[dvTP4_EventTable,0]
BUTTON_EVENT[dvTP5_EventTable,0]
BUTTON_EVENT[dvTP6_EventTable,0]     
             
     {
     PUSH:
	  {
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'PUSH: TP-',itoa(nTETPIndx),', tp/0, BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(!nTEHolding)
	       {
	       nTECurHoldBtn = nTEBtnBIC ;
	       nTECurHoldTPIndx = nTETPIndx ;
	       }
	  }
     HOLD [10,REPEAT]:
	  {
	  nTEHolding = 1 ;
	  fnTableEventDeBug("'HOLD: TP-',itoa(nTECurHoldTPIndx),', tp/0, HOLD btn-',itoa(nTECurHoldBtn),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  }
     RELEASE:
	  {
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', tp/0, BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(nTEHolding && nTETPIndx == nTECurHoldTPIndx && nTEBtnBIC == nTECurHoldBtn)
	       {
	       nTEHolding = 0 ;
	       fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', Released Hold!   >-line-<',ITOA(__LINE__),'>'") ;
	       }
	  }
     }
     
DEFINE_EVENT //ARRAY/0
     
BUTTON_EVENT[dvEventTableTPArry,0]     
     
     {
     PUSH:
	  {
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'PUSH: TP-',itoa(nTECurHoldTPIndx),', array/0, BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(!nTEHolding)
	       {
	       nTECurHoldBtn = nTEBtnBIC ;
	       nTECurHoldTPIndx = nTETPIndx ;
	       }
	  }
     HOLD [10,REPEAT]:
	  {
	  nTEHolding = 1 ;
	  fnTableEventDeBug("'HOLD: TP-',itoa(nTECurHoldTPIndx),', array/0, HOLD btn-',itoa(nTECurHoldBtn),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  }
     RELEASE:
	  {
	  STACK_VAR INTEGER nTETPIndx ;
	  STACK_VAR INTEGER nTEBtnBIC ;
	  
	  nTEBtnBIC = BUTTON.INPUT.CHANNEL ;
	  nTETPIndx = GET_LAST(dvEventTableTPArry) ;
	  fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', array/0, BIC btn-',itoa(nTEBtnBIC),'.   >-line-<',ITOA(__LINE__),'>'") ;
	  if(nTEHolding && nTETPIndx == nTECurHoldTPIndx && nTEBtnBIC == nTECurHoldBtn)
	       {
	       nTEHolding = 0 ;
	       fnTableEventDeBug("'RELEASE: TP-',itoa(nTETPIndx),', Released Hold!   >-line-<',ITOA(__LINE__),'>'") ;
	       }
	  }
     }

Since there are several method to create a button event I wanted to see what would happen with the numbers of useable buttons for the various method. Also I was curious as to how the event tables were created for events that use the catch all "0" in the event declaration.

Like: BUTTON_EVENT[dvEventTableTPArry,0] .

I'm using emulate a device in diagnostic to sumulate button pushes.

Pushing TP1 button 500:
Line      1 (19:39:28):: TABLE EVENT:  PUSH: TP-1, tp/0, BIC btn-500.   >-line-<164>$0D$0A
Line      2 (19:39:28):: TABLE EVENT:  PUSH: TP-1, array/0, BIC btn-500.   >-line-<204>$0D$0A
Line      3 (19:39:28):: TABLE EVENT:  PUSH: TP-1, tp/array, GET_LAST btn-500, BIC btn-500.   >-line-<71>$0D$0A
Line      4 (19:39:28):: TABLE EVENT:  PUSH: TP-1, array/array, GET_LAST btn-500, BIC btn-500.   >-line-<116>$0D$0A
Line      5 (19:39:28):: TABLE EVENT:  RELEASE: TP-1, tp/0, BIC btn-500.   >-line-<183>$0D$0A
Line      6 (19:39:28):: TABLE EVENT:  RELEASE: TP-1, array/0, BIC btn-500.   >-line-<223>$0D$0A
Line      7 (19:39:28):: TABLE EVENT:  RELEASE: TP-1, tp/array, GET_LAST btn-500, BIC btn-500.   >-line-<92>$0D$0A
Line      8 (19:39:28):: TABLE EVENT:  RELEASE: TP-1, array/array, GET_LAST btn-500, BIC btn-500.   >-line-<137>$0D$0A

They all work since the total of TPs * number buttons and Num TPs in Array * number of buttons is less than the 4000 event trigger limit.


Again pushing TP1 but now button 666:
Line      9 (19:39:36):: TABLE EVENT:  PUSH: TP-1, tp/0, BIC btn-666.   >-line-<164>$0D$0A
Line     10 (19:39:36):: TABLE EVENT:  PUSH: TP-1, array/0, BIC btn-666.   >-line-<204>$0D$0A
Line     11 (19:39:36):: TABLE EVENT:  PUSH: TP-1, tp/array, GET_LAST btn-666, BIC btn-666.   >-line-<71>$0D$0A
Line     12 (19:39:36):: TABLE EVENT:  PUSH: TP-1, array/array, GET_LAST btn-666, BIC btn-666.   >-line-<116>$0D$0A
Line     13 (19:39:36):: TABLE EVENT:  RELEASE: TP-1, tp/0, BIC btn-666.   >-line-<183>$0D$0A
Line     14 (19:39:36):: TABLE EVENT:  RELEASE: TP-1, array/0, BIC btn-666.   >-line-<223>$0D$0A
Line     15 (19:39:36):: TABLE EVENT:  RELEASE: TP-1, tp/array, GET_LAST btn-666, BIC btn-666.   >-line-<92>$0D$0A
Line     16 (19:39:36):: TABLE EVENT:  RELEASE: TP-1, array/array, GET_LAST btn-666, BIC btn-666.   >-line-<137>$0D$0A
Again they all work since no total is above 4000.

Again pushing TP1 but now button 667:
Line     17 (19:39:40):: TABLE EVENT:  PUSH: TP-1, tp/0, BIC btn-667.   >-line-<164>$0D$0A
Line     18 (19:39:40):: TABLE EVENT:  PUSH: TP-1, array/0, BIC btn-667.   >-line-<204>$0D$0A
Line     19 (19:39:40):: TABLE EVENT:  PUSH: TP-1, tp/array, GET_LAST btn-667, BIC btn-667.   >-line-<71>$0D$0A
Line     20 (19:39:40):: TABLE EVENT:  RELEASE: TP-1, tp/0, BIC btn-667.   >-line-<183>$0D$0A
Line     21 (19:39:40):: TABLE EVENT:  RELEASE: TP-1, array/0, BIC btn-667.   >-line-<223>$0D$0A
Line     22 (19:39:40):: TABLE EVENT:  RELEASE: TP-1, tp/array, GET_LAST btn-667, BIC btn-667.   >-line-<92>$0D$0A
This time the method that uses the TP Array & Button array no longer works since there are 6 TP * 667 buttons which = 4002.

Interestingly the method using the TP array and the catch all "0" still works.

If I repeat the same tests using TP6 the results are the same:
Line      1 (19:49:02):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-500.   >-line-<164>$0D$0A
Line      2 (19:49:02):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-500.   >-line-<204>$0D$0A
Line      3 (19:49:02):: TABLE EVENT:  PUSH: TP-6, tp/array, GET_LAST btn-500, BIC btn-500.   >-line-<71>$0D$0A
Line      4 (19:49:02):: TABLE EVENT:  PUSH: TP-6, array/array, GET_LAST btn-500, BIC btn-500.   >-line-<116>$0D$0A
Line      5 (19:49:02):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-500.   >-line-<183>$0D$0A
Line      6 (19:49:02):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-500.   >-line-<223>$0D$0A
Line      7 (19:49:02):: TABLE EVENT:  RELEASE: TP-6, tp/array, GET_LAST btn-500, BIC btn-500.   >-line-<92>$0D$0A
Line      8 (19:49:02):: TABLE EVENT:  RELEASE: TP-6, array/array, GET_LAST btn-500, BIC btn-500.   >-line-<137>$0D$0A
Line      9 (19:49:06):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-666.   >-line-<164>$0D$0A
Line     10 (19:49:06):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-666.   >-line-<204>$0D$0A
Line     11 (19:49:06):: TABLE EVENT:  PUSH: TP-6, tp/array, GET_LAST btn-666, BIC btn-666.   >-line-<71>$0D$0A
Line     12 (19:49:06):: TABLE EVENT:  PUSH: TP-6, array/array, GET_LAST btn-666, BIC btn-666.   >-line-<116>$0D$0A
Line     13 (19:49:06):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-666.   >-line-<183>$0D$0A
Line     14 (19:49:06):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-666.   >-line-<223>$0D$0A
Line     15 (19:49:06):: TABLE EVENT:  RELEASE: TP-6, tp/array, GET_LAST btn-666, BIC btn-666.   >-line-<92>$0D$0A
Line     16 (19:49:06):: TABLE EVENT:  RELEASE: TP-6, array/array, GET_LAST btn-666, BIC btn-666.   >-line-<137>$0D$0A
Line     17 (19:49:12):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-667.   >-line-<164>$0D$0A
Line     18 (19:49:12):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-667.   >-line-<204>$0D$0A
Line     19 (19:49:12):: TABLE EVENT:  PUSH: TP-6, tp/array, GET_LAST btn-667, BIC btn-667.   >-line-<71>$0D$0A
Line     20 (19:49:12):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-667.   >-line-<183>$0D$0A
Line     21 (19:49:12):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-667.   >-line-<223>$0D$0A
Line     22 (19:49:12):: TABLE EVENT:  RELEASE: TP-6, tp/array, GET_LAST btn-667, BIC btn-667.   >-line-<92>$0D$0A
I was thinking there might be a possiblity that maybe some TPs would work completely and others might not work at all but apparently when the table is created it divides the total buttons by the number of TPs. Except if you're using the catch all "0". This I really didn't expect and it appears to be an exception to the 4000 event trigger rule since you apparently can use a TP array w/ the 0 and button numbers up to 4000 will work, 6 TPs * 4000 buttons = 24,000.

Now pushing TP1 again and button 1200: (max defined in button array)
Line      1 (19:54:26):: TABLE EVENT:  PUSH: TP-1, tp/0, BIC btn-1200.   >-line-<164>$0D$0A
Line      2 (19:54:26):: TABLE EVENT:  PUSH: TP-1, array/0, BIC btn-1200.   >-line-<204>$0D$0A
Line      3 (19:54:26):: TABLE EVENT:  PUSH: TP-1, tp/array, GET_LAST btn-1200, BIC btn-1200.   >-line-<71>$0D$0A
Line      4 (19:54:26):: TABLE EVENT:  RELEASE: TP-1, tp/0, BIC btn-1200.   >-line-<183>$0D$0A
Line      5 (19:54:26):: TABLE EVENT:  RELEASE: TP-1, array/0, BIC btn-1200.   >-line-<223>$0D$0A
Line      6 (19:54:26):: TABLE EVENT:  RELEASE: TP-1, tp/array, GET_LAST btn-1200, BIC btn-1200.   >-line-<92>$0D$0A
Works as expected with the only method still missing being the method using the TP array,Btn Array method which reached it's limit back at the button 666 test.

Notice the TP array with the catch "0" still works.

Now the same TP and pushing button 1201:
Line      7 (19:55:34):: TABLE EVENT:  PUSH: TP-1, tp/0, BIC btn-1201.   >-line-<164>$0D$0A
Line      8 (19:55:34):: TABLE EVENT:  PUSH: TP-1, array/0, BIC btn-1201.   >-line-<204>$0D$0A
Line      9 (19:55:34):: TABLE EVENT:  RELEASE: TP-1, tp/0, BIC btn-1201.   >-line-<183>$0D$0A
Line     10 (19:55:34):: TABLE EVENT:  RELEASE: TP-1, array/0, BIC btn-1201.   >-line-<223>$0D$0A
Obviously the method using the button array defined with a max of 1200 button no longer works but both the catch all "0" methods still work.

TP6 button 1201:
Line     17 (20:00:18):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-1201.   >-line-<164>$0D$0A
Line     18 (20:00:18):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-1201.   >-line-<204>$0D$0A
Line     19 (20:00:19):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-1201.   >-line-<183>$0D$0A
Line     20 (20:00:19):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-1201.   >-line-<223>$0D$0A
No difference


TP1 button 4000 and then TP6 button 4000:
Line     30 (20:01:45):: TABLE EVENT:  PUSH: TP-1, tp/0, BIC btn-4000.   >-line-<164>$0D$0A
Line     31 (20:01:45):: TABLE EVENT:  PUSH: TP-1, array/0, BIC btn-4000.   >-line-<204>$0D$0A
Line     32 (20:01:46):: TABLE EVENT:  RELEASE: TP-1, tp/0, BIC btn-4000.   >-line-<183>$0D$0A
Line     33 (20:01:46):: TABLE EVENT:  RELEASE: TP-1, array/0, BIC btn-4000.   >-line-<223>$0D$0A
Line     34 (20:01:49):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-4000.   >-line-<164>$0D$0A
Line     35 (20:01:49):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-4000.   >-line-<204>$0D$0A
Line     36 (20:01:49):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-4000.   >-line-<183>$0D$0A
Line     37 (20:01:49):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-4000.   >-line-<223>$0D$0A
Both methods using the catch all "0" still work. Of course that means the system is allocating the resources necassary for all 4000 button for all 6 TPs.

Now it gets weird:
Line      1 (20:22:34):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-4001.   >-line-<164>$0D$0A
Line      2 (20:22:34):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-4001.   >-line-<204>$0D$0A
Line      3 (20:22:34):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-4001.   >-line-<183>$0D$0A
Line      4 (20:22:34):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-4001.   >-line-<223>$0D$0A
Line      5 (20:23:01):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-5000.   >-line-<164>$0D$0A
Line      6 (20:23:01):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-5000.   >-line-<204>$0D$0A
Line      7 (20:23:02):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-5000.   >-line-<183>$0D$0A
Line      8 (20:23:02):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-5000.   >-line-<223>$0D$0A
Line      9 (20:23:15):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-8000.   >-line-<164>$0D$0A
Line     10 (20:23:15):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-8000.   >-line-<204>$0D$0A
Line     11 (20:23:15):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-8000.   >-line-<183>$0D$0A
Line     12 (20:23:15):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-8000.   >-line-<223>$0D$0A
Just for the heck of it I tried 4001 and that worked. So then I tried 5000 and then 8000 and they both worked. Hmmm....


Also worth noting is that during this testing the problem that existed with HOLDS while using the catch all "0" didn't appear so maybe it's been fixed in one of the recent master firmware revisions. If I recall a 0 button number hold would keep repeating but I didn't see that at all.

So if you have alot of TPs with a device port using alot of buttons that exceed the TPs * button < 4000 rule the best bet would be to stack BUTTON EVENT for the individual TP with a button array or stack the TPs and use the catch all "0". The TP Array using the catch all "0" method also works but really shouldn't so although it works now I wouldbn't trust it to work this way in the future.

Comments

  • I can confirm that the HOLD event using a "0" to catch all is indeed fixed in the newer firmware releases.
  • viningvining Posts: 4,368
    rgelling wrote:
    I can confirm that the HOLD event using a "0" to catch all is indeed fixed in the newer firmware releases.

    Thanks for that verification!

    Now how are these event tables for the "0" catch all created and how are system resources allocated since in the v3.41.422 firmware that I'm running the "0" catch all works up to button number 65535. Just slightly over the 4000 event triggers for a single TP limit. Are the resources allocated for that total amount or does the "0" just work differently?

    It could get expensive in a large system w/ alot of "0" usage. I thought using the "0" would be bad enough allocating resouces for the 4000 possible events (buttons) "0" would catch when possibly only a 100 or so buttons were necassary but now this 65535 upper limit really takes wasting resource to the next level.
    Line      1 (09:42:02):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-20000.   >-line-<164>$0D$0A
    Line      2 (09:42:02):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-20000.   >-line-<204>$0D$0A
    Line      3 (09:42:02):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-20000.   >-line-<183>$0D$0A
    Line      4 (09:42:02):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-20000.   >-line-<223>$0D$0A
    Line      5 (09:42:11):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-40000.   >-line-<164>$0D$0A
    Line      6 (09:42:11):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-40000.   >-line-<204>$0D$0A
    Line      7 (09:42:11):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-40000.   >-line-<183>$0D$0A
    Line      8 (09:42:11):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-40000.   >-line-<223>$0D$0A
    Line      9 (09:42:20):: TABLE EVENT:  PUSH: TP-6, tp/0, BIC btn-65535.   >-line-<164>$0D$0A
    Line     10 (09:42:20):: TABLE EVENT:  PUSH: TP-6, array/0, BIC btn-65535.   >-line-<204>$0D$0A
    Line     11 (09:42:20):: TABLE EVENT:  RELEASE: TP-6, tp/0, BIC btn-65535.   >-line-<183>$0D$0A
    Line     12 (09:42:20):: TABLE EVENT:  RELEASE: TP-6, array/0, BIC btn-65535.   >-line-<223>$0D$0A
    
  • Are resources allocated for total amount or does "0" just work differently?

    Using "0" in an event to "catch all" does not allocate any extra memory. In fact, it counts as only one event. It is simply treated as a wildcard and will match anything. We try to be efficient with system resources. In most cases we succeed.

    So it is actually fairly inexpensive to use a catch all "0" and, in my mind, adds to code readability when get_last() is used.

    Hope that helps.
  • viningvining Posts: 4,368
    rgelling wrote:
    Using "0" in an event to "catch all" does not allocate any extra memory. In fact, it counts as only one event.
    Cool, that's good to know! Thanks.
Sign In or Register to comment.