Save, recall, and script oscilloscope settings



Introduction

Digital oscilloscopes have a great thing going for them: they are digital. Instrument settings, waveforms, and screen images can be saved as digital files either internally or to external devices. Not only can they be saved, but they can be recalled to the oscilloscope or an offline program to review the data and, in some cases, for additional analysis and measurements.

The ability to save setups is one of the great benefits of digital oscilloscopes. It saves lots of time setting up measurements, allowing settings of previous work sessions to be recalled and work resumed in seconds. A series of recalled settings can even be the basis for a comprehensive test procedure.

Digital oscilloscopes preserve the last settings when powered down and restore them when power is restored. That can be a problem if that state is not what you need. For instance, If the previous user set the oscilloscope to trigger on an external signal and you want to trigger on one of the internal channels there will be a problem unless you check first and update the settings. The easiest way to ensure the state of the oscilloscope when first powered on is to recall its default setup. The default setup is a known state defined by the manufacturer. The default state is generally helpful in getting data on the screen. It usually places the instrument in an auto-trigger mode so there will be a trace on the screen. Starting with the default state the instrument can be set to make the desired measurement. When that state is reached simply saving that setup state means that it can be recalled at need.

Setup files

Setup file formats vary between oscilloscope suppliers. Teledyne LeCroy uses Visual Basic for setup files. Most other suppliers use Standard Commands for Programmable Instruments (SCPI) for settings. Both use ASCII text which is easy to read and edit.

Figure 1 shows part of a typical setup file for a mid-range Teledyne LeCroy oscilloscope.

Figure 1 Part of a setup file for a Teledyne LeCroy Windows-based oscilloscope using ASCII text-based Visual Basic script. The command for setting the vertical scale of channel 1 is highlighted. Source: Art Pini

The setup files in this oscilloscope are a complete Visual Basic Script. This script can be thought of as a program that when executed sets up the oscilloscope in the state described. When a setting file is saved, it contains a Visual Basic program to restore the instrument settings upon execution. Visual Basic scripts allow the user to incorporate all the power and flexibility of the Visual Basic programming language, including looping and conditional branching.

The control statements for each function of the oscilloscope are based on a hierarchical structure of oscilloscope functions, which is documented in the automation and remote-control manual as well as in a software application called Maui Browser (formerly XStream Browser), which is included with every Windows oscilloscope. The manual includes detailed instructions on using the Maui Browser. The browser connects to the oscilloscope, either locally or remotely, and exposes the automation components as seen in Figure 2.

Figure 2 A view of the Maui Browser, connected locally to an oscilloscope, showing the control selections for channel C1 under the Acquisition function. The vertical scale setting is highlighted. Source: Art Pini

Each functional category of the oscilloscope’s operation is listed in the left-hand column. Acquisition, one of the high-level functions, has been selected in this example. Under that selection is a range of sub-functions related to the acquisition function, including Channel 1 (C1), which has been selected. The table on the right lists all the controls associated with channel 1. Note that the Vertical Scale (Ver Scale) setting has been selected and highlighted. The current setting of 200 mV per division is shown. To the right is a summary of the range of values available for the vertical scale function. The value can be changed on the connected oscilloscope by highlighting the numeric value and changing it to one of the appropriate values within the range.

An example of a simple command is setting the vertical scale of channel 1 (C1) to 200 mV per division. The command structure for the selected command is at the bottom of the figure. All that has to be added is the parameter value, 0.2 in this case- “app.Acquisition.C1.VerScale=0.2”

The Maui Browser is a tool for looking up the desired setting command without the need for a programming manual. It is also helpful for verifying selected commands and associated parameters. The browser program is updated with the oscilloscope firmware and is always up to date, unlike a paper manual.

Scripting

With Visual Basic scripts being used internally to program the oscilloscope and automate the settings operations, the logical step is to have Visual Basic scripts control and automate scope operations. This operation happens within the oscilloscope itself; there is no need for an external controller. Visual Basic scripting uses Windows’ built-in text editor (Notepad) and the Visual Basic Script interpreter (VBScript), which is also installed in this family of oscilloscopes.

