Other topics about Sample Application Program
HTML Applications (HTAs) allows you to use a form with VB script.
This sample program demonstrates the following operation.
Pressing "Marker 1 => Max" moves the marker 1 at maximum point, then display the x and y value.
Pressing "Marker 2 => Min" moves the marker 2 at minimum point, then display the x and y value.
To use this sample:
Copy the following code into a Notepad file.
Save the file on the analyzer storage in the D: folder. Name the file as "form.hta".
Double-click the file to execute.
<html><head>
<title>HTA Sample</title>
<script language="VBScript">
set ena = CreateObject("E5070.Application")
ena.scpi.system.preset
ena.scpi.initiate(1).continuous = false
Sub Window_OnLoad
Window.ResizeTo 500,200
End Sub
Sub max()
ena.scpi.calculate(1).selected.marker(1).state = true
ena.scpi.calculate(1).selected.marker(1).function.type="maximum"
ena.scpi.calculate(1).selected.MARKer(1).FUNCtion.EXECute
axisx = ena.scpi.calculate(1).selected.marker(1).x
axisy = ena.scpi.calculate(1).selected.marker(1).y
DataArea1.InnerHTML = cstr(axisx)
DataArea2.InnerHTML = cstr(axisy(0))
End Sub
Sub min()
ena.scpi.calculate(1).selected.marker(2).state = true
ena.scpi.calculate(1).selected.marker(2).function.type="minimum"
ena.scpi.calculate(1).selected.MARKer(2).FUNCtion.EXECute
axisx = ena.scpi.calculate(1).selected.marker(2).x
axisy = ena.scpi.calculate(1).selected.marker(2).y
DataArea1.InnerHTML = cstr(axisx)
DataArea2.InnerHTML = cstr(axisy(0))
End Sub
</script>
</head>
<body>
<form name="form1" style="font-size:24pt">
<input type="button" value="Marker 1 => Max" onClick="max()" />
<input type="button" value="Marker 2 => Min" onClick="min()" />
<p>
X: <span id = "DataArea1"></span><br>
Y: <span id = "DataArea2"></span>
</p>
</form>
</body>
</html>