Home AMX User Forum NetLinx Studio

Repeat sound upon channel event

Hi AMX companions

I am having an alarm input, that triggers an channel event - causing a image to occure, as well as an alarm sound.

I would like to have the sound repeated as long as the channel event (input) is active - how is this accomblished ?

Comments

  • ericmedleyericmedley Posts: 4,177
    bia@jdm.dk wrote: »
    Hi AMX companions

    I am having an alarm input, that triggers an channel event - causing a image to occure, as well as an alarm sound.

    I would like to have the sound repeated as long as the channel event (input) is active - how is this accomblished ?

    Well, one way would be to a WHILE loop
    WHILE(alarm_active)
    {
    wait 30
      {
      // play the sound every 3 seconds.
      }
    }
    

    Another using an IF
    IF(Alarm_active and !alarm_active_flag)
    {
    // play sound
    wait 30  // reset flag after 3 seconds.
      {
      alarm_active_flag=0
      }
    alarm_active_flag=1
    }
    
  • Thanks

    But I am a rookie - total green - so bare with me

    Right know I have this:

    CHANNEL_EVENT[RK,2] //wake panels
    {
    ON:
    {
    SEND_COMMAND TP1,"'WAKE'"
    SEND_COMMAND TP2,"'WAKE'"
    SEND_COMMAND TP3,"'WAKE'"
    SEND_COMMAND TP1,"'PAGE-Hovedside'"
    SEND_COMMAND TP2,"'PAGE-Hovedside'"
    SEND_COMMAND TP3,"'PAGE-Hovedside'"

    }
    OFF:
    {
    //something else
    }
    }


    And this to tricker the button - on which I have the sound programmed in TP4

    DEFINE_PROGRAM
    // {{NSX_DEFINE_PROGRAM



    [TP1,10] = ([RK,2]) //activate sound
    [TP2,10] = ([RK,2]) //activate sound
    [TP3,10] = ([RK,2]) //activate sound
  • ericmedleyericmedley Posts: 4,177
    bia@jdm.dk wrote: »
    Thanks

    But I am a rookie - total green - so bare with me

    Right know I have this:

    CHANNEL_EVENT[RK,2] //wake panels
    {
    ON:
    {
    SEND_COMMAND TP1,"'WAKE'"
    SEND_COMMAND TP2,"'WAKE'"
    SEND_COMMAND TP3,"'WAKE'"
    SEND_COMMAND TP1,"'PAGE-Hovedside'"
    SEND_COMMAND TP2,"'PAGE-Hovedside'"
    SEND_COMMAND TP3,"'PAGE-Hovedside'"

    }
    OFF:
    {
    //something else
    }
    }


    And this to tricker the button - on which I have the sound programmed in TP4

    DEFINE_PROGRAM
    // {{NSX_DEFINE_PROGRAM





    [TP1,10] = ([RK,2]) //activate sound
    [TP2,10] = ([RK,2]) //activate sound
    [TP3,10] = ([RK,2]) //activate sound

    [TP1,10] = ([RK,2]) you don't need the parins.

    [TP1,10] = [RK,2]
Sign In or Register to comment.