Home AMX User Forum AMXForums Archive Threads AMX Hardware AutoPatch Forum

Doorbell Interface

We are having problems with a the Precis 8x8 utilizing a doorbell interface. Using the CFSound module we are sending the doorbell sound to the precis. Our problem is that there does not seem to be a clean way to return the precis to its previous state. Basically I need to know the state of the switcher (input and output) so after I ring the the doorbell through the audio system I can get everybody listening to what they were. Being able to set a preset and then recall the preset would be nice. (like with the extron) Any example code would be appreciated. We have it working (sort of) but its nasty.

Thanks

Comments

  • I have encountered difficulty with a requirement to automagically "go back to where you were" after an interruption. I found it philosophically difficult... how to define the beginning and the end of the interruption... whether or not to revert to the same mute state.

    Automagical actions often seem to bite you later, so I fight against them when I can.

    However this seems straightforward.

    First you need to track the state of the switcher. That's a given in all systems for all devices like this.

    The state is an array with 8 elements, one for each output, representing which input is being sent to that output - values 0..8 where 0 is no input.

    It seems unnatural to hold an array of output states rather than input states, but it's necessary. You have to "think backwards" when writing the driver - I always have to double check - but you only have to write the driver once.

    You need to duplicate the state array for both "Desired" and "Sent" versions. "Desired" is what you want the switcher to do and "Sent" is what you've told the switcher to do so far.

    It's best to code your driver so that it doesn't send a command to the switcher to reassert switcher state if it is already good. That's easy when you know the state. Compare "Desired" and "Sent" for a given output to see if a command is required; if it is, queue the command and copy "Desired" to "Sent" for that output.

    At the start of the interruption, copy the "Desired" state array to another similar variable to save it for later.

    Now make your doorbell changes by changing the "Desired" array, while your driver code works independently to send out the differences from the "Sent" array.

    At the end of the interruption, copy back the saved "Desired" state.
  • I did something ugly for this, as well.

    Remember, you have to account for varied initial volume states, too, when you are integrating with a DA system. You may also want to add "private zones" or "do not disturb" zones for the user to activate.

    I'm betting there would be a more elegant way to use a for loop to do the reset!
    BUTTON_EVENT[dvDB1, 1]			// Door bell rung
    {
        PUSH:
        {
        nVOLB4RING [ 1] = nAPVOL [ 1]  /// set and store volume before door bell pushed
        nVOLB4RING [ 2] = nAPVOL [ 2]
        nVOLB4RING [ 3] = nAPVOL [ 3]
        nVOLB4RING [ 4] = nAPVOL [ 4]
        nVOLB4RING [ 5] = nAPVOL [ 5]
        nVOLB4RING [ 6] = nAPVOL [ 6]
        nVOLB4RING [ 7] = nAPVOL [ 7]
        nVOLB4RING [ 8] = nAPVOL [ 8]
        nVOLB4RING [ 9] = nAPVOL [ 9]
        nVOLB4RING [10] = nAPVOL [10]
        nVOLB4RING [11] = nAPVOL [11]
        nVOLB4RING [12] = nAPVOL [12]
        nVOLB4RING [13] = nAPVOL [13]
        nVOLB4RING [14] = nAPVOL [14]
        nVOLB4RING [15] = nAPVOL [15]
        nVOLB4RING [16] = nAPVOL [16]
        nVOLB4RING [17] = nAPVOL [17]
        nVOLB4RING [18] = nAPVOL [18]
    
        SEND_STRING dvSWTCH, "'CL2I6O1 2 3 4 5 6 7 8 9 10 11T',13"	// switches zones 1 2 3 4 5 6 7 8 9 10 and 11 to doorbell INPUT (Autopatch source 6) 
        
        WAIT 5 'DB1.0'		// allow time for inputs to switch
       
        SEND_STRING dvSWTCH, "'CO1 2 3 4 5 6 7 8 9 10 11VA',ITOA(n75PCAP),'T',13"		// Volume 75% doorbell zones 
        
        WAIT 65 'DB1.1'		// allow time for doorbell to ring
    	{			// then switch all doorbell zones back to previous inputs and volume levels
    	    {
    	    SEND_STRING dvSWTCH, "'CO1VA',ITOA(nVOLB4PAGE [1]),'T',13"		// Previous volume  
    	    SEND_STRING dvSWTCH, "'CL2I',ITOA(nCURRENT_SOURCES [1]),'O1T',13" // switches zone 2 from doorbell INPUT (Autopatch source 6) back to previous source
    	    }
    	WAIT 5 'DB1.1'
    	    {
    	    SEND_STRING dvSWTCH, "'CO2VA',ITOA(nVOLB4PAGE [2]),'T',13"		
    	    SEND_STRING dvSWTCH, "'CL2I',ITOA(nCURRENT_SOURCES [2]),'O2T',13" 
    	    }
    	WAIT 5 'DB1.2'
    	    {
    	    SEND_STRING dvSWTCH, "'CO3VA',ITOA(nVOLB4PAGE [3]),'T',13"		// 
    	    SEND_STRING dvSWTCH, "'CL2I',ITOA(nCURRENT_SOURCES [3]),'O3T',13" 
    	    }
    	WAIT 5 'DB1.3'
    	    {
    	    ....etc.
    	    }
    	
    	
    	}
        }
    }
    

    I am confident that the Autopatch group at AMX will be updating the Precis LT with DSP to support this and other common DA system features out of the box before long, especially with the announcement of the new Metreau Entry Communicators.
Sign In or Register to comment.