Home AMX User Forum AMXForums Archive Threads AMX Hardware

AS16 Levels feedback

I have a project that has 13 Modero panels controlling a AS16. Everything works good, the only problem I am having is when a TP goes offline or is rebooted it loses the levels feedback. Any ideas on how I can query the levels of the AS16 and update them when the panel comes online again? Another way I am considering is when I press a button to go to the AS16 overview control page showing all 16 zone bargraphs it resends the levels. Any ideas?

Thanks,

Ricardo

Comments

  • DHawthorneDHawthorne Posts: 4,584
    Use CREATE_LEVEL in DEFINE_START to link them to variables. In the panel's ONLINE event, iterate through those variables and SEND_LEVEL each one to the panel again.
  • Ricardo, I'm assuming you don't have lines of code along the lines of

    SEND_LEVEL TP,1,AS16LevelVar

    in your mainline/feedback routines? I.E., the only time levels are normally sent to the panels are in response to button pushes that cause the levels to change?


    - Chip
  • DHawthorne and Chip,

    Thanks for the prompt replying to my thread. I did create 16 levels in DEFINE_START and tied them up with 16 variables as suggested by DHawthorne, and I am also using Chips send comand format. Now, if I have 13 Modero panels to update, is it OK to create a TP array and have the SEND_LEVEL command in mainline (DEFINE_PROGRAM) or is ti better to send the levels only when I go to that page per panel?

    This is what I've done:
    DEFINE_VARIABLE
    
    VOLATILE INTEGER AS16VOL[16]
    
    VOLATILE INTEGER iLoop
    
    DEV vTPARRAY[13] = {dvTP_Audio1,dvTP_Audio2,...,dvTP_Audio13}
    
    DEFINE_START
    
    //Creates all 16 volume level variables
    FOR (iLoop = 1; iLoop<17; iLoop++)
    {
        CREATE_LEVEL vdvAS16,iLoop,AS16VOL[iLoop]
    }  
    
    BUTTON_EVENT[vTPKitchen,nTPKitchenRoomSelected] //Selects a room to control Audio and updates volume level bargraph
    {
        PUSH:
        {
    	STACK_VAR Integer nroom
    	nroom = GET_LAST(nTPKitchenRoomSelected)
    	nTPKitchenRoomActive = nroom
    	SEND_LEVEL vTPARRAY[1],nroom,AS16VOL[nroom]
        }
    }
    
    BUTTON_EVENT[vTPKitchen,117]    //Updates all bargraph volume levels for overview page on vTPKitchen
    {
        PUSH:
        {
    	STACK_VAR Integer i
    	FOR (i = 1; i<17; i++)
    	{
    	    SEND_LEVEL vTPARRAY[1],i,AS16VOL[i]
    	}
        }
    }
    

    Or is it better to do the feedback like this:
    DEFINE_PROGRAM
    	FOR (i = 1; i<17; i++)
    	{
    	    SEND_LEVEL vTPARRAY,i,AS16VOL[i] //keeps updating all panels and all levels
    	}
    
  • Discussions of feedback in timeline events aside, I generally go with the feedback method you show at the end of your message.

    As much as a FOR loop will neaten up code, your feedback statements will actually run slightly faster if you put in 17 individual lines - one for each level.

    In theory, the Netlinx OS knows to only send an update out to a panel when the value actually changes - otherwise you'd be clogging up the network with level data every pass through your feedback code.

    The main reason why I was asking was that if a panel went offline and came back on, I suppose there is a possibility that the OS may not re-send all the current levels. If you find that to be the case, you can get around that by adding a series of "SEND_LEVEL TP,<level channel>,0" to the panel's online event. All the levels will be cleared, then re-set to actual values the next time the feedback code is executed.

    To get extra fancy, you could try to save a little more overhead by putting those feedback statements in something like an IF block that only evaluates to true when the page with the bargraphs on it is displayed.

    - Chip
  • Chip,

    Thanks for your suggestions. How do I do page tracking in a Modero panel? Can you kindly provide an example of the IF statement to evaluate when the page is up or do I need a var flag to evaluate? I just want to make sure that the IF statement is an option in case I run into problems when all 13 Modero panels are online and processing overhead becomes an issue.

    Thanks,

    Ricardo
  • You can page track two different ways. Have all of your page flips driven by code, and just keep track (in a variable) of which page was selected last. You can also turn on page tracking in the panel (in one of the protected setup pages) and the panel will send strings to the control system each time a page changes. You would need to set up DATA_EVENT [TP] - STRING: in that instance, and parse the string that comes back when page flips occur. (Third method - page flips done by buttons on the panel, but leave channels assigned to those buttons so you can track which one was selected last)

    If you track the current page with a variable called TPxPage, your IF statement might look something like this:
    IF (TP1Page = AS16BarPage)
    {
      SEND_LEVEL TP1,Bar1,AS16Level1
      SEND_LEVEL TP1,Bar2,AS16Level2
      // etc
    }
    

    Obviously, you can handle how feedback is done for multiple panels in a number of ways - hopefully you'll get a few ideas from this.

    - Chip
Sign In or Register to comment.