UnderAutomation
¿Una pregunta?

[email protected]

Contactos
UnderAutomation
⌘Q
Esta página solo está disponible en inglés.

Run a job

Select a job of a Yaskawa controller, switch the servo on, start it and wait for its end from C# or Python. Settings of the controller and frequent errors.

  • Prerequisites
  • Steps
  • Example
  • Stop a job
  • Troubleshooting
  • What to read next

This article shows how to start a job of a Yaskawa Motoman controller from a PC, in C# or Python, and wait for its end. It gives a complete program that checks the mode, resets an alarm, selects the job, switches the servo on and starts it.

Prerequisites

  • The SDK is connected to the controller: see Connect to your robot.
  • The controller is in play mode and accepts the remote commands, and the job selection is permitted: see Prepare the controller.
  • The job exists on the controller. To send it from the PC, see Transfer files and backups.

Steps

StepMethod
Check the modeGetStatusInformation(): Play, CommandRemote
Reset an alarmAlarmReset(AlarmResetType.Reset)
Select the job and its lineSelectJob(name, line)
One cycle or continuousSwitchingCommand(SwitchingCommands.Cycle)
Servo onServoCommand(OnOffCommandType.Servo, true)
StartStartJob()
FollowGetExecutingJobInformation(), GetStatusInformation().Running

Example

using UnderAutomation.Yaskawa;
using UnderAutomation.Yaskawa.HighSpeedEServer;
public class HowToRunProgram
{
static void Main()
{
var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
// 1. Check the mode: play and remote
RobotStatusData status = robot.HighSpeedEServer.GetStatusInformation();
if (!status.Play || !status.CommandRemote)
throw new InvalidOperationException("Set the controller in play mode and remote mode");
// 2. Reset a pending alarm
if (status.Alarming)
robot.HighSpeedEServer.AlarmReset(AlarmResetType.Reset);
// 3. Select the job at its first line, one cycle, servo on, start
robot.HighSpeedEServer.SelectJob("WELD01", 0);
robot.HighSpeedEServer.SwitchingCommand(SwitchingCommands.Cycle);
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Servo, true);
robot.HighSpeedEServer.StartJob();
// 4. Wait for the end of the job
do
{
Thread.Sleep(200);
RobotJobData job = robot.HighSpeedEServer.GetExecutingJobInformation();
Console.WriteLine($"{job.Name} line {job.Line}");
status = robot.HighSpeedEServer.GetStatusInformation();
}
while (status.Running);
Console.WriteLine(status.Alarming ? "Stopped on an alarm" : "Job done");
robot.Disconnect();
}
}

The program stops with an error if the controller is not in play mode or not in remote mode. Then it runs the job once, prints its line every 200 ms, and says at the end whether the job ended or stopped on an alarm.

Stop a job

Hold the robot with ServoCommand(OnOffCommandType.Hold, true): the robot stops on its path. Release the hold and call StartJob() to continue, or switch the servo off to end. See Jobs.

Troubleshooting

  • Command remote not set: the remote mode is off. See Prepare the controller.
  • Incorrect mode: the controller is in teach mode. Turn the mode key to play.
  • SelectJob is refused: the name has the .JBI extension, the job does not exist, or JOB SELECT WHEN REMOTE AND PLAY is not permitted.
  • Servo OFF: call ServoCommand(OnOffCommandType.Servo, true) before StartJob().

What to read next

  • Jobs: the reference of the job methods.
  • Read and reset alarms.

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

UnderAutomation
ContactosLegal

© All rights reserved.