The API.RWS.RAPID namespace provides RAPID-related interfaces that are not supported by the OmniCore SDK.
- Source
Methods
getCycleMode() → {Promise.<string>}
Gets the current cycle mode of the program execution.
- Source
The current cycle mode.
- Type:
- Promise.<string>
const cycleMode = await API.RWS.RAPID.getCycleMode();getDataTypeProperty(typeUrl) → {Promise.<any>}
Gets the properties of the specified RAPID data type
| Name | Type | Description |
|---|---|---|
typeUrl | string | The URL of the data type. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.getDataTypeProperty('robtarget');getDataTypeStructure(typeUrl) → {Promise.<any>}
Get the data structure of the specified RAPID data type
| Name | Type | Description |
|---|---|---|
typeUrl | string | The URL of the data type. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.getDataTypeStructure();getModuleText(moduleName, taskName) → {Promise.<any>}
Gets the RAPID module text.
| Name | Type | Description |
|---|---|---|
moduleName | * | The module name. |
taskName | * | The task name. |
- Source
An object containing the structure { change-count, module-length, module-text?, file-path?, _title, _type, }
- Type:
- Promise.<any>
const moduleText = await API.RWS.RAPID.getModuleText('MyModule', 'T_ROB1');getPointersInfo(taskNameopt) → {Promise.<any>}
Gets the information of program pointers
| Name | Type | Attributes | Description |
|---|---|---|---|
taskName | string | <optional> | The task name. |
- Source
- Type:
- Promise.<any>
const pointersInfo = await API.RWS.RAPID.getPointersInfo('T_ROB1');getRecordTypes(task) → {Promise.<any>}
Gets the RECORD data list.
| Name | Type | Description |
|---|---|---|
task | string | The task name. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.getRecordTypes()getServiceRoutines(exturl, allread) → {Promise.<any>}
Gets the service routines.
| Name | Type | Description |
|---|---|---|
exturl | string | External URL for the service routines. |
allread | boolean | Indicates whether to include all the readable routines. |
- Source
- Type:
- Promise.<any>
getTaskChangeMonitor(taskName) → {Promise.<object>}
Gets an instance of a API.RAPID.TaskChangeMonitor class
| Name | Type | Description |
|---|---|---|
taskName | string | Task name |
- Source
- API.RAPID.TaskChangeMonitor
- Type:
- Promise.<object>
let taskChangeMonitor = await API.RWS.getTaskChangeMonitor();
const taskchangeCb = function (data) {
console.log('RAPID is changed');
};
taskChangeMonitor.addCallbackOnChanged(taskchangeCb);
taskChangeMonitor.subscribe()getVariableRawValue(moduleName, variableName, taskName) → {Promise.<string>}
Gets the raw value of a RAPID variable.
| Name | Type | Description |
|---|---|---|
moduleName | string | The module name. |
variableName | string | The variable name. |
taskName | string | The task name. |
- Source
- Type:
- Promise.<string>
await API.RWS.RAPID.getVariableRawValue('TestModule', 'TestVariable', 'T_ROB1');loadModule(path, replaceopt, taskNameopt, requestMshopt) → {Promise.<any>}
Loads a module from the HOME directory of the controller into the specified task.
| Name | Type | Attributes | Description |
|---|---|---|---|
path | string | Path to the module file in the HOME directory (including the file extension). | |
replace | boolean | <optional> | If the value is 'true', existing module in RAPID with the same name will be replaced. |
taskName | string | <optional> | The task name. |
requestMsh | boolean | <optional> | Edit mastership needs to be requested before loading the module. |
- Source
- Type:
- Promise.<any>
let url = `${this.path}/${this.name}${this.extension}`;
await API.RWS.RAPID.loadModule(url, true, 'T_ROB1');movePPToCursor(moduleName, taskName, line, column) → {Promise.<any>}
Moves the program pointer to a specified cursor position.
| Name | Type | Description |
|---|---|---|
moduleName | string | The module name. |
taskName | string | The task name. |
line | string | Number of the line to which the pointer is desired. |
column | string | Number of the column to which the pointer is desired. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.movePPToCursor('MyModule', 'T_ROB1', '10', '5');setCycleMode(mode) → {Promise.<any>}
Sets the cycle mode for the program execution.
| Name | Type | Description |
|---|---|---|
mode | string | Cycle mode, e.g., 'once' or 'forever'. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.setCycleMode('forever');setModuleText(moduleName, text, taskNameopt) → {Promise.<any>}
Sets the content of a RAPID module.
| Name | Type | Attributes | Description |
|---|---|---|---|
moduleName | string | The module name. | |
text | string | The new content of the module. | |
taskName | string | <optional> | The task name. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.setModuleText("Module1",`MODULE Module1\r\nPROC proc1()\r\nTPWrite "123";\r\nENDPROC\r\nENDMODULE`), 'T_ROB1');setModuleTextInRange(moduleName, text, startRow, startCol, endRow, endCol, taskNameopt, replaceModeopt) → {Promise.<any>}
Sets the content of a RAPID module within a specified range.
| Name | Type | Attributes | Description |
|---|---|---|---|
moduleName | string | The module name. | |
text | string | The new content to insert. | |
startRow | number | Start row of the range. | |
startCol | number | Start column of the range. | |
endRow | number | End row of the range. | |
endCol | number | End column of the range. | |
taskName | string | <optional> | The task name. |
replaceMode | string | <optional> | Replace mode, e.g., 'Replace'. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.setModuleTextInRange(
'MyModule',
'TPErase;',
5,
1,
10,
1,
'T_ROB1',
'Replace'
);setPPToRoutine(moduleName, routineName, taskNameopt) → {Promise.<any>}
Sets the program pointer to a specified routine.
| Name | Type | Attributes | Description |
|---|---|---|---|
moduleName | string | The module name. | |
routineName | string | Routine's name. | |
taskName | string | <optional> | The task name. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.setPPToRoutine('MyModule', 'MainRoutine', 'T_ROB1');syncPers(moduleName, taskNameopt) → {Promise.<any>}
Synchronizes the value of persistent variables in a specified module.
| Name | Type | Attributes | Description |
|---|---|---|---|
moduleName | string | The module name. | |
taskName | string | <optional> | The task name. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.syncPers('MyModule', 'T_ROB1');unloadModule(moduleName, taskNameopt, requestMshopt) → {Promise.<any>}
Unloads a RAPID module.
| Name | Type | Attributes | Description |
|---|---|---|---|
moduleName | string | The module name. | |
taskName | string | <optional> | The task name. |
requestMsh | boolean | <optional> | Edit mastership needs to be requested before unloading the module. |
- Source
- Type:
- Promise.<any>
await API.RWS.RAPID.unloadModule('MyModule', 'T_ROB1');