Other topics about Using Macro
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 ana = CreateObject("E4991.Application")
ana.scpi.system.preset
ana.scpi.initiate(1).continuous = false
Sub Window_OnLoad
Window.ResizeTo 500,200
End Sub
Sub max()
ana.scpi.calculate(1).selected.marker(1).state = true
ana.scpi.calculate(1).selected.marker(1).function.type="maximum"
ana.scpi.calculate(1).selected.MARKer(1).FUNCtion.EXECute
axisx = ana.scpi.calculate(1).selected.marker(1).x.data
axisy = ana.scpi.calculate(1).selected.marker(1).y
DataArea1.InnerHTML = cstr(axisx)
DataArea2.InnerHTML = cstr(axisy(0))
End Sub
Sub min()
ana.scpi.calculate(1).selected.marker(2).state = true
ana.scpi.calculate(1).selected.marker(2).function.type="minimum"
ana.scpi.calculate(1).selected.MARKer(2).FUNCtion.EXECute
axisx = ana.scpi.calculate(1).selected.marker(2).x.data
axisy = ana.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>