Home AMX User Forum NetLinx Studio

Feedback to Multipe Panels

I am for some reason having trouble with getting button feedback on multiple touch panels.

I've defined my array properly I think.
DEV vdvDENON_CHANGER_TP[] = {dvTP_CHANGER, dvTP_OFFICE_CHANGER}

and then turned a button on with...
ON[vdvDENON_CHANGER_TP,1]

It works on one panel (NXD-700vi) but not the other (MVP-5200i). If I take the NXD-700vi (dvTP_OFFICE_CHANGER) out of the array and only have dvTP_CHANGER in the array my feedback works fine for the MVP-5200i.
DEV vdvDENON_CHANGER_TP[] = {dvTP_CHANGER}

When I put the second touch panel back in it stops working on the first. Anybody have any idea what is going on? Also, occasionally the button that is supposed to be in the on position on the MVP-5200i will flash for a brief moment. I've been messing with this for too long. Help.

Comments

  • BigsquatchBigsquatch Posts: 216
    I don't think you can use device arrays that way, only to catch events. Plus it looks like you are using virtual devices in your feedback statement. Don't you have to refer to the actual devices?

    I've always done it like this:
    INTEGER I
    
    FOR(I=1; I<=LENGTH_ARRAY(dvDENON_CHANGER_TP); I++)
    {
        ON[dvDENON_CHANGER_TP[I],1]
    }
    
    
  • a_riot42a_riot42 Posts: 1,624
    Bigsquatch wrote: »
    I don't think you can use device arrays that way, only to catch events. Plus it looks like you are using virtual devices in your feedback statement.

    There is no problem with the array, it should work fine. You should post the code for the device definitions and any mutually exclusive, define_combine or define_program code too though. If you are seeing it briefly flash for a second then it is getting turned on, but then turned off probably in define_program, or from a mutex conflict. But your code should work fine without the need for any for loops.
    Paul
  • remeolbremeolb Posts: 79
    After some more testing I realized that whichever panel is defined first in the array is the only one that gets feedback. So, if I switch the order the other one works.
    a_riot42 wrote: »
    If you are seeing it briefly flash for a second then it is getting turned on, but then turned off probably in define_program, or from a mutex conflict.Paul

    Actually, it doesn't turn on and then off. It flickers. It will be on for an instant then off for a while then flicker on then back off. Very weird.
  • remeolbremeolb Posts: 79
    The below is in the master source file...
    dvTP_CHANGER		= 10002:4:1		// THEATER TOUCH PANEL CD CHANGER CONTROLS
    dvTP_OFFICE_CHANGER	= 10001:5:1		// OFFICE TOUCH PANEL CD CHANGER CONTROLS
    
    #INCLUDE 'Denon CD Changer.axi'
    

    The below is in the include file...
    DEFINE_VARIABLE
    
    DEV vdvDENON_CHANGER_TP[] = {dvTP_CHANGER, dvTP_OFFICE_CHANGER}
    
    INTEGER nDENON_CHANGER_TRANSPORT_FB_CODES[] = {1,2,3,4,5,6,7}
    
    INTEGER nDENON_CHANGER_DISC_FB_CODES[] = {41,42,43,44,45}
    
    INTEGER nDENON_CHANGER_RANDOM_FB_CODES[] = {50,51}
    
    INTEGER nDENON_CHANGER_REPEAT_FB_CODES[] = {60,61,62,63}
    
    DEFINE_MUTUALLY_EXCLUSIVE
    
    ([vdvDENON_CHANGER_TP,1],[vdvDENON_CHANGER_TP,2],[vdvDENON_CHANGER_TP,3],[vdvDENON_CHANGER_TP,4],[vdvDENON_CHANGER_TP,5],[vdvDENON_CHANGER_TP,6],[vdvDENON_CHANGER_TP,7])
    
    ([vdvDENON_CHANGER_TP,41],[vdvDENON_CHANGER_TP,42],[vdvDENON_CHANGER_TP,43],[vdvDENON_CHANGER_TP,44],[vdvDENON_CHANGER_TP,45])
    
    DEFINE_FUNCTION fnDENON_CHANGER_TRANSPORT_FEEDBACK()
    {
        IF(nSTATUS || nSYSTEM_STATUS)				// IF THERE IS A STATUS OR SYSTEM STATUS CODE
        {
    	SELECT
    	{
    	    ACTIVE(nSTATUS = 1):				// DISC PLAYING
    	    {
    		nSTATE = 1
    		ON[vdvDENON_CHANGER_TP,nSTATE]
    	    }		  
    	    ACTIVE(nSTATUS = 2):				// STOPPED
    	    {
    		nSTATE = 2
    		ON[vdvDENON_CHANGER_TP,nSTATE]
    	    }
    	    ACTIVE(nSTATUS = 3):				// PAUSED
    	    {
    		nSTATE = 3
    		ON[vdvDENON_CHANGER_TP,nSTATE]
    	    }
    	    ACTIVE(nSTATUS = 4 || nSTATUS = 5 || nSTATUS = 7 || nSTATUS = 8 || nSYSTEM_STATUS = 1 || nSYSTEM_STATUS = 2 || nSYSTEM_STATUS = 3 || nSYSTEM_STATUS = 4 || nSYSTEM_STATUS = 5 || nSYSTEM_STATUS = 6 || nSYSTEM_STATUS = 7):
    	    {
    		//fnDENON_CHANGER_TURN_OFF_FB(vdvDENON_CHANGER_TP,nDENON_CHANGER_FB_CODES)
    	    }
    	    ACTIVE(nSTATUS = 6):
    	    {
    		nSTATE = 4
    	    }
    	}
    	ON[vdvDENON_CHANGER_TP,nDENON_CHANGER_DISC_FB_CODES[nDISC_NUMBER]]
        }
        ELSE
        {
    	//fnDENON_CHANGER_TURN_OFF_FB(vdvDENON_CHANGER_TP,nDENON_CHANGER_FB_CODES)
    	OFF[nPOWER]
        }
    }
    


    I've made some changes to the function above since the last time I exported the file to my thumb drive but this doesn't work either. All of the changes I have made are related to updating variables.
    BUTTON_EVENT[vdvDENON_CHANGER_TP,nDENON_CHANGER_BUTTONS]
    {
        PUSH:
        {
    	STACK_VAR INTEGER nMYBUTTON
    	nMYBUTTON = GET_LAST(nDENON_CHANGER_BUTTONS)
    	IF(nMYBUTTON <= 7 || (nMYBUTTON >=10 && nMYBUTTON <= 14))
    	{
    	    ON[BUTTON.INPUT]
    	}
    	ELSE
    	{
    	    TO[BUTTON.INPUT]
    	}
    	fnDENON_CHANGER_COMMAND_SEND(nMYBUTTON)
        }
    }
    
    DEFINE_FUNCTION fnDENON_CHANGER_MESSAGE_PARSE(CHAR sARGBUF[])
    {
        STACK_VAR CHAR sMYHEADER
        sMYHEADER = GET_BUFFER_CHAR(sARGBUF)
        IF(fnDENON_CHANGER_ACK_PARSE(GET_BUFFER_CHAR(sARGBUF)))		// POSITIVE ACK RECEIVED
        {
    	SELECT
    	{
    	    ACTIVE(sMYHEADER = "$20"):					// RESET
    	    {
    		
    	    }
    	    ACTIVE(sMYHEADER = "$30"):					// PLAY STATUS
    	    {
    		nSYSTEM_STATUS = GET_BUFFER_CHAR(sARGBUF) - $2F
    		nDISC_NUMBER = GET_BUFFER_CHAR(sARGBUF) - $30
    		nDISC_TYPE = GET_BUFFER_CHAR(sARGBUF) - $30
    		nAUDIO_FORMAT = GET_BUFFER_CHAR(sARGBUF) - $30
    		nSTATUS = GET_BUFFER_CHAR(sARGBUF) - $40
    		nPLAY_MODE = GET_BUFFER_CHAR(sARGBUF) - $30
    		fnDENON_CHANGER_FOLDER_TRACK_PARSE(REMOVE_STRING(sARGBUF,LEFT_STRING(sARGBUF,6),1))
    		REMOVE_STRING(sArgBuf,LEFT_STRING(sArgBuf,2),1)
    		sCOUNTER = fnDENON_CHANGER_COUNTER_FORMAT(REMOVE_STRING(sARGBUF,LEFT_STRING(sARGBUF,5),1))
    		fnDENON_CHANGER_UPDATE()
    		fnDENON_CHANGER_TRANSPORT_FEEDBACK()
    	    }
    	    ACTIVE(sMYHEADER = "$31"):					// CPU VERSION
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$32"):					// ERROR CODE
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$33"):					// DISC STATUS
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$34"):					// PROGRAM TABLE
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$35"):					// CD TOC
    	    {
    		REMOVE_STRING(sARGBUF,LEFT_STRING(sARGBUF,1),1)
    		nTOTAL_TRACKS = ATOI(LEFT_STRING(sARGBUF,3))
    		fnDENON_CHANGER_UPDATE()
    	    }
    	    ACTIVE(sMYHEADER = "$36"):					// CD TEXT
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$40"):					// PLAY
    	    {
    		fnDENON_CHANGER_COMMAND_SEND(nDENON_CHANGER_TOTAL_TRACKS_SEND)
    		fnDENON_CHANGER_UPDATE()
    	    }
    	    ACTIVE(sMYHEADER = "$41"):					// STOP
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$42"):					// PAUSE
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$43"):					// SKIP
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$44"):					// SEARCH
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$45"):					// OPEN/CLOSE
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$46"):					// PROGRAM/DIRECT
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$47"):					// TRACK NUMBER ENTRY
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$48"):					// RANDOM
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$49"):					// A-B
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$4A"):					// TIME
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$4B"):					// REPEAT
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$4C"):					// DISC SELECT
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$4D"):					// DISC SKIP
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$4E"):					// POWER ON
    	    {
    	    
    	    }
    	    ACTIVE(sMYHEADER = "$4F"):					// POWER OFF
    	    {
    	    
    	    }
    	}
        }
    }
    

    Hopefully this isn't overkill on information. Thanks!
  • a_riot42a_riot42 Posts: 1,624
    I didn't look at all your code, but my guess would be the array of touch panels in the mutex code. Separate them into their own mutex and it should work.
    Paul
  • HedbergHedberg Posts: 671
    I don't think that you can use arrays in define_mutually_exclusive like that. Try commenting out the mutually exclusive stuff and see if your feedback works properly.

    If you want to use mutually exclusive, I think you need to define sets for all the touch panels discreetly. Could be wrong, but that's my recollection, and one of the reasons that I never use mutually exclusive.
  • HedbergHedberg Posts: 671
    a_riot42 wrote: »
    I didn't look at all your code, but my guess would be the array of touch panels in the mutex code. Separate them into their own mutex and it should work.
    Paul

    Oh. mutex. Now I get it. Looks like we both see the same problem.

    I was trying to find the mute section in his code.
  • remeolbremeolb Posts: 79
    Yeah the mutex took me a second too. I'm taking it out now.
  • remeolbremeolb Posts: 79
    I changed the mutually exclusive statement to this...
    DEFINE_MUTUALLY_EXCLUSIVE
    
    //([vdvDENON_CHANGER_TP,1],[vdvDENON_CHANGER_TP,2],[vdvDENON_CHANGER_TP,3],[vdvDENON_CHANGER_TP,4],[vdvDENON_CHANGER_TP,5],[vdvDENON_CHANGER_TP,6],[vdvDENON_CHANGER_TP,7])
    
    ([dvTP_CHANGER,1],[dvTP_CHANGER,2],[dvTP_CHANGER,3],[dvTP_CHANGER,4],[dvTP_CHANGER,5],[dvTP_CHANGER,6],[dvTP_CHANGER,7])
    
    ([dvTP_OFFICE_CHANGER,1],[dvTP_OFFICE_CHANGER,2],[dvTP_OFFICE_CHANGER,3],[dvTP_OFFICE_CHANGER,4],[dvTP_OFFICE_CHANGER,5],[dvTP_OFFICE_CHANGER,6],[dvTP_OFFICE_CHANGER,7])
    
    //([vdvDENON_CHANGER_TP,41],[vdvDENON_CHANGER_TP,42],[vdvDENON_CHANGER_TP,43],[vdvDENON_CHANGER_TP,44],[vdvDENON_CHANGER_TP,45])
    
    ([dvTP_CHANGER,41],[dvTP_CHANGER,42],[dvTP_CHANGER,43],[dvTP_CHANGER,44],[dvTP_CHANGER,45])
    
    ([dvTP_OFFICE_CHANGER,41],[dvTP_OFFICE_CHANGER,42],[dvTP_OFFICE_CHANGER,43],[dvTP_OFFICE_CHANGER,44],[dvTP_OFFICE_CHANGER,45])
    

    Seems to have fixed the problem. Thanks everyone for your help.

    Any idea why you can't put the array in the mutually exclusive statement?
  • ericmedleyericmedley Posts: 4,177
    remeolb wrote: »
    I changed the mutually exclusive statement to this...
    DEFINE_MUTUALLY_EXCLUSIVE
    
    //([vdvDENON_CHANGER_TP,1],[vdvDENON_CHANGER_TP,2],[vdvDENON_CHANGER_TP,3],[vdvDENON_CHANGER_TP,4],[vdvDENON_CHANGER_TP,5],[vdvDENON_CHANGER_TP,6],[vdvDENON_CHANGER_TP,7])
    
    ([dvTP_CHANGER,1],[dvTP_CHANGER,2],[dvTP_CHANGER,3],[dvTP_CHANGER,4],[dvTP_CHANGER,5],[dvTP_CHANGER,6],[dvTP_CHANGER,7])
    
    ([dvTP_OFFICE_CHANGER,1],[dvTP_OFFICE_CHANGER,2],[dvTP_OFFICE_CHANGER,3],[dvTP_OFFICE_CHANGER,4],[dvTP_OFFICE_CHANGER,5],[dvTP_OFFICE_CHANGER,6],[dvTP_OFFICE_CHANGER,7])
    
    //([vdvDENON_CHANGER_TP,41],[vdvDENON_CHANGER_TP,42],[vdvDENON_CHANGER_TP,43],[vdvDENON_CHANGER_TP,44],[vdvDENON_CHANGER_TP,45])
    
    ([dvTP_CHANGER,41],[dvTP_CHANGER,42],[dvTP_CHANGER,43],[dvTP_CHANGER,44],[dvTP_CHANGER,45])
    
    ([dvTP_OFFICE_CHANGER,41],[dvTP_OFFICE_CHANGER,42],[dvTP_OFFICE_CHANGER,43],[dvTP_OFFICE_CHANGER,44],[dvTP_OFFICE_CHANGER,45])
    

    Seems to have fixed the problem. Thanks everyone for your help.

    Any idea why you can't put the array in the mutually exclusive statement?

    By the way
    ([vdvDENON_CHANGER_TP,1] .. [vdvDENON_CHANGER_TP,7])

    =

    ([vdvDENON_CHANGER_TP,1],[vdvDENON_CHANGER_TP,2],[vdvDENON_CHANGER_TP,3],[vdvDENON_CHANGER_TP,4],[vdvDENON_CHANGER_TP,5],[vdvDENON_CHANGER_TP,6],[vdvDENON_CHANGER_TP,7])

    it's much easier to type.

    I would think the reason for not allowing arrays in a Mutually_Exclusive is that with a device, you're talking about 'any one item of a given set' That's easy enough to understand. However, with an array cell as one of the 'any one item' the logic gets a little fuzzy.

    For example
    DEFINE_MUTUALLY_EXCLUSIVE
    
    ( [dev_array,1], [dev_array,2] )
    

    So , does this mean:

    A) any of [dev_array,1] equals not(!) 'all of'[dev_array,2]
    in this case any member of the array with channel 1 on will turn off all member's channel 2.

    or

    B) are you inferring a apples-to-apples reference.
    [dev_array[1],1] equals not(!) [dev_array[1],2]
    [dev_array[2],1] equals not(!) [dev_array[2],2]

    What the programmer intends gets a little fuzzy.

    That's just a thought. I don't know for sure.
Sign In or Register to comment.