Home AMX User Forum NetLinx Studio

Limit of Button_Events on same channel.

I often find myself doing multiple button_events on the same button as I quite often use multiple includes/modules in a project that get status from that button.

I've never had any issue with this but it did get me thinking the other day. Is there an uppoer limit to the number of button_events in a program on the same button or buttons?

a simple example would be:

how many times can I do this and still have all the events fire?
BUTTON_EVENT[TP1,1]
{
PUSH:
  {
  // Do something 1
  }
}

BUTTON_EVENT[TP1,1]
{
PUSH:
  {
  // Do something 2
  }
}

BUTTON_EVENT[TP1,1]
{
PUSH:
  {
  // Do something 3
  }
}

// etc....

Does anyone know the answer to this?

Comments

  • mpullinmpullin Posts: 949
    dunno but here's a quick test for this

    You should copy this button event and paste it a few hundred times. Then select the column where the '1' is and do a Sequentially Renumber Selection. Now compile, send, and run this program. Turn on diagnostics, hit the button, and see what the highest number that pops out is.
    BUTTON_EVENT[TP1,1]{PUSH:{SEND_STRING 0, 'Blob # 1';}}
    
  • viningvining Posts: 4,368
    I'm probably completely off base but I would think 1 TP & 1 Button the event table could to hold 4000 pointers/triggers so I'll make a guess of 4000 times. Of course it could be that the compiler can creates an infinite number of event tables, one for every instance that this appears in your code, each would be the same but with a different location pointer.

    Out of curiousity I'd like to see you run the test to see the results.
  • ericmedleyericmedley Posts: 4,177
    vining wrote: »
    I'm probably completely off base but I would think 1 TP & 1 Button the event table could to hold 4000 pointers/triggers so I'll make a guess of 4000 times. Of course it could be that the compiler can creates an infinite number of event tables, one for every instance that this appears in your code, each would be the same but with a different location pointer.

    Out of curiousity I'd like to see you run the test to see the results.

    You guys sure seem interested in me trying to blow up one of my masters...
    :D
  • PhreaKPhreaK Posts: 966
    ericmedley wrote: »
    You guys sure seem interested in me trying to blow up one of my masters...
    :D

    No....

    Can you film it?
  • viningvining Posts: 4,368
    Well it was either play with this or estimates & billing and they're no fun.
    BUTTON_EVENT[dvTP_TEST,1] { PUSH:{ nBtnTestCount++ SEND_STRING 0,"'TP TEST BTN 1, INSTANCE-',itoa(nBtnTestCount)" } }//1
    BUTTON_EVENT[dvTP_TEST,1] { PUSH:{ nBtnTestCount++ SEND_STRING 0,"'TP TEST BTN 1, INSTANCE-',itoa(nBtnTestCount)" } }//2
    
    continued...
    
    BUTTON_EVENT[dvTP_TEST,1] { PUSH:{ nBtnTestCount++ SEND_STRING 0,"'TP TEST BTN 1, INSTANCE-',itoa(nBtnTestCount)" } }//5039
    BUTTON_EVENT[dvTP_TEST,1] { PUSH:{ nBtnTestCount = 0 SEND_STRING 0,"'TP TEST BTN 1, INSTANCE-',itoa(nBtnTestCount)" } }//5040
    
    
    I would get a $hit load of buffer overflow stuff and finally the send strings would print but I'd get 1 - 179 & then 0 which means only the last 180 button events ran starting the count at 1 and ending at 0, very odd.

    diagnostics: (around 150 of these)
    Line    116 (17:21:47)::  CIpEvent::AddInternalEvent - Error Overflow
    Line    117 (17:21:47)::  CIpEvent::AddInternalEvent - Max Queue Count = 25
    Line    118 (17:21:47)::  CIpEvent::AddInternalEvent - Max Queue Count = 50
    Line    119 (17:21:47)::  CIpEvent::AddInternalEvent - Max Queue Count = 75
    Line    120 (17:21:47)::  CIpEvent::AddInternalEvent - Max Queue Count = 100
    

    NS3 is definitely wierding out with all these button events too.

    I created another button event group for channel 2 but this time w/o the send string 0 so I can see what happens to the just variable w/ bogging the mast down w/ send strings.
    BUTTON_EVENT[dvTP_TEST,2] { PUSH:{ nBtnTestCount++ } }//1
    BUTTON_EVENT[dvTP_TEST,2] { PUSH:{ nBtnTestCount++ } }//2
    
    continued...
    
    BUTTON_EVENT[dvTP_TEST,2] { PUSH:{ nBtnTestCount++ } }//5039
    BUTTON_EVENT[dvTP_TEST,2] { PUSH:{ nBtnTestCount++ } }//5040
    

    On channel 2 w/ only the events changing the variable it would consistantly count to 40 with a button push.

    With the BE for ch 1 commented out so that only 180 will run I only got 3 of the buffer messages and all send string 0's printed.
    Line      3 (17:39:35)::  CIpEvent::AddInternalEvent - Max Queue Count = 150
    
    Line      5 (17:39:35)::  TP TEST BTN 1, INSTANCE-1
    Line      6 (17:39:35)::  TP TEST BTN 1, INSTANCE-2
    Line      7 (17:39:35)::  TP TEST BTN 1, INSTANCE-3
    ......
    
    Line    182 (17:39:36)::  TP TEST BTN 1, INSTANCE-178
    Line    183 (17:39:36)::  TP TEST BTN 1, INSTANCE-179
    Line    184 (17:39:36)::  TP TEST BTN 1, INSTANCE-180
    
    

    Now on the BE for ch 2 I commented out all but 3999 and I got 150 buffer error messages & my variable counted to just 1. Not what I expected.

    Ok so now I comment out all but 255 on both and w/ a push for BE 1 I get 5 buffer messages and all send strings print.
    Line    259 (17:54:30)::  TP TEST BTN 1, INSTANCE-253
    Line    260 (17:54:30)::  TP TEST BTN 1, INSTANCE-254
    Line    261 (17:54:30)::  TP TEST BTN 1, INSTANCE-255
    
    With a push on BE 2 the variable counts to 255 w/ no problems and no buffer messsages.

    So I then tried 1024 w/ both BE's, and only 24 would either print or be counted by the varaible.

    So I finally tried 999 cuz the previous result of 24 out of 1024 seemed a little suspicous, like a rollover or something and w/ BE1 I'd get 35 buffer messsages and print out 499 send strings, the var count was also 499. BE 2 I got a bunch of the buffer messsages the var again counted to 499.

    None of these numbers seem to make sense but maybe the counts rollover on 500 but initial I had 180 out of 5k+ so beets me. Of course with just the variable on BE 2 I got 40 consistantly which was tring to do 5040.
  • DarksideDarkside Posts: 345
    Any smoke yet VAV?

    :)
Sign In or Register to comment.