I would like to use socket messaging to communicate from an application running on a PC connected to my LAN to my robot program running on the virtual controller (running on the same PC or a different PC also connected to my LAN).
How do I get the Virtual Controller’s IP Address so I can bind a socket to it?
How do I connect the Virtual Controller to my LAN?
If you have both server and client on the same PC use the 127.0.0.1 localhost.IF you use you rapid code on both use this code snippert that checkes if the controller is a VC or not
IF ROBOS() THEN (true if is a real controller. False if it is a VC
SocketConnect my_socket, “163.34.138.153”, 8888Time:=10;
Bl_SocketConnected := TRUE;
Num_VisionAlarmNo := 0;
ELSE
SocketConnect my_socket, “127.0.0.1”, 8888Time:=10;
Bl_SocketConnected := TRUE; Num_VisionAlarmNo := 0;
ENDIF