Instructions

Table Of Contents
User Scripting (R&S RTH-K38)
R&S
®
Scope Rider RTH
524User Manual 1326.1578.02 ─ 15
ctx.moveTo(0,y);
else
ctx.lineTo(i*3,y);
}
ctx.stroke();
}
function updateCanvas(y1,y2) {
var c=document.getElementById("MyCanvas");
var ctx=c.getContext("2d");
ctx.fillStyle="#000040";
ctx.fillRect(0,0,c.width,c.height);
if ( ! isNaN(y1) && ! isNaN(y2) )
{
a1.push(y1);
a2.push(y2);
while( a1.length > 100 )
{
a1.shift();
a2.shift();
}
calcRange(a1);
calcRange(a2);
ctx.strokeStyle="#FF8000";
drawPath( a1, ctx, c.width, c.height );
ctx.strokeStyle="#00FF00";
drawPath( a2, ctx, c.width, c.height );
}
}
function doUpdate() {
scpi.query( ":RUN;:CURS:STAT?;FUNC?;X1P?;X2P?;Y1P?;Y2P?;Y1AM?;Y2AM?", function(r) {
var results = r.split(";");
var s = results[0];
var f = results[1];
$("#CursorState").text( s=="0" ? "off" : "on" );
$("#CursorType").text( "Type: " + f );
$("#CursorType").css("display", s=="0" ? "none" : "" );
var bTrac = f=="TRAC";
var bShowX = f == "VERT" || bTrac;
var bShowY = f == "HOR" || bTrac;
$("#CursorX1").css("display", s=="1" && bShowX ? "" : "none" );
$("#CursorX2").css("display", s=="1" && bShowX ? "" : "none" );
$("#CursorY1").css("display", s=="1" && bShowY ? "" : "none" );
$("#CursorY2").css("display", s=="1" && bShowY ? "" : "none" );
Demo App