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

FANUC Robot - PC: Communication protocols

  • tboekhorst
  • October 27, 2020 at 6:28 PM
  • Thread is Unresolved
  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • October 27, 2020 at 6:28 PM
    • #1

    Hello there,

    Let me introduce myself, I am a student Industrial Automaton currently in my junior year.

    I am working on a project with the following equipment from FANUC:

    FANUC Robot LR Mate 200iC/5L

    R30iA Mate Controller - Software version 7.70

    PC Windows 10 - Python app

    I want to read the robot position in the world-coordinate system (preferably as soon as possible). By means of these values I will make calculations to make another machine sync with the robot.

    I have already searched a bit about the communication protocols: Modbus TCP/IP, Ethernet/IP or Communication via Socket Messaging TCP/IP. I know some options require a license, this is not a problem.

    My question is:

    1) Which protocol is best to use if I want to send information from the robot to an application in Python on my PC?

    2) Another approach will be: Sending position data to the robot. Is this easier to get done?

    Thanks in advance.

  • tboekhorst October 27, 2020 at 6:47 PM

    Changed the title of the thread from “FANUC Robot Communication protocols” to “FANUC Robot - PC: Communication protocols”.
  • Fabian Munoz
    Reactions Received
    133
    Trophies
    9
    Articles
    1
    Posts
    1,517
    • October 27, 2020 at 8:11 PM
    • #2

    Hi

    Do some searching under EXPLICIT MESSAGING . You can read the coord directly from memory

    or

    Search for this $ SCR_GRP [1]. $ MCH_POS_X . This is the variable that contains the position X.

    Check for advantages and disadvantages

    Retired but still helping

  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • October 27, 2020 at 11:25 PM
    • #3

    Thanks for the reaction Fabian Munoz.

    I found sending group outputs XYZ WPR coordinates:

    GO[1:X POS]=($SCR_GRP[1].$MCH_POS_X*10)

    GO[2:Y POS]=($SCR_GRP[1].$MCH_POS_Y*10)

    GO[3:Z POS]=($SCR_GRP[1].$MCH_POS_Z*10)

    GO[4:W ANG]=($SCR_GRP[1].$MCH_POS_W*100)

    GO[5:P ANG]=($SCR_GRP[1].$MCH_POS_P*100)

    GO[6:R ANG]=($SCR_GRP[1].$MCH_POS_R*100)

    Note that I’ve multiplied the X, Y, and Z positions by 10, so Iwill have to divide by 10 in my PC program. Likewise I multiplied the W, P, and R angles by 100, so divide by 100.

    Run this as a program in the background with BG Logic.

    However in which way can I send the data to my PC?

  • HawkME
    Reactions Received
    568
    Trophies
    10
    Posts
    3,268
    • October 28, 2020 at 12:48 AM
    • #4

    How often and how quickly do you need to read/write data?

    With a PC you will probably need to stick with protocols such as tcp/ip or Http. Modbus and Ethernet/Ip are typically done with a PLC.

  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • October 28, 2020 at 8:14 AM
    • #5

    Thanks HawkME for the anwswer.

    Important note that I forgot to mention.

    Firstly I want to try only writing the position data of the robot 'as fast as possible', so +- every 8ms from FANUC to PC.

    1 ) Is it possible to send GO (Group Outputs) with TCP/IP, Socket Server Messaging?

    Therefore will need a KAREL script if I am not mistaking.

    R648 - User Socket Messaging

    R632 - KAREL

    2) What about using CRMA15 (CRMA62) and CRMA16 (CRMA63)?

    Or is this only for DI/DO?

    Edited once, last by tboekhorst (October 28, 2020 at 9:47 AM).

  • HawkME
    Reactions Received
    568
    Trophies
    10
    Posts
    3,268
    • October 28, 2020 at 11:51 AM
    • #6

    8ms is pretty fast. I think socket messaging with karel is the right option for this but I have not done it myself. Others on the forum can chime in if you have more questions.

    1. You don't want GOs. Those are max of 16 bit Integers. Instead you will want to read a register value.

    2. DI/DO only. Not what you want either.

    You will want to either read the position system variable directly or first store it in a register then read it from there.

  • HawkME
    Reactions Received
    568
    Trophies
    10
    Posts
    3,268
    • October 28, 2020 at 12:15 PM
    • #7

    I just now realized you said "write" not "read". Reading position will be easier. If you write position data that implies you want the robot to move to that position. You could do that by writing a position to registers then triggering the robot to move to that position in a TP program.

  • DaveP
    Reactions Received
    23
    Trophies
    4
    Posts
    199
    • October 28, 2020 at 1:07 PM
    • #8

    Check out this thread for using the pyModbus library for using Python and Modbus TCP to communicate between a robot and a PC. We have the HMI (SNPX) option in our robots that allows for Modbus TCP comm. Assuming you can also use the Modbus TCP option.

  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • October 28, 2020 at 1:52 PM
    • #9
    Quote from tboekhorst

    I want to read the robot position in the world-coordinate system (preferably as soon as possible). By means of these values I will make calculations to make another machine sync with the robot.

    Sorry for not clearifing enough.

    I made a brief summory:

    If read the robot positioning to PC:

    You will want to either read the position system variable directly or first store it in a register then read it from there.

    If writing the robot positioning from PC:

    You could do that by writing a position to registers then triggering the robot to move to that position in a TP program.

    Option 1) EXPLICIT MESSAGING

    Option 2) Tcp/ip or Http, User Socket Messaging

    Option 3) Using the pyModbus library for using Python and Modbus TCP to communicate between a robot and a PC. However, hawkME is telling TCP Modbus is typically done with a PLC.

    I will look into this. Thanks for your help so far.

    This morning I was in contact with a fanuc engineer, explained the situation and he advised to use FANUC Linetracking software and hardware.

    Any thoughts?

  • HawkME
    Reactions Received
    568
    Trophies
    10
    Posts
    3,268
    • October 28, 2020 at 3:22 PM
    • #10

    I wasn't aware of the PyModbus library. That sounds like a viable option as well.

    Linetracking is for coordination of robot motion with a moving conveyor. You didn't really tell us what your application is so I can't comment on if that would be helpful.

  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • November 3, 2020 at 10:28 PM
    • #11

    Let me explain to you what kind of system is involved. It is called a flexible transport system (FTS).

    see the following video: FTS

    The robot must be synchronized with a carrier of this FTS system. Imagine that the track is in a cirkle like in the video (also see attachment). The robot is attached to the platform and must rotate a semicircle with a carrier of FTS from point A to B. When the movement is finished it goes back to point A and waits for a new carrier.

    Eventually the robot will have to perform a specific movement (depends on the customer), but for now I want to have the robot arm running synchronize with the carrier (from A to B) at all times.

    What do you think could be a valuable option to make this work?

    Images

    • pasted-from-clipboard.png
      • 125.65 kB
      • 529 × 293
      • 14
  • HawkME
    Reactions Received
    568
    Trophies
    10
    Posts
    3,268
    • November 4, 2020 at 7:18 PM
    • #12

    By synchronized do you mean that the robot and the carriage can be moving at the same time relative to each other (complex).

    Or do you mean the carrier will move to a location, stop, then the robot will does something. Then the carrier will start moving again when the robot action is complete. (simple).

  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • November 4, 2020 at 7:58 PM
    • #13
    Quote from HawkME

    By synchronized do you mean that the robot and the carriage can be moving at the same time relative to each other (complex).

    Thanks for your reply HawkME and for thinking along.

    This is exactly what I have in mind. It is indeed quite complex.

    Currently, I have achieved synchronisation based on IO, I will give the robot and carrier a start signal and both will follow the track at the same speed. However, of course this is not really synchronous.

    Edited 2 times, last by tboekhorst (November 4, 2020 at 8:05 PM).

  • HawkME
    Reactions Received
    568
    Trophies
    10
    Posts
    3,268
    • November 5, 2020 at 4:12 AM
    • #14

    I don't think this will be a slam dunk but there are a couple options. You could to choose a leader and a follower.

    Option 1. Robot is the leader and just runs its program. You read the robots current position and command the carrier to speed up or slow down to sync up with it.

    Option 2. Carrier is the leader and you use something like the streaming motion option or dynamic path mod to command the robot position.

    Option 3. No leader. You break up the paths of both Carrier and robot into segments and do an IO handshake at each segment. If one of them doesn't get the handshake they stop and sync up again.

    In order of complexity i would say 3 would be easy but may not perform the way you want.

    1 might be easier than 2 depending on how hard it is to program dynamic movement on the carrier.

    2, is possible but I have no personal experience with. I only have read about.

  • Sergei Troizky
    Reactions Received
    67
    Trophies
    6
    Posts
    650
    • November 5, 2020 at 9:49 PM
    • #15

    I don't see AB points on the picture.

    Do I understand correctly, that the robot has to follow the conveyor only on semicircle?

    If so, this is a clear case for circular linetracking.

    Do it well right away. It will become bad by itself.

  • Famous_Fella
    Reactions Received
    25
    Trophies
    4
    Posts
    131
    • November 6, 2020 at 10:22 AM
    • #16

    Your best bet would be using KAREL Socket Messaging function to send and recieve positional data to and from the robot with .csv file manipulation but

    you will never succeed at fully syncronizing the robot with the carrier. You could spend hours of testing and fine-tuning how many positions to send and stream and when (based on the calculated latency of the network you made between the robot the controller and the carrier) and come to a solution where you have almost syncronized them only to realize that a small flood in network traffic between the two, a sudden crash on the PC handling the streaming, a sudden change in its RAM available capacity will desync them. There is a reason why PCs are not used (or shouldn't be used) in production environments, they are unstable, they crash, they overload their RAM they do things in the background that we dont want them to do.

    You could also use ROS-Industrial framework since you are adept with python but keep in mind that by streaming positional data to the robot, you effectively cripple big time the robot's motion planner which is a pretty sofisticated piece of software. In fact this is where the big money goes when buying a robot. you should expect occasional jerks and judders, missed positions (due to latency) from time to time although not really often, but imo all those solutions are what I call "Leeroy Jenkins" projects, they rarely comply with the basic safety standards a robotic application must meet when installed in a production environment.

    I would stick with the FANUC solution.

  • HawkME
    Reactions Received
    568
    Trophies
    10
    Posts
    3,268
    • November 6, 2020 at 12:15 PM
    • #17

    I didn't realize there was a circular line tracking option available. If so that would be a truely synchronized Fanuc option.

    I also agree with ps0f0r, any of the 3 solutions I posted above will have latency effects that will cause some jerkiness. Without knowing the details of your process its hard to say what will actually work.

  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • November 6, 2020 at 2:56 PM
    • #18

    Thank you all for thinking along.

    FTS is a complex system that accurately determines its position based on MR sensors (0.1 micrometer accuracy). It can be controlled via Python by providing a position reference in position unit (pu = 1 micrometer). For example, the track is scaled from 0 to 80 000 pu (a circular or straight track does not matter. In the FTS software the track is plotted in a real number), give value 10 000 and the carrier of FTS will go to this possition very accurately.

    Quote from Sergei Troizky

    I don't see AB points on the picture.

    Do I understand correctly, that the robot has to follow the conveyor only on semicircle?

    If so, this is a clear case for circular linetracking.

    Correct. I didn't draw the points in the picture, but that is the correct way of thinking.

    The robot only has to follow the carrier on the FTS track on the half cirkle of the track.

  • hermann
    Reactions Received
    404
    Trophies
    9
    Posts
    2,595
    • November 6, 2020 at 3:38 PM
    • #19

    The normal way to do that task is using linetracking.

    Circular linetracking is possible, but only linear movements in the robot are allowed in that case.

    You need an external encoder for the track (FTS), that's connected direct to the robot controller.

    Think the other discussed solutions will be not a good option, because you should have access to the path planning procedures in the robot, preferably in the interpolation cycle. That will be impossible in TP or Karel programs.

    You will always have latency problems.

    May be there are some sensor options that allow access to the internal path planning within the interpolation cycle.

  • tboekhorst
    Reactions Received
    3
    Trophies
    2
    Posts
    24
    • November 11, 2020 at 12:16 PM
    • #20

    Thank you all for thinking along.

    I checked all the options above. With our team we came to the conclusion that we want to configure the robot as a master and FTS as a slave. The FTS system can make very accurate movements, and is therefore better able to serve as a slave of the robot. The FTS system has a camming and gearing functionality which I will not bother you with.

    So we are going to focus on getting the position data from the robot to a PC application (python) via TCP/IP.

    On the Robot Controller we have the following functionality:

    - R648 Socket User Msg

    The PC already has a connection by means of TCP/IP and can read the current position of the robot via the web server. If there are any more tips on how to get the robot position data I would like to hear that. Otherwise thank you very much for your help.

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

Similar Threads

  • Dynamic control of FANUC Robot in Run-Time

    • Gokul N A
    • July 3, 2019 at 10:39 AM
    • Fanuc Robot Forum
  • Group entrance - coordinates

    • Stest69
    • May 22, 2020 at 11:46 AM
    • Fanuc Robot Forum
  • Communication between Schneider PLC and Fanuc robot

    • mathias drapier
    • May 16, 2019 at 9:09 AM
    • Fanuc Robot Forum
  • Communication with PC

    • Velcro
    • May 18, 2018 at 8:55 PM
    • Fanuc Robot Forum
  • Fanuc with Omron and Micrologix

    • Qvixote_Roux
    • August 12, 2017 at 9:44 PM
    • Fanuc Robot Forum

Tags

  • Fanuc
  • r30ia mate
  • IO
  • protocol
  • Communication
  • Python
  • realtime
  • GO
  • Group Output
  • PC
  • Fanuc robot lr mate 200iC
  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