Home AMX General Discussion

Control an IP device defined to a different master

Dear All,
I need your help about an issue that I recently faced. I have 2 masters connected with M2M. A modero touch panel is connected and defined to the first one ( system 1 ) . The second master ( system 2 ) opens an IP connection with a video switcher.
if we make the below piece of code, that video switcher does not response :


SYSTEM 1


Define_Device

dvTP = 10001:1:1
dvSW = 0:2:2


Define_Event

button_event[dvTP,100]
{
push : send_string dvSW,"'ascii command',13"
}



SYSTEM 2

Define_Device

dvSW = 0:2:2


Define_Constant

IP_Port = 12345


Define_Variable

volatile char IP_Address[] = '192.168.1.100'


Define_Start

ip_client_open( dvSW.port, IP_Address,IP_Port, IP_UDP )



BUT
if we make the below, it works !!


SYSTEM 1


Define_Device

dvTP = 10001:1:1




SYSTEM 2

Define_Device

dvTP = 10001:1:1
dvSW = 0:2:2


Define_Constant

IP_Port = 12345


Define_Variable

volatile char IP_Address[] = '192.168.1.100'


Define_Event

button_event[dvTP,100]
{
push : send_string dvSW,"'ascii command',13"
}



Define_Start

ip_client_open( dvSW.port, IP_Address,IP_Port, IP_UDP )




The only difference is that on the first case the ascii command is sent from the master that the video switcher has not opened the IP communication with while on the second case the command is sent from the master that keeps the IP communication with the switcher.
Is it something that I'm missing about the IP commands between M2M ? Can't a master send a command to an IP device which has been defined to an other master ? This is done with other ports
( RS232, IR, IO )

Thanks in advance,
George

Comments

  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    There's a few things that don't span M2M. I think controlling another masters IP ports is one of them. (DUET module don't like to span M2M)
    You may have to make a virtual device that then routes the strong lcally to the IP port.
  • GregGGregG Just some guy... Posts: 249
    In several jobs I have had to split up the IP connections among masters due to sheer number of connections.

    One of the methods that has worked for me is to put the port 0 device, the IP COMM virtual device, and the IP COMM module code in the remote master. Then use a M2M virtual device to pass data and commands back and forth between the IP COMM virtual and the main logic master.

    The UI part of the control code usually stays in the main master, where the touch panels are typically connected.

    Edit: Simple example (without using COMM modules).

    Master 1 code:
    Define_Device
    
    dvTP = 10001:1:1
    vdvSW = 33001:1:2
    
    
    Define_Event
    
    button_event[dvTP,100]
    {
      push : send_command vdvSW,"'ascii command',13"
    }
    

    Master 2 code:
    Define_Device
    vdvSW = 33001:1:2
    dvSW = 0:3:2
    
    Define_Start
    ip_client_open( dvSW.port, IP_Address,IP_Port, IP_UDP )
    
    Define_Event
    
    Data_Event[vdvSW]
    {
      // Commands from other master go out IP port as strings
      Command: Send_String dvSW,data.text
    }
    Data_Event[dvSW]
    {
      // Strings from IP port go back as strings to other master
      // (due to virtual device command/string reflection)
      String: Send_String vdvSW,data.text
    }
    





Sign In or Register to comment.