Transfer files and backups
Back up every job of a Yaskawa controller, send a job written on the PC and download the CMOS backup, from C# or Python.
This article shows how to transfer files between a PC and a Yaskawa Motoman controller, in C# or Python. It gives a complete program that saves every job of the controller, sends a new job and downloads the CMOS backup.
Prerequisites
- The SDK is connected to the controller: see Connect to your robot. The file transfers use the UDP port 10041.
- To replace a file,
RS029andRS214are1. For the CMOS backup, the automatic backup uses the RAM disk. See Files and backup.
Which method to choose
| Need | Method |
|---|---|
| The list of the jobs or data files | GetFileList("*.JBI") |
| A copy of one file | GetFile(name) |
| A job written or changed on the PC | LoadFile(name, content) |
| A complete backup of the controller | BatchDataBackup(), then GetFile("/SPDRV/CMOSBK.BIN") |
| Remove a file | DeleteFile(name) |
Example
using UnderAutomation.Yaskawa;using UnderAutomation.Yaskawa.HighSpeedEServer;public class HowToTransferFiles{static void Main(){var robot = new YaskawaRobot();robot.Connect("192.168.0.1");string folder = Directory.CreateDirectory("JobsBackup").FullName;// 1. Download every job of the controllerforeach (string name in robot.HighSpeedEServer.GetFileList("*.JBI").Files){RobotFileContentData file = robot.HighSpeedEServer.GetFile(name);File.WriteAllText(Path.Combine(folder, name), file.Content);Console.WriteLine($"Saved {name}");}// 2. Send a job written on the PC. RS029 and RS214 must allow the overwritestring job = File.ReadAllText("NEWJOB.JBI");robot.HighSpeedEServer.LoadFile("NEWJOB.JBI", job);// 3. Save the CMOS backup of the controllerrobot.HighSpeedEServer.BatchDataBackup();File.WriteAllBytes(Path.Combine(folder, "CMOSBK.BIN"), robot.HighSpeedEServer.GetFile("/SPDRV/CMOSBK.BIN").ContentRaw);robot.Disconnect();}}
The program:
- downloads each job to the folder
JobsBackupof the PC; - sends the job
NEWJOB.JBIof the PC to the controller; - makes the CMOS backup on the controller and downloads it.
Version the jobs
The jobs are text files. Save them in a version control system (Git...) after each download: you see what changed on the controller between two backups, and you can send an older version back.
Troubleshooting
Cannot over write the target file: setRS029andRS214to1.- The upload of a job is refused with a syntax error: the controller checks the job when it receives it. Open the job in MotoSim or on the pendant to find the line.
- The CMOS download fails just after
BatchDataBackup(): the backup is still running. Wait a few seconds and download again. - A large file fails on a slow network: increase
FileTimeoutMilliseconds.
What to read next
- Files and backup: the reference of the file methods.
- Run a job.