Home AMX User Forum NetLinx Studio

Mutually Exclusive in Device Array

Ok gurus, got another question.
I've got a project here at our coporate office. We are part of the TP Control Beta team, and as such wanted to quickly duplicate our panel for testing purposes (without duplicating code of course). Due to previous negative experiences with Define_combine (page flips in code didn't always hit both panels), and due to a suggestion by AMX tech support, I just created a Dev Array for my (2) panels. all worked well. I have now wanted to add a little bit of feedback to the source selection pages as opposed to doing the momentary feedback for button presses. When I express the mutually exclusive table citing the Array as the panel, it doesn't work. The buttons light up, but they don't exclude each other so every button can get lit up. If I do a mutually exclusive of the actual panel page, things work, but the source selection bogs down for some reason. The command takes about 1-2 seconds to go to the Extron switcher vs being pretty instant.
Any thoughts?

Comments

  • mpullinmpullin Posts: 949
    Ok gurus, got another question.
    I've got a project here at our coporate office. We are part of the TP Control Beta team, and as such wanted to quickly duplicate our panel for testing purposes (without duplicating code of course). Due to previous negative experiences with Define_combine (page flips in code didn't always hit both panels), and due to a suggestion by AMX tech support, I just created a Dev Array for my (2) panels. all worked well. I have now wanted to add a little bit of feedback to the source selection pages as opposed to doing the momentary feedback for button presses. When I express the mutually exclusive table citing the Array as the panel, it doesn't work. The buttons light up, but they don't exclude each other so every button can get lit up. If I do a mutually exclusive of the actual panel page, things work, but the source selection bogs down for some reason. The command takes about 1-2 seconds to go to the Extron switcher vs being pretty instant.
    Any thoughts?
    Yes, do away with the Mutually Exclusive. You should be able to decide in code what the currently selected source is, and only highlight the appropriate button if that source is active, not if otherwise, e.g.
    [arrayTP,butSrc[1]] = (nCurrentlyActiveSource == 1);
    [arrayTP,butSrc[2]] = (nCurrentlyActiveSource == 2);
    [arrayTP,butSrc[3]] = (nCurrentlyActiveSource == 3);
    [arrayTP,butSrc[4]] = (nCurrentlyActiveSource == 4);
    [arrayTP,butRoomOff] = (nCurrentlyActiveSource == 0);
    
  • Joe HebertJoe Hebert Posts: 2,159
    When I express the mutually exclusive table citing the Array as the panel, it doesn't work.

    Assuming you have something like this:
    DEFINE_DEVICE
    
    dvTP1 = 10001:1:0
    dvTP2 = 10002:1:0
    
    DEFINE_VARIABLE
    
    DEV	dvTPs[] = {dvTP1,dvTP2}
    

    You can’t do this:
    DEFINE_MUTUALLY_EXCLUSIVE
    
    //You can't do this:
    ([dvTPs,1]..[dvTPs,8])
    

    You have to do this instead:
    DEFINE_MUTUALLY_EXCLUSIVE
    
    ([dvTP1,1]..[dvTP1,8])
    ([dvTP2,1]..[dvTP2,8])
    

    Or this:
    DEFINE_MUTUALLY_EXCLUSIVE
    
    ([dvTPs[1],1]..[dvTPs[1],8])
    ([dvTPs[2],1]..[dvTPs[2],8])
    

    Or get rid of mutually exclusive all together as Matt suggested.
  • alexsquaredalexsquared Posts: 166
    Problem is...I did this
    Joe Hebert wrote: »

    You have to do this instead:
    DEFINE_MUTUALLY_EXCLUSIVE
    
    ([dvTP1,1]..[dvTP1,8])
    ([dvTP2,1]..[dvTP2,8])
    

    And this is what bogged down the source switching.
  • Joe HebertJoe Hebert Posts: 2,159
    Without seeing any relevant code makes it difficult to figure out your problem. To quote Jerry Maguire, “Help me…help you”, and post some code if you can.
  • DHawthorneDHawthorne Posts: 4,584
    I don't use DEFINE_MUTUALLY_EXCLUSIVE for anything but relay output. There are too many quirks and hidden behaviors in buttons ... I think if I knew everything that went on under the hood in button feedback I could make them work, but I've decided it's not worth the effort. So I do what "mpullin" suggested, and put a stack of simple conditionals for button feedback.
  • the8thstthe8thst Posts: 470
    You could also do manual feedback like so:
    define_variable
    
    nSourceBtns[] = {1,2,3,4,5,6,7,8}
    dvTPs[] = {dvTP1,dvTP2,dvTP3,dvTP4}
    
    define_event
    button_event [dvTPs,nSourceBtns]
    {
    	push: {
    		stack_var integer nSource
    		
    		nSource = get_last(nSourceBtns)
    		
    		off[dvTPs,nSourceBtns]                      // turn off all source buttons on all touch panels
    		on[dvTPs,nSourceBtns[nSource]]        // turn on selected source button on all touch panels
    		
    		// do source switching here
    	}
    }
    
Sign In or Register to comment.