1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Fanuc Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Controlling Fanuc robot using ethernet/ip and Python

  • silento
  • March 6, 2018 at 1:53 PM
  • Thread is Resolved
  • silento
    Trophies
    3
    Posts
    10
    • March 6, 2018 at 1:53 PM
    • #1

    Hi!

    I'm wondering if it's possible to communicate with my FANUC R-30iB controller using my computer with python over ethernet/ip.

    I want to use the open source computer vision libary in python to create an inspection application using a PoE camera mounted on my M-10iA-12S robot. The PC application should be able to load the correct tp-program, starte the robot and listen if the robot wants to activate the camera. Before purchasing "A05B-2600-R785 R-30iB Softw/ ETHERNET/IP I/O SCAN" which should enable me to communicate over ethernet/ip, I would like to check if any one have any experience using a python script to communicate with a fanuc robot.

    So my question is: Does anyone know or have any experience using python to communcuticate over ethernet/ip with a Fanuc robot? If so, is it possible to starte the robot from the script?

    Thank you guys!

  • Haseeb
    Trophies
    3
    Posts
    13
    • March 6, 2018 at 2:41 PM
    • #2

    There are a few different ways you could program your robot offline. For your application one solution that comes to mind is RoboDK. The basic version of this is free and also has tools to insert your python script.

  • silento
    Trophies
    3
    Posts
    10
    • March 8, 2018 at 1:49 PM
    • #3

    I'm not sure I understand how I can do this offline? Could you please elaborate?

    What I want do to is to listen to, lets say register R[1], from my computer. When the robot changes this to 1 the camera should start taking pictures and when the R[1]=0, stop taking pictures. Maybe there is a easier way?`

    The second thing I want to do, is to trigger and start a given TP-program from the computer. All this should preferably be done using python.

    Thanks!

  • inusO
    Trophies
    3
    Posts
    33
    • March 8, 2018 at 2:27 PM
    • #4

    I worked on a much larger but similar project where I used .net instead of python. I believe Python will work aswell since the fanuc socket interface is low level (you just fill a byte buffer and send it)

  • silento
    Trophies
    3
    Posts
    10
    • March 12, 2018 at 1:53 PM
    • #5

    Ok, thanks inusO! Did you use the socket messaging option for the application?

  • linuxsand
    Reactions Received
    21
    Trophies
    3
    Posts
    40
    • March 13, 2018 at 3:44 AM
    • #6

    Your need [R648] USER SOCKET MSG. And if using TCP/IP, Ethernet/IP is not necessary.

    Code
    FANUC CONTROLLER                                 REMOTE PC
    
    
            +------------------------+                    +------------------------+
            |                        |                    |                        |
            |                        |  +-------------->  |                        |
            |                        |                    |   Your app speaking    |
            |                        |  <--------------+  |   TCP/IP               |
            |                        |                    |                        |
            |                        |                    |                        |
            |  R632: KAREL           |                    |                        |
            |  R648: USER SOCKET MSG |                    |                        |
            |                        |                    |                        |
            |                        |                    |                        |
            +------------------------+                    +------------------------+
    Display More

    http://linuxsand.info/fanuc_tools/

  • silento
    Trophies
    3
    Posts
    10
    • March 13, 2018 at 9:38 AM
    • #7

    Ok, that's great!

    I assume I can use the socket library in python to communicate with the robot over TCP/IP.

    I have requested the R632 and R648 from my supplier, and also the manuals for KAREL and ethernet options. While I'm waiting, maybe some of you could help me a bit more.

    As my PC should run the application it would act as the client, and the robot act as the server. Correct? The server application is writen in karel and should constantly run in the background as a background logic?

    Using the server and client application with socket messaging, is it possible to write and trigger the robot to start a given program from my computer?

    Thanks again!!

  • inusO
    Trophies
    3
    Posts
    33
    • March 13, 2018 at 4:03 PM
    • #8
    Quote

    The server application is writen in karel and should constantly run in the background as a background logic?


    Yes, for your problem the best thing is writing a server in Karel and no, you can't run it on background logic since its purpose is mainly to monitor signals (and you can only run TP code).

    Quote

    Using the server and client application with socket messaging, is it possible to write and trigger the robot to start a given program from my computer?

    Yes, It is possible (check RUN_TASK and related functions on the manual) and you can achieve that by implementing a simple RPC model.

  • silento
    Trophies
    3
    Posts
    10
    • March 21, 2018 at 10:41 AM
    • #9

    The server written in karel, how should it be run if not in BG? autoexec program?

  • inusO
    Trophies
    3
    Posts
    33
    • March 21, 2018 at 3:23 PM
    • #10

    You can run it in background by using karel or tp multitasking features.
    I used to have a tp program that was autoexecuted at robot start which started (by using RUN instruction) 2 karel programs in background (one of those was a karel server)

  • Agajan Torayev
    Reactions Received
    1
    Trophies
    2
    Posts
    1
    • February 14, 2022 at 1:52 PM
    • #11

    Hey,

    This post seems a bit outdated, but I had a similar problem. Hence, I have developed a python package for controlling FANUC robots: https://github.com/torayeff/fanucpy/.

    I hope it will help others who will come to this thread.

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download