UnderAutomation
Une question ?

[email protected]

Contactez-nous
UnderAutomation
⌘Q
Cette page est disponible uniquement en anglais.

Status and servo

Read the mode and the state of a Yaskawa controller, switch the servo power, hold the robot, select the cycle mode, lock the pendant and show a message on it.

  • Read the status
  • Servo power and hold
  • Lock the pendant
  • Cycle mode
  • Message on the pendant
  • Try it in the demo application
  • Reference

This page shows how to read the state of a Yaskawa Motoman controller with the SDK, and how to change it: servo power, hold, cycle mode, pendant lock and pendant message. It covers every controller with the High Speed Ethernet Server.

Read the status

GetStatusInformation() reads the mode, the execution state, the hold and the alarm flags in one request.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
RobotStatusData status = robot.HighSpeedEServer.GetStatusInformation();
// Mode of the controller
Console.WriteLine($"Teach: {status.Teach}, play: {status.Play}, remote: {status.CommandRemote}");
// Cycle mode: step, one cycle or automatic (continuous)
Console.WriteLine($"Step: {status.Step}, cycle: {status.Cycle}, automatic: {status.Automatic}");
// Execution
Console.WriteLine($"Running: {status.Running}, servo on: {status.ServoOn}");
// Hold, from the pendant, from an external signal or from a command
Console.WriteLine($"Hold: {status.InHoldStatusPendant} {status.InHoldStatusExternally} {status.InHoldStatusByCommand}");
// Alarm and error
Console.WriteLine($"Alarm: {status.Alarming}, error: {status.ErrorOccurring}");
robot.Disconnect();
}
Click to see the full code
Propertytrue when
Teach, PlayThe controller is in teach mode, in play mode
CommandRemoteThe controller accepts the commands of the PC
Step, Cycle, AutomaticThe cycle mode: step, one cycle, continuous
RunningA job or a move is executed
ServoOnThe servo power is on
InHoldStatusPendantThe hold button of the pendant is pressed
InHoldStatusExternallyThe external hold signal is on
InHoldStatusByCommandA hold was sent by ServoCommand(Hold, true)
AlarmingAn alarm is active, see Alarms
ErrorOccurringAn error message is shown
InGuardSafeOperationThe robot is in guard safe operation

The status is a snapshot. To follow its changes, read it in a loop: see Monitor the state of the robot.

Servo power and hold

ServoCommand(command, value) switches the servo power, the hold and the pendant lock on or off. It needs the remote mode.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
// Switch the servo power on. The SDK waits up to PowerOnTimeoutMilliseconds (8 s)
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Servo, true);
// Hold the robot, then release the hold
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Hold, true);
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Hold, false);
// Switch the servo power off
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Servo, false);
robot.Disconnect();
}
Click to see the full code
OnOffCommandTypetruefalse
ServoServo power onServo power off
HoldHold: the robot stops on its path, servo stays onRelease the hold
HLockLock the pendantUnlock the pendant

The servo power takes several seconds to come on. For this command the SDK waits PowerOnTimeoutMilliseconds (8000 ms by default) instead of DataTimeoutMilliseconds.

Lock the pendant

When a PC drives the cell, lock the pendant so that nobody changes the mode or starts a job from it at the same time.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
// Lock the programming pendant, so that nobody changes the mode or starts a job from it
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.HLock, true);
// Unlock it
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.HLock, false);
robot.Disconnect();
}
Click to see the full code

Cycle mode

SwitchingCommand selects how a job runs when it is started: step by step, one cycle, or in a loop.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
// Execute the job step by step
robot.HighSpeedEServer.SwitchingCommand(SwitchingCommands.Step);
// Execute the job once
robot.HighSpeedEServer.SwitchingCommand(SwitchingCommands.Cycle);
// Execute the job in a loop
robot.HighSpeedEServer.SwitchingCommand(SwitchingCommands.Continue);
robot.Disconnect();
}
Click to see the full code

In Python, SwitchingCommands.Continue is written SwitchingCommands.Continue_.

Message on the pendant

