Is it possible to read RAPID data in AppStudio (FlexPendant) using RWS?
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 numPERS numRAPID array elements
Questions
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.
Categories
- All Categories
- 5.7K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 16 RobotApps
- 306 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 251 ScreenMaker
- 2.9K Robot Controller
- 366 IRC5
- 90 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 857 RAPID Programming
- 43 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings