Using Form

Other topics about Using Macro

Overview

HTML Applications (HTAs)  allows you to use a form with VB script.

This sample program demonstrates the following operation.

To use this sample:

  1. Copy the following code into a Notepad file.

  2. Save the file on the analyzer storage in the D: folder. Name the file as "form.hta".

  3. Double-click the file to execute.

Sample Program

<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>