Control an IP device defined to a different master
George Krietsepis
Posts: 284
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
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
0
Comments
You may have to make a virtual device that then routes the strong lcally to the IP port.
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:
Master 2 code: