Sample Python application for Socket Messaging with Fanuc
- R632: Karel (Available by default in R-30iB Plus Controller)
- R648: User Socket Message
- R796: ASCII Program Loader (Optional)
Check the availability of above options by going to MENU -> -- NEXT --
-> STATUS
-> VERSION ID
-> ORDER FI
In this setup, Robot acts as Socket Server and Python Application as Client. Following are the steps to set up Socket Communication in ROBOGUIDE Teach Pendant:
-
Host Communication Setup:
-
Network Setup
- Go to MENU ->
SETUP
->Host Comm
-> TCP/IP - Since ROBOGUIDE Cell uses localhost IP address 127.0.0.1 by default; no need to modify these settings while working locally.
- Go to MENU ->
-
Server Tag Setup
- Go to MENU ->
SETUP
->Host Comm
->[SHOW]
->Servers
-> S8 ->DETAIL
(Select the tag you want to set up for Socket Messaging, here tag 8 is selected) - Set
Protocol
->[CHOICE]
-> SM - Set
Port
-> PORT_NUM (Port Number to be used for Socket Messaging) - Set
Startup State
->[CHOICE]
-> START - Set
[ACTION]
-> DEFINE - Set
[ACTION]
-> START
- Go to MENU ->
-
-
System Variable Setup
- Go to MENU ->
Next
->SYSTEM
->Variables
->$HOSTS_CFG
- Go to the structure element corresponding to the tag selected previously,
[8]
in this case - Set
$SERVER_PORT
-> PORT_NUM (Port Number to be used for Socket Messaging) - If you want to communicate with UDP instead of TCP/IP, set
$USE_UDP
-> TRUE
- Go to MENU ->
For more information, refer to the section 10.3.2 of Fanuc Ethernet Function Operator's Manual
In ROBOGUIDE Window,
- Go to Project -> Add Files. Select and Open the .ls and .kl file from the driver directory. The files can be found in the left pane at Workcell -> Robot Controllers -> Robot Controller1 -> Files
- Right click .kl file and Build the Karel Program
- Right click .ls file and Build the Robot Program
In ROBOGUIDE Teach Pendant,
- Go to SELECT -> SERVER_TEST and Enter
- SHIFT + FWD to Start running the Program
In a Windows Terminal, run
python client.py
Coming Soon...