URScript Control API in Logic Program

Description

The URScript Control API lets you control the robot arm's state and program lifecycle. You can power the robot arm on and off, release the brakes, start, pause, or stop a robot program, and check the current robot state.

Control API methods are available in the Logic Program, the main program, and in threads. The primary use case is calling Control API methods from the Logic Program to control the robot program. For example, you can set up an automatic startup routine that powers on the robot, starts the main program, monitors its state, and recovers from errors.

 

Key features

  • Robot power control: Power the robot arm on and off from the Logic Program.

  • Brake control: Apply power to joint motors and release motor brakes to prepare for program execution.

  • Program lifecycle control: Start, pause, stop, and resume the main robot program. Lets you implement custom input and output actions on interface signals (Modbus signals or general-purpose registers).

  • State queries: Check remote control mode, arm power, motor power, safety state, and main program state.

  • Error reporting: All methods return error codes so the Logic Program can handle failures efficiently.

Most Control API methods require remote control mode, especially those that control the robot arm (power, brakes, and program control). State query methods work in both local and remote mode.

These methods return -1 when the robot is in local mode.