---
title: "Pendant: show a message to the operator"
description: "Show a text message on the teach pendant or the screen of a robot controller with robot.Pendant. Brand support table, C# and Python examples."
---

# Pendant: show a message to the operator

`robot.Pendant` shows a short text message to the operator, on the teach pendant or on the screen of a robot controller. The support depends on the brand: several brands have no route for this method today, see the table below. On these brands `IsAvailable` returns false and the call throws `FeatureNotSupportedException`.

## Prerequisites

- A connected `RobotController`. See [Connect to your robot](/robotics/documentation/connect).
- The license of the brand of the controller, or the 30 day trial. See [Licensing](/robotics/documentation/license).
- A message of one line. The maximum length depends on the brand and on the route.

## Brand support

Each cell gives the protocol that the method uses on this brand, in the default order. The page [Routing](/robotics/documentation/routing) explains how the library chooses it. The table is generated from the route data of the library. (manual) marks a route that you enable yourself. "n of m" is the number of methods of the service that have a route on this brand.

Routes of each method in the default order. The first route is used, the next ones are fallbacks. (manual) marks a route that you enable yourself.

| Method | Fanuc | Yaskawa | Universal Robots | ABB | Stäubli |
| --- | --- | --- | --- | --- | --- |
| Pendant.ShowMessage | Not available | High Speed Ethernet Server, Ethernet Server | Dashboard Server, REST API | Not available | Not available |
| Pendant | **0 of 1** | **1 of 1** | **1 of 1** | **0 of 1** | **0 of 1** |

A brand that has no route for the method throws `FeatureNotSupportedException` (see [Errors](/robotics/documentation/errors)). Ask `robot.Pendant.IsAvailable(PendantFeature.ShowMessage)` before the call.

## Example

### Show a message to the operator

The controller decides how the message looks (a line of the display, a popup) and how long it stays.

**C# : PendantShowMessage**
```csharp
using UnderAutomation.Robotics.Controllers;

public class PendantShowMessage
{
    static void Main()
    {
        RobotController robot = new RobotController();
        robot.Connect(RobotConnectionParameters.Create("fanuc", "192.168.0.1"));

        /**/
        if (robot.Pendant.IsAvailable(PendantFeature.ShowMessage))
        {
            robot.Pendant.ShowMessage("Cell 3: maintenance at 18:00");
        }
        /**/

        robot.Disconnect();
    }
}
```

**Python : PendantShowMessage**
```python
from underautomation.robotics.controllers.robot_controller import RobotController
from underautomation.robotics.controllers.robot_connection_parameters import RobotConnectionParameters
from underautomation.robotics.controllers.pendant_feature import PendantFeature

robot = RobotController()
robot.connect(RobotConnectionParameters.create("fanuc", "192.168.0.1", ""))

##
if robot.pendant.is_available(PendantFeature.ShowMessage):
    robot.pendant.show_message("Cell 3: maintenance at 18:00")
##

robot.disconnect()
```

## Reference

In Python, the names are in snake_case: `robot.pendant.show_message("...")` and `robot.pendant.is_available(...)`. The enum members keep their names.

### Methods of IPendantService

**Members of Controllers.IPendantService**
```csharp
public interface IPendantService {
    // Returns true when the method can be called on the connected controller.
    // The answer depends on the brand, on the routing settings and on the protocols that answered at the connection, not on the state of the controller.
    bool IsAvailable(PendantFeature feature)

    // Shows a short text message to the operator, on the teach pendant or the screen of the controller.
    // The controller decides how the message looks (a line of the display, a popup) and how long it stays.
    // The maximum length depends on the brand and the route: a text that is too long throws <xref href="System.ArgumentException" data-throw-if-not-resolved="false"></xref>.
    // A line break throws <xref href="System.ArgumentException" data-throw-if-not-resolved="false"></xref>.
    void ShowMessage(string text)
}
```

### Errors

The page [Errors](/robotics/documentation/errors) explains each exception and how to avoid it.

- `FeatureNotSupportedException`: the brand has no route for the method.
- `RouteUnavailableException`: the method has routes, but none of them can be used, for example because the protocol did not answer at the connection.
- `ControllerRefusedException`: the controller received the command and refused it.
- `RobotControllerException`: the route failed. Its inner exception is the exception of the brand SDK.
- `ArgumentException`: the text is too long for the brand and the route, or it contains a line break.

`IsAvailable` only throws `ArgumentOutOfRangeException`, for a value that is not in the enum.

## What to read next

- [Alarm](/robotics/documentation/alarm): read the alarms that the operator sees.
- [Info](/robotics/documentation/info): read the identity of the controller.
- [Routing](/robotics/documentation/routing): see which protocol answers each method.