VB Script: Using User Menu

Other topics about Sample Application Program

Overview

This sample program demonstrates the following operation.

  1. Set the softkey label of user menu (Macro Setup > User Menu).

  2. When user menu softkey is pressed, the Sub UserMenuButton_OnPress(bNo)
    is executed with the key number.

  3. The marker is operated according to the key number.

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 "userMenu.vbs".

  3. Double-click the file to execute.

Sample Program

 

dim ana
dim userMenu
dim bNo
dim mkrNo

set userMenu = WScript.CreateObject("E5070.UserMenu", "UserMenuButton_")
set ana = CreateObject("E5070.Application")

for bNo=1 to 5
   select case bNo
   case 1, 2, 3
        UserMenu.item(cint(bNo)).caption = "Marker" & bNo
   case 4
        UserMenu.item(cint(bNo)).caption = "Max"
   case 5
        UserMenu.item(cint(bNo)).caption = "Min"
   end select
next


Do Until False
    WScript.Sleep 500
Loop
 

Sub UserMenuButton_OnPress(bNo)
   Select case bNo   

   case 1, 2, 3
        mkrNo=bNo
        ana.scpi.calculate.selected.marker(mkrNo).state = true
        ana.scpi.calculate.selected.marker(mkrNo).activate
   case 4
        ana.scpi.calculate.selected.marker(mkrNo).function.type ="maximum"
        ana.scpi.calculate.selected.marker(mkrNo).function.execute
   case 5
        ana.scpi.calculate.selected.marker(mkrNo).function.type ="minimum"
        ana.scpi.calculate.selected.marker(mkrNo).function.execute
   end select

End Sub