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

How to interface and control FANUC CRX from a PC

  • eusandre95
  • November 8, 2024 at 8:11 PM
  • Thread is Unresolved
  • eusandre95
    Posts
    4
    • November 8, 2024 at 8:11 PM
    • #1

    Hi everyone,

    I have a FANUC CRX/20iAL and I'd like to write a script program to interface and control it. I am pretty familiar with programming (like C++, Python and so on) but I am very nooby with industrial robots :).

    Basically my goal is to write a script to trigger program for the Robot from my PC. But I don't know from where to start to do this.

    For example, how can I interface with the robot? Which communication protocol (like TCP or telnet or whatsoever)? And does Fanuc provide any sort of APIs to interface and control its robot? Which programming language should I use to make such a script?

    I know this is very broad question but I'm struggling to find useful resources online so if you can direct me to the proper websites or you have any manual where I can learn this I would really appreciate.

    Thanks in advance to anyone who will help me.

    Edited 2 times, last by eusandre95 (November 15, 2024 at 7:11 PM).

  • 95devils November 8, 2024 at 8:20 PM

    Approved the thread.
  • Nation
    Typical Robot Error
    Reactions Received
    529
    Trophies
    9
    Posts
    1,910
    • November 8, 2024 at 9:00 PM
    • #2

    Do you just want to fire up specific, already programmed paths, or dynamically control the robot?

    If dynamic, how much delay is acceptable?

    You may need to buy some options depending on your answer.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • eusandre95
    Posts
    4
    • November 8, 2024 at 9:21 PM
    • #3

    Hi Nation , thank you for your reply. I will try to give you more context about my situation.

    I have to test a couple of sensors for detecting objects (like detecting obstacles or persons). So we have bought the FANUC robot and we designed brackets to mount these sensors on the robot end effector. Then we designed a couple of programs into the teach pendant made of a sequence of different robot position from which we will trigger the object detection from the sensor. So basically, each program is simply made of a sequence of "reach position" and "wait enough time for the sensor to detect object" and then move to the next position.

    However we can forget for now about the sensors, to which we will interface with separate interfaces, and focus only on robot control.

    So, basically, I simply need to trigger from an external PC the execution of a specific program stored in the robot. To reply to your question, I don't need to dynamically control the robot but simply triggering program execution. That's it.

    Hope I have answered to your reply.

  • sborchshev
    Reactions Received
    1
    Trophies
    2
    Posts
    37
    • November 8, 2024 at 9:42 PM
    • #4

    Fanuc has multiple options to select the program, PNS would be the most common and easy. It uses a binary from designated digital input combination to select the file. So four inputs will give you at least 15 programs to run. PNS0001 to PNS0015. And start signal to start the task.

  • eusandre95
    Posts
    4
    • November 11, 2024 at 5:15 PM
    • #5

    Hello sborchshev and thank you for your reply.

    Could you be more specific and provide more details about your answer? As I told I have almost no knowledge in automation robots so I'd be grateful if you can provide more explanation.

    If you could also share links to websites or other resources from which I can get more information it would be great!

  • Nation
    Typical Robot Error
    Reactions Received
    529
    Trophies
    9
    Posts
    1,910
    • November 11, 2024 at 5:58 PM
    • #6

    Would you be able to list the communication protocols installed on your robot?

    Firing up from the robot from a computer is a bit of a hassle, but should be doable. These robots are typically setup to be fired up from a PLC via an industrial protocol (ethernet/ip, or profinet).

    As far as I am aware, there is no official API for the robot. There is the PCDK, which is an interface to the robot built in vba/c#, but it is an option.

    If you want to do it on the cheap, I think you could set registers via the comm set tool. Monitor those with a background program on the robot, and then fire up the appropriate task.

    If you want to get more complicated, you could buy the user socket messaging option, and the karel option, and send custom commands via TCP/IP or UDP. This would be quite a commitment though.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • sborchshev
    Reactions Received
    1
    Trophies
    2
    Posts
    37
    • November 11, 2024 at 9:12 PM
    • #7
    Quote from eusandre95

    Hello sborchshev and thank you for your reply.

    Could you be more specific and provide more details about your answer? As I told I have almost no knowledge in automation robots so I'd be grateful if you can provide more explanation.

    If you could also share links to websites or other resources from which I can get more information it would be great!

    6.6.2 Automatic Operation with Program Number Selection (PNS) The program number selection (PNS) function enables selection or checking of a program, using the peripheral I/O, from the remote controller. Eight input signals, PNS1 to PNS8, specify a PNS program number. Procedure 6-15 Automatic operation by program number selection Condition • PNS setting must be completed (See Subsection 3.8.2). • The remote condition must be satisfied. • The operation enable condition must be satisfied. • No one must be within the work area. There must be no obstacles. WARNING Start automatic operation as follows: When the robot starts operation, an unexpected situation may occur. To prevent any problem from occurring, be sure to check that no one is in the work area, that the work area is free from unnecessary equipment, that the safety barrier is in place, and that all the automatic operation conditions are correctly specified. Otherwise, the robot may injure a person or damage the equipment in the work area. Step 1 Turn off the teach pendant enable switch. 2 Place the system in remote mode. (For how to switch to remote mode, see the description of Remote/Local setup in Section 3.15, ”SYSTEM CONFIG MENU”.) 3 Send the program number selection signals (PNS1 to PNS8 inputs) indicating a target PNS number and the PNS strobe signal (PNSTROBE input) to the controller. A PNS program is then selected. The controller outputs the selected program number signals (SNO1 to SNO8 inputs) and PNS acknowledge signal (SNACK output) for confirmation. 4 Send an external start signal (PROD_START input). The selected program is then started. 5 To stop the program currently being executed, use the emergency stop button or hold button, or the immediate stop (*IMSTP input), hold (*HOLD input), or cycle stop (CSTOPI input) signal. B-83284EN/11 6. EXECUTING A PROGRAM - 431 - 6 To restart a halted program, use the external start signal (START input)


    Get an operator manual (Basic Function) from Fanuc portal. It has full explanation. Like I said PNS is the easiest ones if you need remote program selection.

  • hermann
    Reactions Received
    405
    Trophies
    9
    Posts
    2,596
    • November 12, 2024 at 8:34 AM
    • #8
    Quote from sborchshev

    .. Like I said PNS is the easiest ones if you need remote

    But he has a PC to control the robot. So he needs something like soft PLC to communicate over a bus protocol. Or may be he can use modbus tcp, that's the only protocol I know that's easy usable for small money (even no money) on a PC. But I doubt that fanuc has that option, and it's unlikely that he has that option already installed.

  • sborchshev
    Reactions Received
    1
    Trophies
    2
    Posts
    37
    • November 12, 2024 at 12:06 PM
    • #9

    That is what I was saying, would be easier to use built in function for program switching. And use relay I/O module that can be connected to PC via any protocols OP choose.

  • pdl
    Reactions Received
    266
    Trophies
    9
    Posts
    1,508
    • November 12, 2024 at 7:17 PM
    • #10

    How about Telnet?

    All that's needed to do on the robot side is to set a password for the KCL user.

    Once logged in, you can issue any KCL command that you wish. I don't see why this couldn't be automated with a script, isn't that what Telnet was built for? :grinning_face_with_sweat:

  • eusandre95
    Posts
    4
    • November 15, 2024 at 7:09 PM
    • #11

    Thanks to everyone who provided replies! I really appreciate all of them!

    pdl I like your solution! Seems to be very easy and suitable for what we need to do.

    Let me try to recap what you are suggesting, to verify I understood your idea:

    1. Connect an external PC to the robot controller via an ethernet cable.
    2. Put the PC in the same subnet of the Robot controller.
    3. Set $RMT_MASTER = 1.
    4. In SETUP > HOST COMM > Telnet set password for KCL user.
    5. Connect the PC using telnet and logging with credentials previously set on the robot.
    6. Start a program using RUN KCL command. (like RUN <program name>)

    Is my understanding correct?

    Then, if this approach works, I should be able to put the telnet connection and the KCL command inside a script (like a Python script) and use it to do the same thing. Correct?

    I have only a final question, do I need to have any specific software option from FANUC to be able to apply this idea?

  • pdl
    Reactions Received
    266
    Trophies
    9
    Posts
    1,508
    • November 15, 2024 at 11:53 PM
    • #12
    Quote from eusandre95

    Is my understanding correct?

    YES

    Then, if this approach works, I should be able to put the telnet connection and the KCL command inside a script (like a Python script) and use it to do the same thing. Correct?

    YES

    I have only a final question, do I need to have any specific software option from FANUC to be able to apply this idea?

    Not that I am aware of, as long as it has an Ethernet port, it should be good to go. Ethernet ports have been standard since the RJ3iB was released.

    If you have RoboGuide, you can use that to debug KCL commands:

    The KCL terminal in RoboGuide is accessed through the windows Robot menu:

    But first you need to perform a controlled start on the virtual robot and then change the port settings under MENU > 7 Port Init:



    Make sure to set one of the ports to a KCL port:

    Enjoy!

  • steveza
    Trophies
    1
    Posts
    3
    • January 6, 2025 at 10:15 PM
    • #13

    Thank you this is helpful. So extending this idea, could telnet be used to send movement commands for Karel to execute on the Robot? So would it be practical to run 6 axis gcode this way? I have R636 (Karel socket messaging) not R632 user socket messaging. I have TELNet R641 and J770 (PC interface and Intelligent PC Interface)

  • Alfred
    Reactions Received
    7
    Trophies
    2
    Posts
    16
    • January 21, 2025 at 5:17 PM
    • #14
    Quote from eusandre95

    I have only a final question, do I need to have any specific software option from FANUC to be able to apply this idea?

    Correct. If you are looking for the procedure to correctly set up TELNET, you can take a look at this library which does what you want to do:


    UnderAutomation : Fanuc SDK
    Discover UnderAutomation's software libraries to easily integrate industrial robots (Universal Robots, Fanuc, Yaskawa, Staubli) into your .NET, Python, LabVIEW…
    underautomation.com

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

  • CRX Plugin Error

    • crblake
    • September 29, 2022 at 4:52 PM
    • Fanuc Robot Forum
  • Interface the SICK safeRS3 Radar system with the FANUC CRX

    • Tech
    • June 18, 2024 at 2:42 PM
    • Fanuc Robot Forum
  • Are higher-level proprietary programming languages bad for developing programming skills?

    • IsaacMaw1
    • May 11, 2024 at 5:31 PM
    • General Discussion of Industrial Robots Only
  • Does anyone know about the operating system of fanuc robot?

    • Chander_hxj
    • July 28, 2017 at 6:42 AM
    • Fanuc Robot Forum

Tags

  • Fanuc
  • Programming
  • CRX-20iA/L
  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