UnderAutomation
    • Accueil
  • Produits
    • Universal Robots SDK
    • Fanuc SDK
      • Vue d'ensemble
      • Tรฉlรฉchargement
      • Documentation
        • Overview
        • Get started with .NET
        • Get started with Python
        • Get started with LabVIEW
        • Licensing
        • Enable TELNET on your robot
        • Overview of TELNET interface
        • Read and decode files
        • SNPX
        • Reading & Writing Registers
        • TP editor with breakpoints
        • Move robot with mouse
    • Yaskawa SDK
    • Staubli SDK
    • Devis โ€ข Commande
    • Licence
Une question ?

[email protected]

Contactez-nous
UnderAutomation
  • Accueil
  • Produits
      • Vue d'ensemble
      • Tรฉlรฉchargement
      • Documentation
      • Vue d'ensemble
      • Tรฉlรฉchargement
      • Documentation
      • Vue d'ensemble
      • Tรฉlรฉchargement
      • Documentation
      • Vue d'ensemble
      • Tรฉlรฉchargement
      • Documentation
  • Devis โ€ข Commande
  • Contactez-nous
โŒ˜Q
This page is only available in English.
Fanuc SDK documentation
Get started with .NET
Documentation home
Get started with Python

Get started with Python

Fanuc Python SDK provides a simple and efficient way to control Fanuc robots using Python. No additional installations are required on the robot controller.

  • TL;DR
  • Features
    • 1. Telnet KCL Remote Control
    • 2. High-Speed Data via SNPX (RobotIF)
    • 3. FTP File and Variable Management
  • Robot Configuration
    • Enable Telnet KCL
    • Enable FTP
    • Enable SNPX
  • Installation
    • 1 Clone or Download
    • 2 Connect to Your Robot
  • Compatibility
  • Contributing

๐Ÿš€ TL;DR

  • โœ”๏ธ No PCDK needed: Connect without Fanucโ€™s Robot Interface
  • ๐Ÿ“– Read/write system variables
  • ๐Ÿ”„ Register access for numbers, strings, and positions
  • ๐ŸŽฌ Program control (run, pause, abort, etc.)
  • ๐Ÿ”” Alarm viewing and reset
  • โšก I/O control (UI, UO, GI, GO, etc.)
  • ๐Ÿ” State & diagnostics monitoring
  • ๐Ÿ“‚ FTP file & variable access

No additional robot options or installations are required.


๐Ÿ“Œ Features

๐Ÿ–ฅ๏ธ 1. Telnet KCL Remote Control

Remotely send commands to the robot controller via Telnet KCL.

robot.telnet.reset()
robot.telnet.run("MyProgram")
robot.telnet.pause("MyProgram")
robot.telnet.hold("MyProgram")
robot.telnet.continue_("MyProgram")
robot.telnet.abort("MyProgram", force=True)
robot.telnet.set_variable("my_variable", 42)
robot.telnet.set_variable("$RMT_MASTER", 1)
robot.telnet.set_port("DOUT", 2, 0)
robot.telnet.simulate("DIN", 3, 1)
robot.telnet.unsimulate("DIN", 3)

๐Ÿš€ 2. High-Speed Data via SNPX (RobotIF)

SNPX provides fast, structured data exchange with the robot.

# Read/write position registers
position = robot.snpx.position_registers.read(1)
robot.snpx.position_registers.write(2, {"x": 100, "y": 50, "z": 25})
# Read/write numeric registers
value = robot.snpx.registers.read(1)
robot.snpx.registers.write(2, 123.45)
# Digital signals
ui_1 = robot.snpx.ui.read(1)
robot.snpx.uo.write(3, True)
# Alarms & status
robot.snpx.clear_alarms()
position = robot.snpx.current_position.read_world_position()
user_frame = robot.snpx.current_position.read_user_frame_position(1)

๐Ÿ“‚ 3. FTP File and Variable Management

Transfer files and manage internal robot data via FTP.

# File transfer
robot.ftp.direct_file_handling.upload_file_to_controller("C:/Programs/MyPrg.tp", "md:/MyPrg.tp")
robot.ftp.direct_file_handling.download_file_from_controller("md:/Backup.va", "C:/Backup/Backup.va")
robot.ftp.direct_file_handling.delete_file("md:/OldProgram.tp")
# Variables
variables = robot.ftp.get_all_variables()
for var in variables:
print(f"{var.name} = {var.value}")
# System variables
remote_mode = robot.ftp.known_variable_files.get_system_file().rmt_master
# Safety status
safety = robot.ftp.get_safety_status()
print(f"E-Stop: {safety.external_estop}, TP Enabled: {safety.tp_enable}")
# Position
position = robot.ftp.get_current_position()
print(f"X={position.cartesian.x}, Y={position.cartesian.y}, Z={position.cartesian.z}")

๐Ÿ”ง Robot Configuration

โœ… Enable Telnet KCL

  • Go to SETUP > Host Comm
  • Select TELNET โ†’ [DETAIL]
  • Set a password and reboot

โœ… Enable FTP

  • Go to SETUP > Host Comm > FTP
  • Set username/password
  • Perform a cold start

โœ… Enable SNPX

  • For FANUC America (R650 FRA): Enable option R553 โ€œHMI Device SNPXโ€
  • For FANUC Ltd. (R651 FRL): No additional options required

๐Ÿ›  Installation

1๏ธโƒฃ Clone or Download

This SDK is not on PyPI (yet). Clone this repository and install dependencies :

git clone https://github.com/underautomation/Fanuc.py.git
cd Fanuc.py
pip install -e .

2๏ธโƒฃ Connect to Your Robot

from underautomation.fanuc.fanuc_robot import FanucRobot
from underautomation.fanuc.connection_parameters import ConnectionParameters
robot = FanucRobot()
robot.connect(ConnectionParameters("192.168.0.1"))

๐Ÿ” Compatibility

โœ… Robot Controllers: R-J3iB, R-30iA, R-30iB
โœ… OS: Windows, Linux, macOS
โœ… Python: 3.5+


๐Ÿ“ข Contributing

We welcome your feedback and contributions!

  • Report issues via GitHub Issues
  • Submit pull requests with enhancements
  • Suggest features and improvements
Get started with .NET
Documentation home
Get started with Python

Intรฉgrez facilement les robots Universal Robots, Fanuc, Yaskawa ou Staubli dans vos applications .NET, Python, LabVIEW ou Matlab

UnderAutomation
Contactez-nousLegal
Produits
Universal Robots SDKFanuc SDKYaskawa SDKStaubli SDK
enEnglish
frFranรงais
deDeutsch
esEspaรฑol
zhไธญๆ–‡
jaๆ—ฅๆœฌ่ชž
koํ•œ๊ตญ์–ด

ยฉ All rights reserved.