Introduction

With the installation of the Advanced Customization (XDEV) option on MAUI® oscilloscopes, you can create a measurement parameter whose input value is dynamically updated with each new trigger by the output value of another measurement parameter. All that is required is three simple lines of VBScript.

To demonstrate, we'll use the example of taking the x@max value measured on each acquisition and using it to dynamically populate the X position used by the measurement parameter lvl@x. However, these principles could be applied to any two parameters that share a logical/mathematical relationship, or to a parameter and a math function (for example, to use the output of a parameter as the multiplier for a Rescale function).

How It Works

Advanced Customization enables you to insert custom math and measurement processors into the MAUI oscilloscope application. These processors compute in "real time" with results that appear on the oscilloscope application display, the same as all other MAUI processors.

All custom processors operate on the oscilloscope's COM Automation interface objects, which are exposed by the MAUI Browser. Several languages can be used to write processors, but the simplest is VBScript, which is the native scripting language of the MAUI application. VBScripts can be easily created and assigned directly in the MAUI user interface, as we'll demonstrate here.

For dynamic measurements, a "host" parameter (Pn) is set up with a custom VBScript that reads the output value of one parameter and pushes it into one of the input fields of another parameter. As the parameters are recalculated with each acquisition, the variable value is dynamically updated.

image of warning icon

CAUTION Because of the dependencies created by the MAUI application order of processing, we do not recommend setting up more than one dynamic field in any parameter or using this method to "chain" more than two parameters. You can, however, run more than one dynamic measurement simultaneously provided they do not use the same input/output parameters.

VBScript Syntax

The basic syntax for creating a dynamic measurement is:

Create COM object handle

Set app = CreateObject("LeCroy.XStreamDSO")

 

Define the output variable

var = app.Measure.P1.Out.Result.Value

Read output from P1

Define the input variable

app.Measure.P2.Operator.field = var

Push the P1 output into the target P2 field

Where:

  1. var is whatever handle you wish to give the variable value. Our examples use 'x_at_max'.
  2. field is the parameter input field where the value will be inserted. Our examples use 'HorValue'.

We've used P1 and P2 to distinguish the first parameter from the second parameter, but in practice these could be any two parameters in your system, provided they are distinct from each other and from the VBScript host parameter. You are not syntactically restricted to using P1 and P2.

Some optional settings can be added to the host parameter (Pn) display as a consistency check to confirm the script is pulling the correct value from P1. They are:

 

OutResult.Value = var

Display the P1 output in the Pn table cell to confirm that the value was read properly

 

OutResult.VerticalUnits = app.Measure.P1.Out.Result.VerticalUnits

Use same vertical unit in Pn as P1

 

OutResult.VerticalResolution = value

Set display resolution of Pn table cell to value

Finding the Automation Objects in MAUI Browser

To write your script, you will need to find the Automation Result Interface (output) that exposes the output value, and the Control Variable (input) that will receive that output value. This can be done prior to or at the time of scripting.

The MAUI Browser installed on the oscilloscope desktop (and on PCs with MAUI Studio) shows the entire COM Automation hierarchy of the oscilloscope application. By expanding the folders, you can navigate to any COM object and copy its full string for use in scripts.

If you're working on the oscilloscope, choose File > Minimize or File > Windowed to show the desktop and launch MAUI Browser.

Note: The icon may be labeled MAUI Studio Browser or MAUI Automation Browser, and you'll see it called XStream Browser elsewhere in the application. They are the same thing.

In our example, the X position field of the P2 lvl@x measurement will be updated dynamically using the last P1 x@max value, so we need to find the COM object strings for:

• The P1 output value. Expand the Measure > P1 folder, and look in the gray, "Result" folder for output objects. The last output value is exposed by: app.Measure.P1.Out.Result.Value.

screenshot in maui browser

• The P2 horizontal input field. Expand the Measure > P2 folder, and look in the yellow, "Operator" folder for input CVARs. The horizontal input field is: app.Measure.P2.Operator.HorValue.

screenshot in maui browser

Note that on the MAUI GUI, this field is labeled X Position. One way to tell which CVAR corresponds to which field is to set a known value in the application field, which will appear in the browser when you refresh the object hierarchy.

Once you find and select the object that will be used by your script, the full Automation string appears in the MAUI Browser message bar. Right-click in the browser window and choose Copy Path to put it on your clipboard, ready to paste into your script.

Step-by-Step

1. Stop acquisition.

2. On the MAUI Measure Setup dialogs, create P1 and P2 as usual. In our example, x@max is set up in P1:

screenshot maui setup

lvl@x is set up in P2. We can just leave the default setting for the X Position field of lvl@x, since that value will be updated dynamically by the script.

screenshot maui setup

3. Create the host parameter using the Param script custom measurement. We've set it up in P3.

screenshot maui setup

Since this parameter is not directly measuring a waveform, it does not matter what the Source is, but to be consistent with P1 and P2, we've used C1.

screenshot maui script editor

4. On the Script Math subdialog, click Edit Code to open the Script Editor window. You can begin scripting right in the window, paste from another editor, or upload a saved script file.

5. When finished scripting, click Apply. This loads the script into the P3 processor, where it will begin operating with the next acquisition.

6. Restart acquisition.

The script above results in the following Measure display:

screenshot xdev measure display

Note how the P3 table cell is showing the same value as P1, due to the display settings we added, and the P2 X Position field is also the same as the P1 value.

If you were to do this example on your oscilloscope, you would see the P2 X Position field update dynamically with each trigger to the same value as shown under P1 in the Measure table.

See this demonstrated in our video: Configuring Dynamic Oscilloscope Measurements Using Advanced Customization.