Dear Fausto,
The Oscilloscope is more a user-interactive feature than a programmatic one in the FreeMASTER Desktop application. There is actually no JSON-RPC API to consume oscilloscope data in the script as such script would depend heavily on what oscilloscope item is currently selected in the project tree.
There is an API though to create the Oscilloscope item and populate it with selected variables just like if the user would create it by hand. There is also an API to activate the newly created item in the project tree so that the oscilloscope graph becomes visible in the desktop window. See DefineOscilloscope and SelectItem API calls in the User Guide.
In the FreeMASTER Desktop application, the only way how to get variable values in run-time is reading them programmatically in a script using the ReadVariable or similar methods. This is a good approach as it works any time, regardless of what screen the user currently activates in the UI.
As Iulian mentioned above, the FreeMASTER Lite backend enables an access to Oscilloscope feature at the protocol level, so it might be more suitable for you if you really need a high-speed data sampling.
Regards,
Michal