Hello,
I am working with an ABB OmniCore controller and developing a custom FlexPendant HMI using AppStudio.
I am trying to read RAPID data (CONST, PERS variables and array elements) from JavaScript functions in AppStudio, using RWS (Robot Web Services).
RAPID setup- Task type: STATIC
-
Task state: RUNNING
-
Example module:
MODULE C_scanData
CONST num MAX_SAMPLES := 200;
PERS num AmpData{MAX_SAMPLES};
ENDMODULE
The RAPID data is updating correctly and can be verified from the pendant.
Problem
In AppStudio JavaScript, I tried to use commonly referenced RAPID helper APIs such as:
-
API.RWS.RAPID.getRapidData() -
API.RWS.RAPID.readRapidData() -
API.RWS.RAPID.getRapidDataValue() -
API.RWS.request()
However, in my AppStudio environment, none of these functions exist and they all return errors such as:
TypeError: ... is not a function
What works
The only method that works in my setup is accessing RAPID data using a raw RWS GET request, for example:
const res = await API.RWS.get(
"/rw/rapid/symbol/data/RAPID/C_scan/C_scanData/AmpData%5B1%5D"
);
and then manually parsing the <value> from the XML response.
This works for:
-
CONST num -
PERS num -
RAPID array elements
Questions1. Is this expected behavior for certain AppStudio / OmniCore versions?
-
Is using raw RWS (
API.RWS.get) the recommended or only supported way to read RAPID data in AppStudio? -
Is there a documented, version-independent API for reading RAPID variables inside AppStudio JavaScript?
-
Are there any best practices for reading RAPID arrays efficiently in AppStudio?
Goal
My goal is to reliably read RAPID data inside AppStudio functions and display it on the FlexPendant HMI (for example, graphs and diagnostics).
Any clarification or official guidance would be greatly appreciated.
Thank you.