Display(message) shows a message to the operator on the programming pendant. The message has 24 characters at most: a longer one is cut.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
// Show a message on the programming pendant, 24 characters at most
robot.HighSpeedEServer.Display("Part 42 done");
robot.Disconnect();
}
Click to see the full code

Try it in the demo application

Everything on this page can be tried without writing code, in the Status page of the demo application.

Status page of the Yaskawa SDK demo application

The demo application is open source. The C# source of this page is StatusControl.cs.

Reference

Methods of HighSpeedEServerClientBase :
C#
// Displays a popup message on the robot programming pendant. Message will appear as a notification to the operator.
RobotDataHeader Display(string message);
// Reads the current operational status of the robot controller. Returns information about mode (teach/play), running state, hold status, alarms, and servo power.
RobotStatusData GetStatusInformation();
// Executes hold/servo/HLock on/off commands. For servo control, this enables or disables motor power to the robot. Servo must be ON for the robot to move.
RobotDataHeader ServoCommand(OnOffCommandType command, bool value);
// Switches the robot execution mode between Step, Cycle, and Continuous.
RobotDataHeader SwitchingCommand(SwitchingCommands command);
Class
RobotStatusDatainherits RobotData
C#

Contains the current operational status of the robot controller. Provides information about the robot's mode, running state, and safety conditions. Retrieved using the status information reading command.

MemberTypeDescription
Alarming
Property
read only
bool
Gets whether an alarm is currently active. Check GetAlarm() for detailed alarm information.
Automatic
Property
read only
bool
Gets whether the robot is in automatic operation mode. When true, the robot can operate automatically without pendant interaction.
CommandRemote
Property
read only
bool
Gets whether remote command mode is enabled. When true, the robot accepts commands from external sources (including this API).
Cycle
Property
read only
bool
Gets whether the robot is in cycle execution mode. When true, the robot executes one complete cycle then stops.
ErrorOccurring
Property
read only
bool
Gets whether an error condition is occurring. Errors may prevent normal operation until resolved.
InGuardSafeOperation
Property
read only
bool
Gets whether the robot is in guard safe operation mode. Indicates collaborative/safety-rated operation mode is active.
InHoldStatusByCommand
Property
read only
bool
Gets whether the robot is held by a command (software hold). A hold command was issued via the API or job instruction.
InHoldStatusExternally
Property
read only
bool
Gets whether the robot is held by an external hold signal. External safety circuit has triggered a hold condition.
InHoldStatusPendant
Property
read only
bool
Gets whether the robot is held by the programming pendant. Operator has pressed hold on the pendant.
Play
Property
read only
bool
Gets whether the robot is in play mode. In play mode, the robot can execute programmed jobs.
Running
Property
read only
bool
Gets whether the robot is currently running (executing a job).
ServoOn
Property
read only
bool
Gets whether servo power is enabled. Servo must be ON for the robot to move.
Step
Property
read only
bool
Gets whether the robot is in step (single-step) execution mode. When true, the robot executes one instruction at a time.
Teach
Property
read only
bool
Gets whether the robot is in teach mode. In teach mode, the robot can be manually positioned and jobs can be edited.
Enum
OnOffCommandType
C#

Specifies the type of ON/OFF command to send to the robot controller. These commands control fundamental robot states that affect safety and operation.

NameValueDescription
HLock
3
Lock Teach Pendant. Value: 3.
Hold
1
Hold command - pauses robot motion while maintaining servo power. Robot can resume from held position. Value: 1.
Servo
2
Servo power command - enables or disables motor power to the robot. Servo must be ON for the robot to move. Value: 2.
Enum
SwitchingCommands
C#

Specifies the execution mode switching command to send to the robot controller. These modes control how the robot executes programmed jobs.

NameValueDescription
Continue
3
Continuous mode - robot executes the program continuously until stopped. Normal production operation mode.
Cycle
1
Cycle mode - robot executes one complete cycle of the program then stops. Useful for testing or single-part operations.
Step
2
Step mode - robot executes one instruction at a time, stopping after each. Useful for debugging and detailed program verification.

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

UnderAutomation
Contactez-nousLegal

© All rights reserved.