The Teledyne LeCroy website has many useful scripts for their oscilloscopes posted on the website, they perform tasks like setting up a data logging operation, saving selected measurements to spreadsheet files, or using cursors to set measurement gate limits. These can be used as written, but they can also serve as examples on which to base your script. Consider the following example. Figure 3 shows a settings script that allows a zoom trace to be dynamically centered on the position of the absolute horizontal cursor. As the cursor is moved the zoom tracks the movement.

Figure 3 A Visual Basic script that centers a zoom trace on the current horizontal cursor location. Source: Art Pini

The script is copied to the oscilloscope and either recalled using the recall setup function of the oscilloscope or executed by highlighting the script file in Windows File Explorer and double-clicking on it. The script turns on the cursor and the zoom trace and adjusts the center of the zoom trace to match the current cursor’s horizontal location as seen in Figure 4.

Figure 4 The script centers the zoom trace on the absolute horizontal cursor location and tracks it as it is moved. Source: Art Pini

The script operates dynamically; as the cursor is moved, the zoom trace tracks the movement instantly. The script runs continuously and is stopped by turning off the cursor. The message, “Script running; turn off cursor to stop,” appears in the message field in the lower left corner of the screen.

CustomDSO

Teledyne LeCroy oscilloscopes incorporate the advanced customization option, including the CustomDSO feature, which allows user-defined graphical interface elements to be called Visual Basic scripts. The basic mode of CustomDSO creates a simple push-button interface used to run setup scripts. The touch of a single button within the oscilloscope user interface can recall scripts. The recalled setups can include other nested setups. This allows users to create a complex series of setups. CustomDSO Plug-In mode will enable users to create an ActiveX Plug-In designed in an environment like Visual Studio and merge this graphical user interface with the scope user interface.

Figure 5 shows the CustomDSO user interface.

Figure 5 The CustomDSO basic mode setup links a user interface push button to a specific setup script file. Source: Art Pini

In basic mode, CustomDSO links eight user interface push buttons with setup scripts. A checkbox enables showing the CustomDSO menu on powerup when no other menu is being displayed.

Figure 6 shows the CustomDSO user interface with the first pushbutton linked to the script to have the zoom center track the cursor.

Figure 6 The user interface for the basic CustomDSO mode with the leftmost pushbutton linked to the zoom tracking script. Source: Art Pini

The basic user interface has eight push buttons that can be linked with setup scripts. In this example, the leftmost push button, which is highlighted, has been linked to the script “Track Zoom.lss”. The oscilloscope uses the root name of the script as the push button label. This capability allows test designers to allow users with less training to recall all the elements of a test procedure.

Some other oscilloscopes can store several setups and then sequence through them as a macro program. This is similar but lacks any flow control when executing the macro.

The Plugin mode of CustomDSO is an even more powerful feature that allows user-programmed ActiveX controls to create a custom graphical user interface. The plugins are powered by routines written in Visual Basic, Visual C++, or other ActiveX-compatible programming languages. Many interactive devices are available, including buttons, a check box, a radio button, a list box, a picture box, and a common dialogue box. A detailed description of plugin generation is beyond the scope of this article.

Recall instrument setups

The use of Visual Basic scripts enables these oscilloscopes to recall instrument setups easily and enhances this process with the ability to program a series of setups into a test procedure. It also offers the ability to use custom user graphical interfaces to simplify operations.

Arthur Pini is a technical support specialist and electrical engineer with over 50 years of experience in electronics test and measurement.

Related Content

<!–
googletag.cmd.push(function() { googletag.display(‘div-gpt-ad-native’); });
–>

The post Save, recall, and script oscilloscope settings appeared first on EDN.


Discover more from TrendyShopToBuy

Subscribe to get the latest posts sent to your email.

Latest articles

spot_imgspot_img

Related articles

Leave a Reply

spot_imgspot_img

Discover more from TrendyShopToBuy

Subscribe now to keep reading and get access to the full archive.

Continue reading