Home AMX User Forum AMX Technical Discussion
Options

Master To Master help

I have a NI-4100 that controls a centralized Videoconference unit and matrix switcher. I have 6 room each with NI-4100s that request the use of the centralized Videoconf unit and have the to and from audio/video switched to it if it is not locked out by another room. The control works fine via RS422 comm from each unit, however I would like to see about switching to IP control between the units to free up a comm port for other devices. I understand I have to have each processor assigned a different system # but I am confused on the code setup to send and receive the strings via IP instead of Serial. Thanks

Comments

  • Options
    Spire_JeffSpire_Jeff Posts: 1,917
    Just create a virtual device in each master and then you can define the same devices in the central processor. Something like:
    Proc 1
    define_device
    vdvM2M_1   =    36000:1:0
    vdvM2M_Main = 36000:1:10
    
    Proc 2
    define_device
    vdvM2M_2   =    36000:1:0
    vdvM2M_Main = 36000:1:10
    
    Proc 3
    define_device
    vdvM2M_3   =    36000:1:0
    vdvM2M_Main = 36000:1:10
    
    Proc 4
    define_device
    vdvM2M_4   =    36000:1:0
    vdvM2M_Main = 36000:1:10
    
    Proc 5
    define_device
    vdvM2M_5   =    36000:1:0
    vdvM2M_Main = 36000:1:10
    
    Proc 6
    define_device
    vdvM2M_6   =    36000:1:0
    vdvM2M_Main = 36000:1:10
    
    
    Central Processor
    define_device 
    vdvM2M_1   = 36000:1:1
    vdvM2M_2   = 36000:1:2
    vdvM2M_3   = 36000:1:3
    vdvM2M_4   = 36000:1:4
    vdvM2M_5   = 36000:1:5
    vdvM2M_6   = 36000:1:6
    vdvM2M_Main = 36000:1:0
    
    
    define_event
    data_event[vdvM2M_1]{
       STRING:{
       //Process String events from Processor 1.
      }
    }
    data_event[vdvM2M_2]{
       STRING:{
         //Process String events from Processor 2. 
       }
    }
    
    
    .
    .
    . 
    and so on.
    
    button_event[dvTP1,1]{
      PUSH:{
       send_string vdvM2M_1,"'Switch to Input 2'";
      }
    }
    

    You can send and receive both COMMANDs and STRINGs on the virtual devices. You can also handle button_events and channel_events on the virtual devices, but make sure that you call tech support to verify the firmware you are running does not have problems with channel events on virtual devices.

    Also, make sure that the URL listings are setup properly so that all of the masters are able to talk with each other.

    Hope this helps,
    Jeff
  • Options
    bhennbhenn Posts: 3
    Master to Master

    Thanks for your help, that should do it.
  • Options
    RVanceRVance Posts: 14
    bhenn wrote: »
    but I am confused on the code setup to send and receive the strings via IP instead of Serial.

    Hope this is what you're looking for, and hope it helps.
    DEFINE_DEVICE
    dvCodec = 0:4:0  // Define your device on the master's network device range
    
    DEFINE_CONSTANT
    INTEGER nCodecPort = 23  // the port should be listed in the codec protocol manual, 23 is standard telnet
    CHAR sCodecIP[] = '192.168.100.100'  // the IP address of the codec
    INTEGER TCP = 1
    INTEGER UDP = 2
    
    DEFINE_START
    IP_CLIENT_OPEN (dvCodec.port, sCodecIP, nCodecPort, TCP)
    // You have to attempt to establish connection in startup, or in another device's online event because
    // this devices online event won't get triggered until the TCP socket has been established
    
    DEFINE_EVENT
    DATA_EVENT[dvCodec]
    {
        ONLINE:
        {
            // When the connection is established, the online event will trigger, unlike on a serial device
            // where the online event is triggered when the AMX card / master / etc. comes online
            // Once the device is online, you send control strings in the regular fashion, unless your
            // particular device has a completely separate protocol for IP control
        }
        ONERROR:
        {
            // You can add some error handling in case the connection does not happen
        }
        OFFLINE:
        {
            // If the TCP socket is closed, the offline event will be triggered
        }
        STRING:
        {
            // Once connection is established, if the device sends responses, you'll get them in the
            // string event as usual
        }
    }
    
    BUTTON_EVENT[dvTP, nCodecPowerOn]
    {
        PUSH:
        {
            SEND_STRING dvCodec, sPowerOnCmd  // Your device's command for power on
        }
    }
    
Sign In or Register to comment.