UnderAutomation
¿Una pregunta?

[email protected]

Contactos
UnderAutomation
⌘Q
This page is only available in English.

FTP overview

FTP provides access to internal controller files including variables, programs, diagnostics, safety status, and current position.

  • Key features
  • Quick example
  • Connection
  • Limitations
  • Next steps
  • API reference

FTP (File Transfer Protocol) provides direct access to the Fanuc controller's internal file system. The SDK uses FTP to transfer files (programs, backups) and to read and decode diagnostic data, variables, registers, and safety status.

Key features

  • File management: Upload, download, delete, rename files and directories
  • Variable reading: Read all system variables in bulk from .va files
  • Registers: Read numeric, position, and string registers
  • Diagnostics: Safety status, I/O state, current position, error history
  • Installed features: Detect available options on the controller

Quick example

using UnderAutomation.Fanuc;
using UnderAutomation.Fanuc.Common.Files.Diagnosis;
public class Ftp
{
static void Main()
{
// Create a new Fanuc robot instance
FanucRobot robot = new FanucRobot();
// Set connection parameters
ConnectionParameters parameters = new ConnectionParameters("192.168.0.1");
parameters.Ftp.Enable = true;
parameters.Ftp.FtpUser = "user";
parameters.Ftp.FtpPassword = "ftp password";
// Connect to the robot
robot.Connect(parameters);
IOState ioState = robot.Ftp.GetIOState();
// Read a variable
var variableFiles = robot.Ftp.GetAllVariables();
foreach (var variableFile in variableFiles)
foreach (var variable in variableFile.Variables)
Console.WriteLine($"{variable.Name} = {variable.Value}");
// Read system variable $RMT_MASTER
int remoteMode = robot.Ftp.KnownVariableFiles.GetSystemFile().RmtMaster;
// Read safety status
SafetyStatus safetyStatus = robot.Ftp.GetSafetyStatus();
Console.WriteLine($"Emergency Stop: {safetyStatus.ExternalEStop}");
Console.WriteLine($"Teach Pendant Enabled: {safetyStatus.TPEnable}");
// Get current position for each arm (Joints, World position of each tool, user frame positions)
CurrentPosition currentPosition = robot.Ftp.GetCurrentPosition();
// Upload a TP program to the controller
robot.Ftp.DirectFileHandling.UploadFileToController(@"C:\Programs\MyPrg.tp", "md:/MyPrg.tp");
// Download a file from the robot
robot.Ftp.DirectFileHandling.DownloadFileFromController("md:/Backup.va", @"C:\Backup\Backup.va");
// Delete a file on the robot
robot.Ftp.DirectFileHandling.DeleteFile("md:/OldProgram.tp");
}
}

Connection

static void Main()
{
// Via FanucRobot
var robot = new FanucRobot();
var parameters = new ConnectionParameters("192.168.0.1");
parameters.Ftp.Enable = true;
parameters.Ftp.FtpUser = ""; // usually empty
parameters.Ftp.FtpPassword = ""; // usually empty
parameters.Ftp.FtpTimeoutMs = 30000; // optional, default is 30 seconds
robot.Connect(parameters);
// Or standalone
var ftp = new FtpClient();
ftp.Connect("192.168.0.1", "", "");
}
}
Click to see the full code

The FtpTimeoutMs property controls the connection, read, and data transfer timeouts. The default is 30,000 ms (30 seconds). Lower it for faster failure detection on unreachable controllers, or raise it for slow networks.

Limitations

  • Read-only for most data: Variables and diagnostics are read-only via FTP. Use Telnet, SNPX, or CGTP to write values
  • Slower than SNPX: FTP transfers entire files rather than individual values
  • No real-time data: Data represents a snapshot at the time of the FTP request

Next steps

  • File management : Upload, download, delete files
  • Diagnostics & variables : Safety status, registers, variables

API reference

Class
FtpClientinherits FtpClientBase
C#Python

FTP Client connection to a robot

MemberTypeDescription
FtpClient()
Constructor
Instanciate a new FTP client connection
Connect(string, string, string, int, int)
Method
void
Connect to a robot
  • ip : IP or network name of the robot
  • user : FTP username
  • password : FTP password for username
  • port : FTP port
  • timeoutMs : FTP connection timeout in milliseconds
Class
FtpClientBaseinherits FileClientBase
C#Python

Base class for FTP features

MemberTypeDescription
Connected
Property
read only
bool
Indicates that FTP connection is active
DirectFileHandling
Property
read only
FtpDirectFileHandling
Contains methods to manipulate files and folders on the controller (upload, download, delete, ...)
IP
Property
read only
string
Connect robot IP address or host name
Language
Property
Languages
Controller language (default is English)
Disconnect()
Method
void
Disconnects from FTP server
EnumerateVariableFileNames()
Method
string[]
Get the list of all variable file names available on the controller
EnumerateVariableFiles()
Method
FtpListItem[]
Get a list of all variable files on controller

Integre fácilmente robots Universal Robots, Fanuc, Yaskawa, ABB o Staubli en sus aplicaciones .NET, Python, LabVIEW o Matlab

UnderAutomation
ContactosLegal

© All rights reserved.