Instructions

Table Of Contents
User Scripting (R&S RTH-K38)
R&S
®
Scope Rider RTH
521User Manual 1326.1578.02 ─ 15
To stop a running app
Tap the "Close" icon in the upper right corner of the app window, or press the
[BACK] key.
[PRESET] also stops the app.
When an app is running
The instrument works as follows when an app is running:
The app window covers a part of the measurement display. To move the window,
tap left beside the "Close" icon and drag it.
The keys and the touchscreen work as usual, they are not blocked. Do not change
settings that affect the measurements and results of the running app.
Normal remote control and user apps cannot run at the same time.
If you shut down the instrument while an app is running, the app starts automati-
cally when you start the instrument again.
C.3 About User Apps
If you create your own apps, consider the following basic rules and notes:
Each app is an html page, the file extension must be .html.
The scripting language is JavaScript. The jquery.js library is available on the instru-
ment.
A simple stylesheet /css/appstyle.css can be used.
To set the initial size and position of the app window, include a meta tag in the
<head> element of the file, for example, <meta name="RS_PagePos"
content="400,40,390,400"> <!-- xleft,ytop,width,height -->
Using SCPI commands
To control instrument functions, use remote commands with the scpi.js library. The rel-
evant commands are init(), query(), post(), get().
Use scpi.init() for commands that would otherwise reset the app, for example,
*RST, :OP. The corresponding remote command is UAPP:PERSistence.
The following simple examples demonstrate the usage of SCPI commands:
var scpi = new SCPI();
scpi.init( initCmd, callback ); // the initCmd (string) may contain "*RST"
scpi.query( cmd, callback ); // cmd (string) may contain one or more queries e.g. "*IDN?"
scpi.post( data, callback );
scpi.get( callback );
Commands can be concatenated, separated by semicolons, for example:
"*RST;:CURS:FUNC TRAC;:CURS:STAT ON;"
The init and query callback has the type Function(String response), with
parameter response containing the query results and error status separated by semi-
About User Apps