Home AMX User Forum AMX General Discussion
Options

Switcher Example

Hello,

I can't figure out the best approach to building a function that would execute a string for matrix switching. I have a 16x16 that will be utilize all 16ins and all 16outs. Id like the ability to send multiple inputs to multiple outputs without using a take button.

I programmed a panel in P2 that had the ability to send a single input to multiple outs, but that example is useless in this scenario. I'd also like to eliminate the "take" button.

Is this possible?

Thank you,
Matt

Comments

  • Options
    What is the switcher?

    Send_String dvSwitcher, "'1*1!1*2!1*3!1*4!', $0D";

    You could write a Switcher function that returns a string and takes an Integer, Integer Array and an Integer for Out Count as params.

    Define_Function Char[100] GetSwitcherString(Integer In, Integer Out[], Integer Count)
    {
    Stack_Var Char Result[100];
    Stack_Var Integer i;

    //build the string
    Result = '';
    for ( i = 1; i <= Count; i++ )
    {
    if ( Out )
    {
    Result = "Result, itoa(In), '*', itoa(i), '!'";
    }
    }
    Result = "Result, $0D";

    return Result;
    }
  • Options
    mjones2620mjones2620 Posts: 86
    What is the switcher?

    Send_String dvSwitcher, "'1*1!1*2!1*3!1*4!', $0D";

    You could write a Switcher function that returns a string and takes an Integer, Integer Array and an Integer for Out Count as params.

    Define_Function Char[100] GetSwitcherString(Integer In, Integer Out[], Integer Count)
    {
    Stack_Var Char Result[100];
    Stack_Var Integer i;

    //build the string
    Result = '';
    for ( i = 1; i <= Count; i++ )
    {
    if ( Out )
    {
    Result = "Result, itoa(In), '*', itoa(i), '!'";
    }
    }
    Result = "Result, $0D";

    return Result;
    }

    Thank you,

    It's an Extron Crosspoint 16x16
  • Options
    The Out Integer array is simply a True or False Value;
    i.e.

    In = 1;
    Count = 8;

    Out[1] = False;
    Out[2] = False;
    Out[3] = True;
    Out[4] = False;
    Out[5] = False;
    Out[6] = True;
    Out[7] = False;
    Out[8] = True;

    Would have:
    Result = "'1*3!1*6!1*8!', $0D";

    I would make Out an array of structures to indicate AUDIO_VIDEO, AUDIO_ONLY, VIDEO_ONLY, maybe even a switcher Type (SIS, BCS, etc)

    There are all kinds of things you can do to make this flexible to handle almost any kind of switch also handle creating disconnects as well.
  • Options
    mjones2620mjones2620 Posts: 86
    The Out Integer array is simply a True or False Value;
    i.e.

    In = 1;
    Count = 8;

    Out[1] = False;
    Out[2] = False;
    Out[3] = True;
    Out[4] = False;
    Out[5] = False;
    Out[6] = True;
    Out[7] = False;
    Out[8] = True;

    Would have:
    Result = "'1*3!1*6!1*8!', $0D";

    I would make Out an array of structures to indicate AUDIO_VIDEO, AUDIO_ONLY, VIDEO_ONLY, maybe even a switcher Type (SIS, BCS, etc)

    There are all kinds of things you can do to make this flexible to handle almost any kind of switch also handle creating disconnects as well.

    How can I route multiple inputs to multiple outputs? I just don't see where your example places me there. I'd like to be able to route any of my multiple inputs to multiple screens/projectors...
  • Options
    nickmnickm Posts: 152
    Call multiple instances of the function. For instance:
    BUTTON_EVENT [dvTP,1] {
      PUSH : {
        SEND_STRING dvSwitcher,"GetSwitcherString(1,nOutputs,4)"
        SEND_STRING dvSwitcher,"GetSwitcherString(3,nOutputs,3)"
        SEND_STRING dvSwitcher,"GetSwitcherString(5,nOutputs,6)"
      }
    }
    

    In this case, Extron switchers are very tolerant of back to back strings being sent. So you shouldn't have a problem. However, for future cases, you would want to look into Queuing the commands.
  • Options
    TonyAngeloTonyAngelo Posts: 315
    If you want to eliminate the "take" button, then eliminate the take button. Every time someone presses an output button send the currently selected input to it.
  • Options
    HedbergHedberg Posts: 671
    TonyAngelo wrote: »
    If you want to eliminate the "take" button, then eliminate the take button. Every time someone presses an output button send the currently selected input to it.

    Or do it backwards: whenever an input is selected, route that input to all currently selected outputs. Seems that he desires to be able to send an input to multiple outputs without a take button. So, allowing for the selection of multiple outputs seems in order. Whenever an input is selected, do the route and clear the list (of whatever) of all selected outputs.

    Seems he wants the ability to route multiple inputs at once. I don't see how this works without programming a list/compound write string and using a take button to signal completion.
Sign In or Register to comment.