Skip to content

Is Program Running

SUMMARY

Is Program Running returns True if a program is currently executing on the robot controller and False otherwise.

UNITS

Returns a boolean. No quantitative units.

The Skill

python
running = robot.is_program_running_on_controller()

The Code

Example: Check Whether a Controller Program Is Running

Connect to the robot and check whether a program is currently executing on the controller.

python
"""
Logs whether a PolyScope program is currently running on the controller.

Supports Universal Robots (UR).

Usage:
    python is_program_running_on_controller.py [--ip <ROBOT_IP>]
"""

import argparse

from loguru import logger

from telekinesis.synapse.robots.manipulators import universal_robots


def main(ip: str | None) -> None:
    """Log whether a PolyScope program is currently running."""

    #===================== Create Robot ==========================================
    robot = universal_robots.UniversalRobotsUR10E(name='UR10e')

    try:
        #===================== Connect Robot ==========================================
        if ip:
            robot.connect(ip=ip)

        # ==================== Run Skill ============================================
        logger.success(f"is_program_running_on_controller: {robot.is_program_running_on_controller()}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        robot.disconnect()
        robot.shutdown()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Check controller program status Synapse example")
    parser.add_argument("--ip", type=str, default=None,
                         help="UR robot IP address for real hardware, e.g. 192.168.1.100")
    args = parser.parse_args()

    main(ip=args.ip)

Running the Example

bash
python is_program_running_on_controller.py --ip 192.168.1.100

For all options:

bash
python is_program_running_on_controller.py --help

Parameter Configuration

This skill takes no input parameters.

Returns

FieldTypeDescription
runningboolTrue if a controller program is running, False otherwise.

Raises

ExceptionCondition
RuntimeErrorThe robot is not connected.

Where to Use the Skill

  • Startup checks to confirm no program is running before issuing Python-side motion commands.
  • Orchestrating hand-off between controller programs and Python control.

When Not to Use the Skill

Use a different skill when:

  • You need to distinguish between paused, stopping, and stopped states - use Get Runtime State for the full state code instead.