The API.CONTROLLER class provides a set of interfaces for managing and monitoring the robot controller's motor status, operation modes,and other. It includes methods for subscribing to motor status, retrieving the current state or operation mode, and performing actions such as setting motor states or restarting the controller. This class serves as a high-level abstraction for interacting with the robot controller.
- Source
Members
(readonly) OPMODE :string
- string
| Name | Type | Description |
|---|---|---|
Auto | enum | Auto mode |
Manual | enum | Manual mode |
ManualR | enum | Manual reduce speed mode |
ManualFull | enum | Manual full speed mode |
Auto | string | |
Manual | string | |
ManualR | string | |
ManualFull | string |
- Source
(readonly) STATE :string
- string
| Name | Type | Description |
|---|---|---|
Init | enum | The controller is starting up. |
MotorsOn | enum | Motor on state. |
MotorsOff | enum | Motor off state. |
GuardStopS | enum | Stopped due to safety reasons. |
EStop | enum | Emergency stop state. |
EStopR | enum | Emergency stop state resetting. |
SysFailure | enum | System failure. |
Init | string | |
MotorsOn | string | |
MotorsOff | string | |
GuardStop | string | |
EStop | string | |
EStopR | string | |
SysFailure | string |
- Source
(readonly) STATE :string
- string
| Name | Type | Description |
|---|---|---|
IRB14050 | string | |
IRB1100 | string | |
IRB910 | string | |
CRB1100 | string | |
CRB15000 | string | |
IRB1300 | string | |
CRB1300 | string |
- Source
ctrlState
Properties| Name | Type | Description |
|---|---|---|
ctrlState | string | The current state of the controller. This property is available only after calling API.CONTROLLER.monitorController(). |
- Source
isAuto
Properties| Name | Type | Description |
|---|---|---|
isAuto | boolean | Value "true" indicates that the operation mode is Auto mode. In other cases, the value is "false". This property is available only after calling API.CONTROLLER.monitorController() |
- Source
isManual
Properties| Name | Type | Description |
|---|---|---|
isManual | boolean | true if operation mode is manual reduced speed mode, false otherwiseValue "true" indicates that the operation mode is manual reduce. In other cases, the value is "false". This property is available only after calling API.CONTROLLER.monitorController() |
- Source
isMotOn
Properties| Name | Type | Description |
|---|---|---|
isMotOn | boolean | Value "true" indicates that motors are on. In other cases, the value is "false". This property is available only after calling API.CONTROLLER.monitorController(). |
- Source
opMode
Properties| Name | Type | Description |
|---|---|---|
opMode | boolean | Stores the operation mode. This property is available only after calling API.CONTROLLER.monitorController() |
- Source
Methods
checkIfMotorIsOn() → {Promise.<boolean>}
Check whether motor is on
- Source
A promise with a boolean containing if motor is in on status.
- Type:
- Promise.<boolean>
let motorStatus = await API.CONTROLLER.checkIfMotorIsOn()getControllerState() → {Promise.<RWS.Controller.ControllerStates>}
Gets the controller state. Possible states are:
'initializing' the controller is starting up
'motors_on' motors on state
'motors_off' motors off state
'guard_stop' stopped due to safety
'emergency_stop' emergency stop state
'emergency_stop_resetting' emergency stop state resetting
'system_failure' system failure state
- Source
A promise with a string containing the controller state.
- Type:
- Promise.<RWS.Controller.ControllerStates>
let controllerState = await API.CONTROLLER.getControllerState()getLanguage() → {Promise.<string>}
Gets the current language
- Source
- Type:
- Promise.<string>
await API.CONTROLLER.getLanguage()getOperationMode() → {Promise.<RWS.Controller.OperationModes>}
Gets the operation mode. Possible modes are:
'initializing' controller is starting up, but not yet ready
'automatic_changing' automatic mode requested
'manual_full_changing' manual full speed mode requested
'manual_reduced' manual reduced speed mode
'manual_full' manual full speed mode
'automatic' automatic mode
'undefined' undefined
- Source
A promise with a string containing the operation mode.
- Type:
- Promise.<RWS.Controller.OperationModes>
let opMode = await API.CONTROLLER.getOperationMode()getRobotType() → {Promise.<string>}
Gets the robot type. For example, CRB 15000-5/0.95.
- Source
A promise object with a string presenting the robot type.
- Type:
- Promise.<string>
let robotType = await API.CONTROLLER.getRobotType()isSAY() → {Promise.<boolean>}
Check whether the connected robot is IRB 14050
- Source
A promise object with a boolean value indicating whether the robot is IRB 14050.
- Type:
- Promise.<boolean>
let isSAY = await API.CONTROLLER.isSAY()monitorControllerState(callbackopt)
Subscribes to 'controller-state' and 'operation-mode'. Current state is stored in ctrlState. Additionally, isMotOn is updated with the corresponding value.
| Name | Type | Attributes | Description |
|---|---|---|---|
callback | function | <optional> | Callback function is called when controller state changes |
- Source
// The callback will be executed when motor status is changed
const motorStatus = (value)=>{console.log("motor status is:",value);}
await API.CONTROLLER.monitorControllerState(motorStatus);monitorOperationMode(callbackopt)
Subscribes to 'operation-mode'. Current state is stored in opMode. Additionally, isManReduced is updated with the corresponding value.
| Name | Type | Attributes | Description |
|---|---|---|---|
callback | function | <optional> | Callback function is called when operation mode changes |
- Source
// The callback will be executed when operation mode is changed
const opMode = (value)=>{console.log("operation mode is:",value);}
await API.CONTROLLER.monitorOperationMode(opMode);restart(modeopt) → {Promise.<{}>}
Restarts the controller. Possible modes are:
'restart' normal warm start
'shutdown' shut down the controller
'boot_application' start boot application
'reset_system' reset system
'reset_rapid' reset Rapid
'revert_to_auto' revert to last auto-save
NOTE! An enum ‘RWS.Controller.RestartModes’ with the valid values is provided for ease of use.
| Name | Type | Attributes | Description |
|---|---|---|---|
mode | <optional> | The parameter 'mode" indicates the type of the restart that is requested. |
- Source
- Type:
- Promise.<{}>
await API.CONTROLLER.restart()setMotorsState(state)
Sets motor status to on/off This interface is not valid for SPOC system, e.g., RobotWare 8. With SPOC system, Manual mode: press enable device to set motor on Auto mode: long press physical thumb button on FlexPendant, or trigger specific Safety input.
| Name | Type | Description |
|---|---|---|
state | API. | The motor status to be set |
- Source
// Set motor on
await API.CONTROLLER.setMotorsState(API.CONTROLLER.STATE.MotorsOn)setOpMode(mode)
Set operation mode to a specific mode.
| Name | Type | Description |
|---|---|---|
mode | API. | The operation mode to be set |
- Source
// Set the operation mode to Auto mode
await API.CONTROLLER.setOpMode(API.CONTROLLER.OPMODE.Auto)setOpModeAutomatic()
Sets the operation mode to Auto mode
- Source
await API.CONTROLLER.setOpModeAutomatic()setOpModeManual()
Sets the operation mode to Manual mode
- Source
await API.CONTROLLER.setOpModeManual()