API. VARIABLEMONITOR

The API.VARIABLEMONITOR namespace provides a set of interfaces for easily and quickly adding RAPID variable monitoring and processing transactions

Methods

monitorVariable(variableObjopt, callbackopt)

Subscribes to a RAPID variable.

Parameters:
NameTypeAttributesDescription
variableObjobject<optional>

The variable attributes including the variable name and other necessary information.

callbackfunction<optional>

The callback function that is called when the variable changes.

Example
API.VARIABLEMONITOR.monitorVariable(
 {type: 'tooldata', task: 'task1', module: 'module1', name: 'Wobj_1'},
 (v)=>{
   console.log(v);
 }
)