API.RWS. CONTROLSTATION

This class provides a set of control station related interfaces that are not supported by the OmniCore SDK.

Methods

checkIfHeldWriteAccess() → {Promise.<void>}

Checks if write access is currently held. Throws an error if write access is not held. Use this API to verify write access before executing operations that require write access.

Returns:
  • Resolves if write access is held, throws error otherwise
Type: 
Promise.<void>
Example
await API.RWS.CONTROLSTATION.checkIfHeldWriteAccess()

ensureMotionControlAllowed() → {Promise.<void>}

Ensures motion control is allowed in SPOC systems. Checks if motion control is already allowed, and if not, requests it automatically. This interface is only valid for RobotWare 8 or later and remote control stations.

Returns:
  • Resolves if motion control is ensured to be allowed, rejects if failure
Type: 
Promise.<void>
Example
await API.RWS.CONTROLSTATION.ensureMotionControlAllowed()

generateControlStationID() → {Promise.<string>}

Generate a new control station ID.

Returns:
Type: 
Promise.<string>
Example
const id = await API.RWS.CONTROLSTATION.generateControlStationID()

isControlStation() → {Promise.<boolean>}

Returns true if current session is held by a control station.

Returns:
Type: 
Promise.<boolean>
Example
let bControlStation = await API.RWS.CONTROLSTATION.isControlStation()

isLocalControlStation() → {Promise.<boolean>}

Returns true if current session is held by a local control station (e.g., FlexPendant).

Returns:
Type: 
Promise.<boolean>
Example
let bLocal = await API.RWS.CONTROLSTATION.isLocalControlStation()

isSpocSystem() → {Promise.<boolean>}

Returns true if the controller is running with RobotWare 8 (SPOC system). Use this API to check system compatibility

Returns:
Type: 
Promise.<boolean>
Example
let bWithSpocSystem = await API.RWS.CONTROLSTATION.isSpocSystem()

monitorLocalIsConnected(callbackopt) → {Promise.<void>}

Monitors the local control station connection status. Returns true when a local control station is connected to the controller.

Parameters:
NameTypeAttributesDescription
callbackfunction<optional>

The callback function that is called when connection status changes.

Returns:
Type: 
Promise.<void>
Example
API.RWS.CONTROLSTATION.monitorLocalIsConnected((isConnected) => {
  console.log('Local control station connected:', isConnected);
});

monitorReleaseAppealCounter(callbackopt) → {Promise.<void>}

Monitors the write access release appeal counter. The counter increments when another client requests write access currently held by the current client.

Parameters:
NameTypeAttributesDescription
callbackfunction<optional>

The callback function that is called when counter changes.

Returns:
Type: 
Promise.<void>
Example
API.RWS.CONTROLSTATION.monitorReleaseAppealCounter((counter) => {
  console.log('Release appeal counter:', counter);
});

monitorResource(resourceType, callbackopt) → {Promise.<void>}

Monitors a control station resource.

Parameters:
NameTypeAttributesDescription
resourceTypestring

The type of resource to monitor (from MonitorResources enum).

callbackfunction<optional>

The callback function that is called when the resource changes.

Returns:
Type: 
Promise.<void>
Example
API.RWS.CONTROLSTATION.monitorResource(
  API.RWS.CONTROLSTATION.MonitorResources['write-access-status'],
  (status) => {
    console.log('Status:', status);
  }
);

monitorTPUSafetyProtocolConnected(callbackopt) → {Promise.<void>}

Monitors the TPU safety protocol connection status. Returns true when a local control station with safety protocol is connected.

Parameters:
NameTypeAttributesDescription
callbackfunction<optional>

The callback function that is called when connection status changes.

Returns:
Type: 
Promise.<void>
Example
API.RWS.CONTROLSTATION.monitorTPUSafetyProtocolConnected((isConnected) => {
  console.log('TPU safety protocol connected:', isConnected);
});

monitorWriteAccessStatus(callbackopt) → {Promise.<void>}

Monitors the write access status of control station. The callback receives an object with status (boolean) and name (string) properties indicating who holds write access.

Parameters:
NameTypeAttributesDescription
callbackfunction<optional>

The callback function that is called when write access status changes.

Returns:
Type: 
Promise.<void>
Example
API.RWS.CONTROLSTATION.monitorWriteAccessStatus((status) => {
  console.log('Write access status:', status);
  if (status.status) {
    console.log('Write access held by:', status.name);
  }
});

releaseWriteAccess() → {Promise.<(object|void)>}

Releases the write access. This interface is only valid for RobotWare 8 or later. When the control station is running in TPU / FlexPendant, release write access through the FlexPendant UI. When the control station is running in browser, use this interface. This interface only supports remote control station for now. And it should be called when write access is no longer needed or before logging out.

Returns:
  • Resolves if release succeeds, rejects if failure
Type: 
Promise.<(object|void)>
Example
await API.RWS.CONTROLSTATION.releaseWriteAccess()

requestWriteAccess(autoRegisterControlStationopt) → {Promise.<(object|void)>}

Requests the write access. This interface is only valid for RobotWare 8 or later. When the control station is running in TPU / FlexPendant, request write access through the FlexPendant UI. When the control station is running in browser, use this interface. This interface only supports remote control station for now. Throws an error if external control is not enabled or if write access is held by another client.

Parameters:
NameTypeAttributesDefaultDescription
autoRegisterControlStationboolean<optional>
false

Whether to automatically register as a remote control station if not registered when requesting write access.

Returns:
  • Resolves if request succeeds, rejects if failure
Type: 
Promise.<(object|void)>
Example
await API.RWS.CONTROLSTATION.requestWriteAccess()