Home AMX User Forum NetLinx Studio

INACTIVITY command(new programmer)

I'm a new programmer, and I'm trying to shut down the system if there's innactivity for X amount of time...
Can someone help ?
I've looked at TIMELINE but i think it's more advanced for me.
Does anyone have any example to share ?

Thanks

Comments

  • I think a timeline would be your best bet.

    If you do this:
    DEFINE_CONSTANT
    
    LONG lcTImeout[] = {600000} // 1 hour
    
    DEFINE_VARIABLE
    
    DEV vdvTP[] = {dvTP}
    
    DEFINE_EVENT
    
    BUTTON_EVENT[vdvTP,0]
    {
         PUSH:
         {
              TIMELINE_KILL(1)
              TIMELINE_CREATE(1,lcTimeout,1,TIMELINE_RELATIVE,TIMELINE_ONCE)
         }
    }
    
    TIMELINE_EVENT[1]
    {
         fnShutDownSystem()
    }
    
    

    It will start a timer after every button push from the TP's that are a part of the array vdvTP. The timer is for an hour, which can be adjusted (you probably want to make it longer then that). Every time a button is pushed it kills the existing timer and starts a new one.

    fnShutDownSystem is what ever routine you have for shutting down the system.
  • Thanx

    is vdvTP,0 for every panel in the system, and for every button ?
    Do i define vdvTP in define device?
  • filpeefilpee Posts: 64
    jackygross wrote:
    is vdvTP,0 for every panel in the system, and for every button ?
    Do i define vdvTP in define device?


    vdvTP in this application is an arrary of touchpanels. It is defined here in DEFINE_VARIABLE.

    you might have something like this
    DEFINE DEVICE
    dvTP = 10001:1:1
    dvTP_DVD = 10001:2:1
    dvTP_VCR = 10001:3:1
    
    DEFINE_VARIABLE
    DEV vdvTP[] = {dvTP, dvTP_DVD, dvTP_VCR}
    

    now the event "BUTTON_EVENT[vdvTP,0]" will capture every button press mapped to your touchpanel device on 10001 ports 1,2 and 3
Sign In or Register to comment.