LECROY X - S TR E A M OSCILLOSCOPES REMOTE CONTROL MANUAL F E B R U A RY 2 0 0 5
LeCroy Corporation 700 Chestnut Ridge Road Chestnut Ridge, NY 10977–6499 Tel: (845) 578 6020, Fax: (845) 578 5985 Internet: www.lecroy.com © 2005 by LeCroy Corporation. All rights reserved. LeCroy, ActiveDSO, ProBus, SMART Trigger, JitterTrack, WavePro, WaveMaster, WaveSurfer, and Waverunner are registered trademarks of LeCroy Corporation. Information in this publication supersedes all earlier versions. Specifications subject to change without notice.
TABLE OF CONTENTS INTRODUCTION.................................................................................................. 1 PART ONE: ABOUT REMOTE CONTROL ...............3 CHAPTER ONE: OVERVIEW.............................................................................. 4 Operate Your X-Stream Scope by Remote Control ............................................................. 5 STANDARDS ...........................................................................................................
TA B L E OF CONTENTS Timing and Synchronization................................................................................................27 STATUS REGISTERS .........................................................................................................28 SYNCHRONIZING WITH *OPC? AND WAIT .....................................................................29 CHAPTER THREE: CONTROL BY LAN ...........................................................32 Introduction ..........................
TA B L E OF CONTENTS CHAPTER SIX: LINKING WITH AUTOMATION ............................................... 68 What is Automation? ............................................................................................................69 OVERVIEW ......................................................................................................................... 69 SOME DETAILS ..................................................................................................................
BLANK PAGE vi ISSUED: February 2005 WM-RCM-E Rev D
I N T R O D U C T I O N About this Manual This manual explains how to control the instrument from a computer, using commands keyed or programmed into an external controller. This controller is usually a computer, but it could be a simple terminal. The manual includes a complete list of the commands that you will need to perform remote control operations with the instrument.
BLANK PAGE 2 ISSUED: February 2005 WM-RCM-E Rev D
PART ONE ABOUT REMOTE CONTROL Part One explains how the instrument operates under remote control. It covers GPIB and LAN interfaces, the transfer and formatting of waveforms, and the use of status bytes in reporting errors.
C H A P T E R O N E : Overview In this chapter, see how to 4 ¾ Construct program messages ¾ Use commands and queries ¾ Include data, and make data strings ISSUED: February 2005 WM-RCM-E Rev D
CHAPTER Overview ONE Operate Your Instrument by Remote Control You can fully control your instrument remotely by using either the optional GPIB (General Purpose Interface Bus) port, if available, or the LAN communication port on the scope's I/O panel, shown below (8). The only actions for which you must use the front panel controls are to power up the scope and to set remote control addresses.
PA RT O N E : A B O U T R E M OT E C O N T RO L PROGRAM MESSAGES You control the oscilloscope remotely using program messages that consist of one or more commands or queries. The program messages you send from the external controller to the X-Stream oscilloscope must conform to precise format structures. The oscilloscope will execute all program messages sent in the correct form, but will ignore those with errors.
CHAPTER ONE: Overview TIP: The response to a query can be a useful way of generating a command that is known to be correct, and the response can be copied straight into your program. A query causes the oscilloscope to send a response message. The control program should read this message with a ‘read’ instruction to the GPIB or LAN interface of the controller.
PA RT O N E : A B O U T R E M OT E C O N T RO L HEADERS The header is the mnemonic form of the operation to be performed by the oscilloscope. Most command and query headers have a long form, which allows them to be read more easily by people, and a short form for better transfer and decoding speed. The two are fully equivalent and you can use them interchangeably. For example, TRIG_MODE AUTO and TRMD AUTO are two separate but equivalent commands for switching to the automatic trigger mode.
CHAPTER ONE: Overview NOTE: If you use one of the older trace labels, for example "TC", any response from the scope uses the new label; for example, it substitutes F3 for TC. DATA Whenever a command or query uses additional data values, the values are expressed as ASCII characters. There is a single exception: the transfer of waveforms with the command/query WAVEFORM, where the waveform can be expressed as a sequence of binary data values. See Chapter 4, “Wavefo r m St r uc ture.
PA RT O N E : A B O U T R E M OT E C O N T RO L You can follow numeric values with multipliers and units to modify the value of the numerical expression. The following mnemonics are recognized: Multiplier Exp. Note. Suffix Multiplier Exp. Note.
CHAPTER ONE: Overview Whenever you expect a response from the oscilloscope, you must have the control program instruct the GPIB or LAN interface to read from the oscilloscope. If the controller sends another program message without reading the response to the previous one, the response message in the output buffer of the oscilloscope will be discarded. The oscilloscope keeps to stricter rules for response messages than for acceptance of program messages.
C H A P T E R T W O : Control by GPIB In this chapter, see how to ¾ Address your X-Stream scope for GPIB ¾ Configure GPIB software ¾ Enable remote and local control ¾ Make transfers of data ¾ Make service requests ¾ Poll your X-Stream scope ¾ Set timing and synchronization 12 ISSUED: February 2005 WM-RCM-E Rev D
CHAPTER Control by GPIB TWO Talk, Listen, or Control You can control your X-Stream DSO remotely, using the General Purpose Interface Bus (GPIB). GPIB is similar to a standard computer bus. But while the computer interconnects circuit cards by means of a backplane bus, the GPIB interconnects independent devices (oscilloscopes and computers, for example) by means of a cable bus. GPIB also carries both program and interface messages.
PA RT O N E : A B O U T R E M OT E C O N T RO L INTERFACE X-Stream DSO interface capabilities include the following IEEE 488.
CHAPTER TWO: Control by GPIB To make an actual talk address and listen address, we have to add the GPIB address to the ASCII values of the base characters, to give the ASCII value of the new character. So a string of these commands looks like a random set of characters. Using named variables makes programs easier to understand. For example, if we have a DSO at GPIB address 4, and a PC at address 4, we construct the command strings as follows, for use later in the program.
PA RT O N E : A B O U T R E M OT E C O N T RO L • EOI (End Or Identify): This line has two purposes: The talker uses it to mark the end of a message string. The controller uses it to tell devices to identify their response in a parallel poll (discussed later in this section). I/O BUFFERS The oscilloscope has 256-byte input and output buffers. An incoming program message is not decoded before a message terminator has been received.
CHAPTER TWO: Control by GPIB DEVICE CLEAR In response to a universal Device CLear (DCL) or a Selected Device Clear message (SDC), the X-Stream DSO clears the input or output buffers, cancels the interpretation of the current command (if any) and clears pending commands. However, status registers and status-enable registers are not cleared. Although DCL will have an immediate effect, it can take several seconds to execute if the oscilloscope is busy.
PA RT O N E : A B O U T R E M OT E C O N T RO L The host computer requires an interface driver that handles the transactions between the operator’s programs and the interface board. In the case of the National Instruments interface, the installation procedure will: • Copy the GPIB handler GPIB.COM into the boot directory. • Modify the DOS system configuration file CONFIG.SYS to declare the presence of the GPIB handler.
CHAPTER TWO: Control by GPIB MAKE SIMPLE TRANSFERS For a large number of remote control operations, it is sufficient to use just three different subroutines (IBFIND, IBRD and IBWRT) provided by National Instruments. The following complete program reads the timebase setting of the X-Stream DSO and displays it on the terminal: GPIB: This line holds the INCLUDE for the GPIB routines Find: DEV$ = “DEV4” address 4.
PA RT O N E : A B O U T R E M OT E C O N T RO L When running this sample program, the X-Stream DSO will automatically be set to the remote state when IBWRT is executed, and will remain in that state.
CHAPTER TWO: Control by GPIB USE ADDITIONAL DRIVER CALLS IBLOC is used to execute the IEEE 488.1 standard message Go To Local (GTL); i.e., it returns the oscilloscope to the local state. The programming example above illustrates its use. IBCLR executes the IEEE 488.1 standard message Selected Device Clear (SDC). IBRDF and IBWRTF, respectively, allow data to be read from GPIB to a file, and written from a file to GPIB.
PA RT O N E : A B O U T R E M OT E C O N T RO L MAKE SERVICE REQUESTS When an X-Stream DSO is used in a remote application, events often occur asynchronously, i.e., at times that are unpredictable for the host computer. The most common example of this is a trigger wait after the oscilloscope is armed: the controller must wait until the acquisition is finished before it can read the acquired waveform.
CHAPTER TWO: Control by GPIB Take Instrument Polls You can regularly monitor state transitions within the oscilloscope by polling selected internal status registers. There are four basic polling methods you can use to detect the occurrence of a given event: continuous, serial, parallel, and *IST. By far the simplest of these is continuous polling. The others are appropriate only when interrupt-service routines (servicing the SRQ line) are supported, or multiple devices on GPIB require constant monitoring.
PA RT O N E : A B O U T R E M OT E C O N T RO L TAKE A SERIAL POLL Serial polling takes place once the SRQ interrupt line has been asserted, and is only advantageous when you are using several oscilloscopes at once. The controller finds which oscilloscope has generated the interrupt by inspecting the SRQ bit in the STB register of each. Because the service request is based on an interrupt mechanism, serial polling offers a reasonable compromise in terms of servicing speed in multiple-device configurations.
CHAPTER TWO: Control by GPIB In the following example, the command INE 1 enables the event “new signal acquired” in the INR to be reported to the INB bit of the status byte STB. The PaRallel poll Enable register (PRE) determines which events will be summarized in the IST status bit. The command *PRE 1 enables the INB bit to set the IST bit whenever it is itself set. Once parallel polling has been established, the parallel-poll status is examined until a change on data bus line DIO2 takes place. Stage 1 1.
PA RT O N E : A B O U T R E M OT E C O N T RO L The listener and talker addresses for the controller and the X-Stream DSO are: LOGIC DEVICE LISTENER ADDRESS TALKER ADDRESS External Controller 32 (ASCII) 64 (ASCII @) X-Stream DSO 32 + 4 = 36 (ASCII $) 64 + 4 = 68 (ASCII D) PERFORM AN *IST POLL You can also read the state of the Individual STatus bit (IST) returned in parallel polling by sending the *IST? query.
CHAPTER TWO: Control by GPIB Timing and Synchronization Depending on how your remote program is written, it may be affected by timing changes between different DSO series, even between Waverunner DSOs and WavePro DSOs. In X-Stream DSOs, these effects may be even more pronounced than in previous scopes, for several reasons. Firstly, X-Stream DSOs are faster than our earlier scopes. Secondly, X-Stream DSOs support faster interfaces. That is, the standard network interface is 100Base-T instead of 10Base-T.
PA RT O N E : A B O U T R E M OT E C O N T RO L STATUS REGISTERS Status registers store a record of events and conditions that occur inside the DSO. Some of the events recorded are: New data has been acquired; Processing has completed; Hardcopy has completed; An error has occurred; etc. The programmer can use the registers to sense the condition of the instrument by polling them until the desired status bit has been set. A status register can be polled by querying its associated remote command (e.g.
CHAPTER TWO: Control by GPIB If the data have already been acquired and you want to do further analysis (math, parameters, cursors) on it, you can proceed as shown in Figure 2: For more details on Status registers, see Chapter 5. SYNCHRONZING WITH *OPC? AND WAIT The *OPC? query returns a 1 when the previous commands have finished. Therefore, you can use this query with the WAIT command to synchronize the scope with your controller, using the steps shown in Figure 3 below.
PA RT O N E : A B O U T R E M OT E C O N T RO L §§§ 30 ISSUED: February 2005 WM-RCM-E Rev D
CHAPTER TWO: Control by GPIB BLANK PAGE WM-RCM-E Rev D ISSUED: February 2005 31
C H A P T E R T H R E E : Control by LAN In this chapter, see how to ¾ Control X-Stream by LAN ¾ Simulate GPIB messages using LAN 32 ISSUED: February 2005 WM-RCM-E Rev D
CHAPTER Control by LAN THREE Introduction ¾ The Ethernet connection (10Base-T and 100Base-T) allows you to control the instrument over a network, or through a direct connection between the oscilloscope and a computer. The connection is made through the Ethernet port located at the rear of the oscilloscope. ¾ This chapter introduces the basic capabilities for control of the instrument over the Ethernet interface. This manual gives a complete description of the remote control commands.
PA RT O N E : A B O U T R E M OT E C O N T RO L Scope Rear Panel The LAN connector is shown in the illustration above (item 8). • Supports IEEE 802.3 Ethernet standards • Supports 10Base-T and 100Base-T Ethernet Connection The instrument operates over a standard 10Base-T/100Base-T Ethernet connection. The instrument can be plugged into a network or operated from a direct connection to a host computer. A different type of cable is required for each of these connections.
C H A P T E R T H R E E : Control by LAN The ‘Operation’ bits and meanings are: D7 D6 D5 D4 D3 D2 D1 D0 DATA REMOTE LOCKOUT CLEAR SRQ SERIAL POLL Reserved EOI DATA BIT MNEMONIC PURPOSE D7 DATA Data block (D0 indicates termination with/without EOI) D6 REMOTE Remote Mode D5 LOCKOUT Local Lockout (Lock out front panel) D4 CLEAR Device Clear (if sent with data, clear occurs before data block is passed to parser) D3 SRQ SRQ (Device to PC only) D2 SERIALPOLL Request a serial po
PA RT O N E : A B O U T R E M OT E C O N T RO L Manual Setting of LAN Address If you do need to set an address for the instrument, go into Windows and perform the usual operations for setting an address. Before establishing a direct connection between the oscilloscope and the host computer, the PC must first be properly configured. A specific TCP/IP address must be assigned — known as "static addressing." But this means that the PC cannot be set up to obtain its IP address from a DHCP server.
C H A P T E R T H R E E : Control by LAN 3. If the TCP/IP protocol is not listed, you will have to add it. Follow your operating system user guide to add the TCP/IP protocol and bind it to the Ethernet adapter. 4. Double-click the 5. If this has already been selected, the computer’s static address is set and nothing more needs to be done. Cancel out of the TCP/IP and network dialog boxes, and close the control panel. 6.
PA RT O N E : A B O U T R E M OT E C O N T RO L address (or almost any address within the chosen subnet) will suffice. The only address that will not work is the same one as that of the oscilloscope to be controlled. 7. Now click in the TCP/IP Properties dialog box. Depending on the operating system and version, you may need to reboot the computer. If so, a dialog box should alert you to this. Making Physical Connection To make the physical connection between the oscilloscope and the host computer: 1.
C H A P T E R T H R E E : Control by LAN Network Connection Check with your network administrator before connecting the oscilloscope to a network. Incorrect addresses on a network can cause both the network and the oscilloscope to behave strangely. However, a network connection ought to be as simple as plugging the oscilloscope into the network. Proper connection can be verified by following the verification instructions in the previous section.
PA RT O N E : A B O U T R E M OT E C O N T RO L Introduction to Software Tools The instrument software tools allow you to develop your own application specific programs quickly and easily. These tools are based on ActiveDSO™. The files for all the software described here are to be found on the CD-ROM and on LeCroy’s Web site at http://www.lecroy.com/tm/library/software/.
C H A P T E R T H R E E : Control by LAN 1. Ensure that the ActiveDSO files from the CD-ROM are installed on the PC. 2. Verify that the PC and instrument are properly connected to the Ethernet. 3. Open a new blank presentation in PowerPoint. Note: This example assumes that PowerPoint 2002 is being used. Earlier (or Later) versions may not behave in the same manner. 4.
PA RT O N E : A B O U T R E M OT E C O N T RO L 5.
C H A P T E R T H R E E : Control by LAN 6. From the Edit menu, select LeCroy ActiveDSO Control Object, then Edit:: 7. Right-click the object and select Make Connection. 8.
PA RT O N E : A B O U T R E M OT E C O N T RO L 9. Enter the instrument’s IP address and click OK. The address can also be specified in URL form, or 127.0.0.1 if you are running the controlling application on the instrument.
C H A P T E R T H R E E : Control by LAN 10. Right-click the object again and select the Refresh Image menu item. A captured waveform will be displayed similar to the one shown here: Instrument’s captured waveform imported into PowerPoint Once the ActiveDSO object has been properly set within the application, a macro script can be created, utilizing an object method such as WriteString() to send DISP ON, C1:TRA ON, TRMD. Then RefreshImage() method can be used to update the screen.
PA RT O N E : A B O U T R E M OT E C O N T RO L Example: VBA VBA is the programming language built in to many of the more recent Windows applications. It is a subset of Visual Basic that makes using OLE Automation Servers and ActiveX Controls very simple. The following VBA subroutine demonstrates how easy it is to connect to an instrument and send remote commands to it. _______________________________________________________ Sub LeCroyDSOTest() Dim dso As Object Set dso = CreateObject("LeCroy.ActiveDSO.
C H A P T E R T H R E E : Control by LAN • Archive measurement results on the fly in a Microsoft Access Database. • Automate tests using Visual Basic, Java, C++, Excel (VBA). • The ActiveDSO control hides the intricacies of programming and provides a simple and consistent interface to the controlling application. With less than 10 lines of VBA (Visual Basic for Applications) code in an Excel macro the spreadsheet can recover pre-scaled waveform data from a remote instrument.
PA RT O N E : A B O U T R E M OT E C O N T RO L • Returns: True on success, False on failure. • Remarks: This method sends a string command to the instrument. • If EOI is set to TRUE, the device will start to interpret the command immediately. This is normally the desired behavior. • If EOI is set to FALSE, a command may be sent in several parts with the device starting to interpret the command only when it receives the final part, which should have EOI set to TRUE.
C H A P T E R T H R E E : Control by LAN BLANK PAGE WM-RCM-E Rev D ISSUED: February 2005 49
C H A P T E R F O U R : Understanding and Managing Waveforms In this chapter, see how to ¾ Structure Waveforms ¾ Inspect waveform contents ¾ Transfer waveforms rapidly 50 ISSUED: February 2005 WM-RCM-E Rev D
CHAPTER FOUR Understanding and Managing Waveforms Know Your Waveform A waveform can be said to have two main parts. One is its basic data array: raw data values from the oscilloscope’s ADCs (Analog-to-Digital Converters) obtained in the waveform’s capture. The other is the description that accompanies this raw data: the vertical and horizontal scale or time of day, for example, necessary for a full understanding of the information contained in the waveform.
PA RT O N E : A B O U T R E M OT E C O N T RO L Second Data Array block (DATA_ARRAY_2): This is a second data array, needed to hold the results of processing functions such as Extrema or FFT math functions: EXTREMA FFT DATA_ARRAY_1 Roof trace Real part DATA_ARRAY_2 Floor trace Imaginary part NOTE: The instrument template also describes an array named DUAL. But this is simply a way to allow the INSPECT? command to examine the two data arrays together.
C H A P T E R F O U R : Understanding and Managing Waveforms WAVEFORM?. The examination of data values for waveforms with two data arrays can be performed as follows: INSPECT? “DUAL” INSPECT? “DATA_ARRAY_1” INSPECT? “DATA_ARRAY_2” to get pairs of data values on a single line to get the values of the first data array to get the values of the second data array INSPECT? has its limitations; it is useful, but also wordy. INSPECT? cannot be used to send a waveform back to the oscilloscope.
PA RT O N E : A B O U T R E M OT E C O N T RO L USE THE WAVEFORM QUERY Use the WAVEFORM? query to transfer waveform data in block formats defined by the IEEE 488.2 standard. You can then download the response back to your instrument by using the WAVEFORM command.
C H A P T E R F O U R : Understanding and Managing Waveforms BYTE OFFSET NUMBER 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256 272 288 304 320 336 352 BINARY CONTENTS IN A SC II T R A N S L A T I O N (....
PA RT O N E : A B O U T R E M OT E C O N T RO L On the previous page... The first 10 bytes translate into ASCII and resemble the simple beginning of a query response. These are followed by the string #9000000450, the beginning of a binary block in which nine ASCII integers are used to give the length of the block (450 bytes). The waveform itself starts immediately after this, at Byte 21. The very first byte is at zero byte count, as it is for the first byte in each block.
C H A P T E R F O U R : Understanding and Managing Waveforms INTERPRET VERTICAL DATA Knowing now how to decipher the data, you may wish to convert it to the appropriate measured values. The vertical reading for each data point depends on the vertical gain and the vertical offset given in the descriptor. For acquisition waveforms, this corresponds to the volts/div and voltage offset selected after conversion for the data representation being used.
PA RT O N E : A B O U T R E M OT E C O N T RO L CALCULATE A DATA POINT’S HORIZONTAL POSITION Each vertical data value has a corresponding horizontal position, usually measured in time or frequency units. The calculation of this position depends on the type of waveform. Each data value has a position, i, in the original waveform, with i = 0 corresponding to the first data point acquired. The descriptor parameter HORUNIT gives a string with the name of the horizontal unit.
C H A P T E R F O U R : Understanding and Managing Waveforms Sequence waveforms: are really many independent acquisitions, so each segment will have its own horizontal offset. These can be found in the TRIGTIME array. For the nth segment: x[i,n] = HORIZ_INTERVAL x i + TRIGGER_OFFSET[n]. The TRIGTIME array can contain up to 200 segments of timing information with two eight-byte double precision floating point numbers for each segment.
PA RT O N E : A B O U T R E M OT E C O N T RO L USE THE WAVEFORM COMMAND Waveforms you read with the WAVEFORM? query can be sent back into your instrument using WAVEFORM and related commands. Since the descriptor contains all of the necessary information, you need not be concerned with any of the communication format parameters. The oscilloscope will learn all it needs to know from the waveform.
C H A P T E R F O U R : Understanding and Managing Waveforms Transfer Waveforms at High Speed You must take several important factors into account if you wish to achieve maximum, continuous data transfer rates from your instrument to the external controller. The single most important of these is to limit the amount of work done in the computer.
C H A P T E R F I V E : Checking Waveform Status In this chapter, see how to ¾ 62 Use status registers ISSUED: February 2005 WM-RCM-E Rev D
CHAPTER Checking Waveform Status FIVE Use Status Registers A wide range of status registers allows you to quickly determine the instrument's internal processing status at any time. These registers and the oscilloscope’s status reporting system, which group related functions together, are designed to comply with IEEE 488.2 recommendations. Some, such as the Status Byte Register (STB) or the Standard Event Status Register (ESR), are required by the IEEE 488.2 Standard.
PA RT O N E : A B O U T R E M OT E C O N T RO L Power ON User request (U R R ? ) Command error found ( C M R ? ) Execution error detected ( E X R ? ) Device specific er ror ( D D R ? ) Quer y er ror Request control (unused) Operation complete 7 6 5 3 4 1 2 0 & Standard Event Status Register Read by * E S R ? Logical OR & & & & & Inter nal State Change Register Read by I N R ? & & See I N R command for the interpretation of the bits.
CHAPTER FIVE: CHECKING WAVEFORM STATUS If you enabled the setting of the ESB summary bit in STB, again nothing would occur unless you enabled further reporting by setting the corresponding bit in the SRE register with the command *SRE 32. The generation of a non-zero value of CMR would ripple through to MSS, generating a Service Request (SRQ). You can read the value of CMR and simultaneously reset to zero at any time with the command CMR?.
PA RT O N E : A B O U T R E M OT E C O N T RO L Example: The response message *ESR 160 tells you that a command error occurred and that the ESR is being read for the first time after power-on. The value 160 can be broken down into 128 (Bit 7) plus 32 (bit 5). See the table with the ESR command description in Part Two for the conditions corresponding to the bits set. The Power ON bit appears only on the first *ESR? query after power-on, as the query clears the register.
CHAPTER FIVE: CHECKING WAVEFORM STATUS INTERNAL STATE CHANGE ENABLE REGISTER (INE) INE allows one or more events in the Internal State Change Status Register to be reported to the INB summary bit in the STB. Modify INE with INE and clear it with INE 0, or after power-on. Read it with INE?. COMMAND ERROR STATUS REGISTER (CMR) This register contains the code of the last command error detected by the oscilloscope. List these error codes using CMR?. Read CMR with CMR?. The response is the error code.
C H A P T E R S I X : Linking with Automation In this chapter, discover ¾ What Automation is ¾ How to use the VBS command 68 ISSUED: February 2005 WM-RCM-E Rev D
CHAPTER Linking With Automation SIX What is Automation ? OVERVIEW Automation enables you to control programs from your own applications as if you were using a keyboard and a mouse. For example, if you want to use Excel, Mathcad, MATLAB, or other proprietary programs, you can do so within the chain of operations of the oscilloscope, without having to go outside the X-Stream software to instantiate the proprietary software. Here we offer a simple introduction.
PA RT O N E : A B O U T R E M OT E C O N T RO L Display.AxisYRotation = 20 Display.PersistenceSaturation = 50 Display.PersistenceTime = "Infinite" Display.PersistenceLastTrace = False ' Automation remote control ' commands are merely copies of ' statements like these. Set Acquisition = WaveMaster.Acquisition ' Acquisition ... ' Acquisition.TriggerMode = "Stopped" ' ' Set C1 = Acquisition.C1 ' ' C1 ... ' C1.View = True ' C1.UseGrid = "YT1" ' C1.UseDotJoin = True C1.Persisted = False C1.
CHAPTER SIX: LINKING WITH AUTOMATION HOW TO USE THE VBS COMMAND The key to using automation commands in an existing GPIB program is the VBS command. This is described in detail in Part Two of this manual. Please note that “app” refers to the instrument application program. It can be defined by a statement like this: Set WaveMaster = CreateObject(“LeCroy.WaveMasterApplication”) Here are some examples of VBS, with the older GPIB equivalents. The command syntax is VBS . CMD$=“VBS ‘app.
PA RT O N E : A B O U T R E M OT E C O N T RO L HOW TO USE X-STREAM BROWSER The number of different variables and methods in a complete setup is obviously large. To facilitate the job of creating control statements, LeCroy has produced the program XStreamBrowser. Using this program, you can quickly find the information that corresponds to any part of the instrument. On opening XStreamBrowser, you will see three icons at the top left of the screen.
CHAPTER SIX: LINKING WITH AUTOMATION DCOM permits the distribution of different components for a single application across two or more networked computers, running an application distributed across a network and remotely displaying an application. The third icon refreshes the connection.
PA RT O N E : A B O U T R E M OT E C O N T RO L Here is an example of the selection of a line to go into the clipboard: The statement at the bottom of the screen is the one that will be placed in the clipboard when the icon is clicked. The column labeled F contains Flags and Status values. For example, R means read and W means write. HorScale is equivalent to the older-style command TDIV. The Range/Help column provides short form information about the possible values that the variable can take.
CHAPTER SIX: LINKING WITH AUTOMATION Typical variable types are as follows: Single Single precision floating point number Double Double precision floating point number Integer Integer Long Long integer Enum Member of list String String In the case of enum variables, you may specify the value using the actual values (for example, “INT” or “EXT”) for Reference source in the example already given.
PA RT O N E : A B O U T R E M OT E C O N T RO L You will see that some lines in XStreamBrowser are classified as “Action” rather than as a variable type. These actions are performed simply by sending the Action name with no argument, for example: app.InternalCollection("Display").ClearSweeps This would clear all the data from a persistence trace, for example. You can often reduce the amount of typing by the following kind of statements: Set Acquisition = WaveMaster.Acquisition Set Horizontal = Acquisition.
CHAPTER SIX: LINKING WITH AUTOMATION The statement in your script or program would be as follows – VBS 'app.InternalCollection("Display").ClearSweeps' Other examples of actions are as follows: app.Display.FactoryDefault app.Acquisition.Horizontal.ZeroDelay app.Acquisition.Trigger.ZeroLevel app.Measure.SetGateToDefault app.Memory.
PA RT O N E : A B O U T R E M OT E C O N T RO L BLANK PAGE 78 ISSUED: February 2005 WM-RCM-E Rev D
PART TWO COMMANDS Part Two describes the commands and queries you will need to operate your instrument remotely. Important Note for users of other LeCroy instruments with existing remote control software. Trace labels TA, TB, TC and TD have been replaced by traces F1, F2, F3 and F4, respectively. Existing software that includes the old trace labels will work with X-Stream scopes, but new software should use the new labels unless it will also be used on an earlier instrument.
PART TWO: COMMANDS In this part of the manual, you will find the commands and queries to run the instrument remotely.
P A R T T W O : C O M M A N D S Use Commands and Queries This part of the manual describes the remote control commands and queries recognized by the instrument. All of them can be executed in either local or remote state. The commands and queries are listed in alphabetical order according to the long form of their name. For example, the description of ATTENUATION, whose short form is ATTN, is listed before that of AUTO SETUP, whose short form is ASET.
PA RT T WO : C O M M A N D S Example: consider the syntax notation for the command to set the vertical input sensitivity: 1. 2. 3. : VOLT_DIV : = {C1, C2} : = 5.0 mV to 2.5 V The first line shows the formal appearance of the command: denotes the placeholder for the header path; is the placeholder for the vertical gain value. The second line indicates that either C1 or C2 must be chosen for the header path.
Remote Control Commands and Queries Table of Commands and Queries — By Short Form SHORT FORM ALST? LONG FORM ALL_STATUS? SUBSYSTEM (CATEGORY) WHAT THE COMMAND OR QUERY DOES STATUS Reads and clears the contents of all status registers. Changes acquisition state from “stopped” to “single.” ARM ARM_ACQUISITION ACQUISITION ASET AUTO_SETUP ACQUISITION Adjusts vertical, timebase and trigger parameters. ATTN ATTENUATION ACQUISITION Selects the vertical attenuation factor of the probe.
PA RT T WO : C O M M A N D S SHORT FORM LONG FORM SUBSYSTEM (CATEGORY) WHAT THE COMMAND OR QUERY DOES DTJN DOT_JOIN DISPLAY MAIL EMAIL MISCELLANEOUS Sets up email protocol and addresses. STATUS Sets the Standard Event Status Enable register (ESE). *ESE *ESE Controls the interpolation lines between data points. *ESR? *ESR? STATUS Reads, clears the Event Status Register (ESR). EXR? EXR? STATUS Reads, clears the EXecution error Register (EXR).
Remote Control Commands and Queries SHORT FORM LONG FORM SUBSYSTEM (CATEGORY) WHAT THE COMMAND OR QUERY DOES PACL PARAMETER_CLR CURSOR Clears all current parameters in Custom, Pass/Fail. PACU PARAMETER_CUSTOM CURSOR Controls parameters with customizable qualifiers. PADL PARAMETER_DELETE CURSOR Deletes a specified parameter in Custom, Pass/Fail. PAST? PARAMETER_STATISTICS? CURSOR Returns parameter statistics results. Returns current parameter, mask test values.
PA RT T WO : C O M M A N D S SHORT FORM LONG FORM SUBSYSTEM (CATEGORY) WHAT THE COMMAND OR QUERY DOES TRIG_LEVEL ACQUISITION Adjusts the trigger level of the specified trigger source. TRMD TRIG_MODE ACQUISITION Specifies the trigger mode. TRPA TRIG_PATTERN ACQUISITION Defines a trigger pattern. TRSE TRIG_SELECT ACQUISITION Selects the condition that will trigger acquisition. TRSL TRIG_SLOPE ACQUISITION Sets the trigger slope of the specified trigger source.
Remote Control Commands and Queries Table of Commands and Queries — By Subsystem SHORT FORM LONG FORM WHAT THE COMMAND OR QUERY DOES ACQUISITION — TO CONTROL WAVEFORM CAPTURE ARM ARM_ACQUISITION Changes acquisition state from “stopped” to “single.” ASET AUTO_SETUP Adjusts vertical, timebase and trigger parameters for signal display. ATTN ATTENUATION Selects the vertical attenuation factor of the probe. BWL BANDWIDTH_LIMIT Enables or disables the bandwidth-limiting low-pass filter.
PA RT T WO : C O M M A N D S SHORT FORM LONG FORM WHAT THE COMMAND OR QUERY DOES CURSOR — TO PERFORM MEASUREMENTS CRMS CURSOR_MEASURE Specifies the type of cursor or parameter measurement for display. CRST CURSOR_SET Allows positioning of any cursor. CRVA? CURSOR_VALUE? Returns the values measured by the specified cursors for a given trace. CRS CURSORS Sets the cursor type. OFCT OFFSET_CONSTANT Sets offset to be constant in divisions or volts. PARM PARAMETER Controls the parameter mode.
Remote Control Commands and Queries SHORT FORM LONG FORM WHAT THE COMMAND OR QUERY DOES MTPC? MT_PF_COUNTERS? Returns pass/fail result. MTST MT_SELECT_TEST Selects Electrical Telecomm testing standard. MTSY? MT_SYMBOL? Returns 1 or 0 symbol, or pos or neg. MTTS MT_TEST_STATE Controls testing status: RUN, STOP, PAUSE, CONTINUE. MTVA MT_VERTICAL_ALIGN Performs offset alignment for STM-1E, STS-3E, and 139M.
PA RT T WO : C O M M A N D S SHORT FORM LONG FORM WHAT THE COMMAND OR QUERY DOES *ESR? *ESR? Reads and clears the Event Status Register (ESR). EXR? EXR? Reads and clears the EXecution error Register (EXR). INE INE Sets the INternal state change Enable register (INE). INR? INR? Reads and clears the INternal state change Register (INR). IST? IST? Individual STatus reads the current state of IEEE 488. *OPC *OPC Sets to true the OPC bit (0) in the Event Status Register (ESR).
Remote Control Commands and Queries STATUS DESCRIPTION ALL_STATUS?, ALST? Query The ALL_STATUS? query reads and clears the contents of all status registers: STB, ESR, INR, DDR, CMR, EXR and URR except for the MAV bit (bit 6) of the STB register. For an interpretation of the contents of each register, refer to the appropriate status register. The query is useful to obtain a complete overview of the state of your oscilloscope.
PA RT T WO : C O M M A N D S ACQUISITION ARM_ACQUISITION, ARM Command DESCRIPTION The ARM_ACQUISITION command arms the scope and forces a single acquisition if it is already armed.
Remote Control Commands and Queries ACQUISITION DESCRIPTION ATTENUATION, ATTN Command/Query The ATTENUATION command selects the vertical attenuation factor of the probe. Values up to 10000 can be specified. The ATTENUATION? query returns the attenuation factor of the specified channel.
PA RT T WO : C O M M A N D S MISCELLANEOUS AUTO_CALIBRATE, ACAL Command/Query DESCRIPTION The AUTO_CALIBRATE command is used to enable or disable the automatic calibration of your X-Stream oscilloscope. At powerup, auto-calibration is turned ON, i.e. all input channels are periodically calibrated for the current input amplifier and timebase settings, whether the instrument has been adjusted or not. Whenever you adjust a gain or offset, however, the instrument will perform a calibration.
Remote Control Commands and Queries ACQUISITION DESCRIPTION AUTO_SETUP, ASET Command The AUTO_SETUP command attempts to display the input signal(s) by adjusting the vertical, timebase and trigger parameters. AUTO_SETUP operates only on the channels whose traces are currently turned on. If no traces are turned on, AUTO_SETUP operates on all channels. If signals are detected on several channels, the lowest numbered channel with a signal determines the selection of the timebase and trigger source.
PA RT T WO : C O M M A N D S ACQUISITION BANDWIDTH_LIMIT, BWL Command/Query DESCRIPTION BANDWIDTH_LIMIT enables or disables the bandwidth-limiting lowpass filter. The command is used to set the bandwidth individually for each channel. The response to the BANDWIDTH_LIMIT? query indicates whether the bandwidth filters are on or off.
Remote Control Commands and Queries MISCELLANEOUS BUZZER, BUZZ Command DESCRIPTION The buzzer command controls the built-in buzzer. By means of the BEEP argument, the buzzer can be activated for short beeps. The value ON has the same effect as BEEP, unlike the behavior with earlier instruments. ON and OFF are accepted only for compatibility. OFF has no effect.
PA RT T WO : C O M M A N D S MISCELLANEOUS *CAL? Query DESCRIPTION The *CAL? query causes the oscilloscope to perform an internal self-calibration and generates a response that indicates whether or not your oscilloscope completed the calibration without error. This internal calibration sequence is the same as that which occurs at power-up.
Remote Control Commands and Queries MISCELLANEOUS CAL_OUTPUT, COUT Command/Query DESCRIPTION The CAL_OUTPUT command is used to set the type of signal put out through the instrument front panel’s CAL BNC connector. COMMAND SYNTAX Cal_OUTput [,[,]] Cal_OUTput PULSE[,] : = {OFF, CALSQ, PF, TRIG, LEVEL, ENABLED} : = 5 mV to 1.00 V into 1 MΩ : = 5 Hz to 5 MHz.
PA RT T WO : C O M M A N D S ADDITIONAL INFORMATION NOTATION 100 CALSQ Provides a square signal LEVEL Provides a DC signal at the requested level OFF Provides no signal (ground level) PF Pass/Fail mode PULSE Provides a single pulse TRIG Trigger Out mode ISSUED: February 2005 WM-RCM-E Rev D
Remote Control Commands and Queries FUNCTION CLEAR_MEMORY, CLM Command DESCRIPTION The CLEAR_MEMORY command clears the specified memory. Data previously stored in this memory are erased and memory space is returned to the free memory pool. COMMAND SYNTAX CLear_Memory < memory> : = {M1, M2, M3, M4} EXAMPLE (GPIB) The following instruction clears the memory M2.
PA RT T WO : C O M M A N D S FUNCTION CLEAR_SWEEPS, CLSW Command DESCRIPTION The CLEAR_SWEEPS command restarts the cumulative processing functions: summed or continuous average, extrema, FFT power average, histogram, pulse parameter statistics, Pass/Fail counters, and persistence.
Remote Control Commands and Queries STATUS *CLS Command DESCRIPTION The *CLS command clears all status data registers.
PA RT T WO : C O M M A N D S STATUS CMR? Query DESCRIPTION The CMR? query reads and clears the contents of the CoMmand error Register (see table next page) which specifies the last syntax error type detected by your oscilloscope.
Remote Control Commands and Queries ADDITIONAL INFORMATION COMMAND ERROR STATUS REGISTER STRUCTURE (CMR) Value WM-RCM-E Rev D Description 1 Unrecognized command/query header 2 Illegal header path 3 Illegal number 4 Illegal number suffix 5 Unrecognized keyword 6 String error 7 GET embedded in another message 10 Arbitrary data block expected 11 Non-digit character in byte count field of arbitrary data block 12 EOI detected during definite length data block transfer 13 Extra bytes dete
PA RT T WO : C O M M A N D S ACQUISITION COMBINE_CHANNELS, COMB Command/Query DESCRIPTION The COMBINE_CHANNELS command controls the channel interleaving function of the acquisition system. The COMBINE_CHANNELS? query returns the channel interleaving function’s current status. COMMAND SYNTAX COMBine_channels : = {1, 2, AUTO} Selecting 1 means no combining of channels will take place; i.e., in the Timebase (Horizontal) dialog, 4 channels will be shown as the selection.
Remote Control Commands and Queries COMMUNICATION DESCRIPTION COMM_FORMAT, CFMT Command/Query The COMM_FORMAT command selects the format the oscilloscope uses to send waveform data. The available options allow the block format, the data type and the encoding mode to be modified from the default settings. The COMM_FORMAT? query returns the currently selected waveform data format.
PA RT T WO : C O M M A N D S ADDITIONAL INFORMATION Block Format DEF9: Uses the IEEE 488.2 definite length arbitrary block response data format. The digit 9 indicates that the byte count consists of 9 digits. The data block directly follows the byte count field. For example, a data block consisting of three data bytes would be sent as: WF DAT1,#9000000003 where represents an eight-bit binary data byte. A (new line with EOI) signifies that block transmission has ended.
Remote Control Commands and Queries COMMUNICATION DESCRIPTION COMM_HEADER, CHDR Command/Query The COMM_HEADER command controls the way the oscilloscope formats responses to queries. There are three response formats: LONG, in which responses start with the long form of the header word; SHORT, where responses start with the short form of the header word; and OFF, for which headers are omitted from the response and units in numbers are suppressed.
PA RT T WO : C O M M A N D S COMMUNICATION DESCRIPTION COMMAND SYNTAX COMM_HELP, CHLP Command/Query The COMM_HELP command controls the level of operation of the diagnostics utility Remote Control Assistant, which assists in debugging remote control programs. Selected using your instrument's Utilities menu, Remote Control Assistant can log all message transactions occurring between the external controller and the oscilloscope (full dialog), or errors only.
Remote Control Commands and Queries COMMUNICATION COMM_HELP_LOG?, CHL? Query DESCRIPTION The COMM_HELP_LOG query returns the current contents of the log generated by the Remote Control Assistant (see CHLP description). If the optional parameter CLR is specified, the log will be cleared after the transmission. Otherwise, it will be kept.
PA RT T WO : C O M M A N D S COMMUNICATION DESCRIPTION COMM_ORDER, CORD Command/Query The COMM_ORDER command controls the byte order of waveform data transfers. Waveform data can be sent with the most significant byte (MSB) or the least significant byte (LSB) in the first position. The default mode is to send the MSB first. COMM_ORDER applies equally to the waveform’s descriptor and time blocks.
Remote Control Commands and Queries ACQUISITION DESCRIPTION COUPLING, CPL Command/Query The COUPLING command selects the coupling mode of the specified input channel. The COUPLING? query returns the coupling mode of the specified channel.
PA RT T WO : C O M M A N D S CURSOR CURSOR_MEASURE, CRMS Command/Query DESCRIPTION The CURSOR_MEASURE command specifies the type of cursor or parameter measurement to be displayed, and is the main command for displaying parameters and Pass/Fail. The modes PARAM, SHOW DASH, and LIST used in some earlier LeCroy instruments are not available in X-Stream instruments. The CURSOR_MEASURE? query indicates which cursors or parameter measurements are currently displayed.
Remote Control Commands and Queries NOTE: The keyword STAT is optional with modes CUST, HPAR, and VPAR. If present, STAT turns parameter statistics on. Absence of STAT turns parameter statistics off. The submodes ABS, DELTA, SLOPE are optional with mode HREL. If it is present, ABS chooses absolute amplitude reading of relative cursors. Absence of keyword selects relative, DELTA, amplitude reading of relative cursors.
PA RT T WO : C O M M A N D S To turn on a cursor display, use one of these five forms: CURSOR_MEASURE HABS CURSOR_MEASURE HREL CURSOR_MEASURE VABS CURSOR_MEASURE VREL CURSOR_MEASURE FAIL 116 ISSUED: February 2005 WM-RCM-E Rev D
Remote Control Commands and Queries CURSOR DESCRIPTION CURSOR_SET, CRST Command/Query The CURSOR_SET command allows you to position any one of the independent cursors at a given grid location. When you are setting a cursor position, you must specify a trace, relative to which the cursor will be positioned. This means that the trace must be turned on, a requirement that does not apply to all earlier LeCroy instruments.
PA RT T WO : C O M M A N D S NOTE: Parameters are grouped in pairs. The first parameter specifies the cursor to be modified and the second one indicates its new value. Parameters can be grouped in any order and restricted to those items to be changed. The unit DIV is optional. QUERY SYNTAX : CuRsor_SeT? – only if the cursors are visible. No implies ALL, even though all are not visible.
Remote Control Commands and Queries CURSOR DESCRIPTION CURSOR_VALUE?, CRVA? Query The CURSOR_VALUE? query returns the values measured by the specified cursors for a given trace. (The PARAMETER_VALUE? query is used to obtain measured waveform parameter values.) There are important differences in the function of this command between X-Stream instruments and earlier LeCroy instruments. The keyword ALL should NOT be used, neither should multiple keywords. If they are used, the word UNDEF will be returned.
PA RT T WO : C O M M A N D S AVAILABILITY : = {C3, C4} available only on four-channel oscilloscopes. EXAMPLE (GPIB) The following query reads the measured absolute horizontal value of the cross-hair cursor (HABS) on Channel 2: CMD$=“C2:CRVA? HABS”: CALL IBWRT(SCOPE%,CMD$): CALL IBRD(SCOPE%,RSP$): PRINT RSP$ Response message: C2:CRVA HABS,34.
Remote Control Commands and Queries CURSORS CURSORS, CRS Command/Query DESCRIPTION Sets the type of cursor to be used and the readout. Unlike CRMS, this will not change the state of parameters or pass/fail.
PA RT T WO : C O M M A N D S ET-PMT CUSTOM_APPLICATION, CUAP Command/Query DESCRIPTION The CUSTOM_APPLICATION command toggles from Mask Tester mode to standard oscilloscope mode. COMMAND SYNTAX CUAP := [OFF, MASK_TESTER] For compatibility with older scopes, either argument is acceptable.
Remote Control Commands and Queries ET-PMT CUSTOM_OPTIONS?, CU_OPT? Query DESCRIPTION The CU_OPT? query identifies options currently enabled due to the presence of a PP100. These options can also be enabled by the normal ‘option key’ mechanism. If so, they are reported by the *OPT? query instead of CU_OPT?. The response to CU_OPT? consists of a series of response fields listing all the options enabled due to the presence of a PP100.
PA RT T WO : C O M M A N D S DATE DATE Command/Query DESCRIPTION Sets the date and time of the real-time clock in the instrument. Note that you do not need to specify any parameters after the one you want to change, but you MUST include all those before it. COMMAND SYNTAX A DATE [,][,][,][,][ ,] COMMAND SYNTAX B DATE SNTP (to set the date and the time from the internet.
Remote Control Commands and Queries STATUS DDR? Query DESCRIPTION BIT The DDR? query reads and clears the contents of the Device Dependent or device specific error Register (DDR). In the case of a hardware failure, the DDR register specifies the origin of the failure. The following table gives details. BIT VALUE 15...
PA RT T WO : C O M M A N D S FUNCTION DEFINE, DEF Command/Query DESCRIPTION The DEFINE command specifies the mathematical expression to be evaluated by a function. This command is used to control all math tools and zoom in the standard oscilloscope as well as those in the optional math software packages. See the O p e r a t o r’ s Ma n ua l for details. COMMAND SYNTAX : DEFine EQN,‘’ [,,,...] NOTE: Function parameters are grouped in pairs.
Remote Control Commands and Queries SWEEPS Maximum number of sweeps UNITS Physical units VERT Vertical scaling type WEIGHT Continuous Average weight WIDTH Width of histogram display WINDOW FFT window function FUNCTION EQUATIONS AND NAMES NOTES: These functions are available according to the options installed in your X-Stream oscilloscope.
PA RT T WO : C O M M A N D S ERES(
Remote Control Commands and Queries IFFT() Inverse FFT, real output from complex input - INVERT Inversion (negation) of waveform. INTG(),,,, INTRP(),, Interpolate extra points in waveform. INTERPOLATETYPE IS LINEAR, QUADRATIC, OR SINXX.
PA RT T WO : C O M M A N D S SPACK() Magnitude of complex result SPARSE(),, Produces as waveform with fewer points than the input.
Remote Control Commands and Queries VALUES FOR RESCALE FUNCTION: : = 0.0 to 1e15 : = 0.0 to 1e15 : = {UNCHANGED, A, CEL, C, HZ, K, N, OHM, PAL, V, W, DB, DEG, PCT, RAD, S} RESCALE PHYSICAL UNITS VALUE NOTATION UNCHANGED The unit remains unchanged.
PA RT T WO : C O M M A N D S The following instruction defines Trace f1 to compute the Power Spectrum of the FFT of Channel 1. The window function is Rectangular. CMD$=“F1:DEF EQN,‘PS(FFT(C1))’,WINDOW, RECT”: CALL IBWRT(SCOPE%,CMD$) The following instruction defines Trace F2 to compute the Power Average of the Power Spectrum of Channel 1, over a maximum of 244 sweeps.
Remote Control Commands and Queries F1:DEF EQN,"ERES(C1)",BITS,0.5 F1:DEF EQN,"EXCEL(C1,C2)",SOURCE1CELL,A2,SOURCE2CELL,B2,OUTPUTCELL,C2, SOURCE1HEADERCELL,F2,SOURCE2HEADERCELL,G2,OUTPUTHEADERCELL,H2, WITHHEADER,ON,OUTPUTENABLE,ON,SOURCE1ENABLE,ON,SOURCE2ENABLE,OFF, NEWSHEET,ON,ADVANCED,OFF,SCALING,AUTOMATIC, SPREADSHEETFILENAME,D:\TEST34.
PA RT T WO : C O M M A N D S F1:DEF EQN,"MCAD(C1, C2)",SOURCE1VAR,S1,SOURCE2VAR,S2,OUTPUTVAR,S1, SOURCE1HEADERVAR,S1HDR,SOURCE2HEADERVAR,S2HDR,OUTPUTHEADERVAR,O1HDR, WITHHEADER,ON,OUTPUTENABLE,ON,SOURCE1ENABLE,ON,SOURCE2ENABLE,OFF, NEWSHEET,ON,ADVANCED,OFF,SCALING,AUTOMATIC, WORKSHEETFILENAME,C:\MATHCAD89.MCD F1:DEF EQN,"MATLAB(C1,C2)",MATLABCODE,WFORMOUT = -0.
Remote Control Commands and Queries MISCELLANEOUS DELETE_FILE, DELF Command DESCRIPTION The DELETE_FILE command deletes a file from the currently selected directory. COMMAND SYNTAX DELF,DISK,,FILE,’’ := {FLOPPY, HDD} EXAMPLE (GPIB) The following instruction deletes a front panel setup from the floppy disk: CMD$=”DELF,DISK,FLOPPY,FILE,’TESTRUN.
PA RT T WO : C O M M A N D S MASS STORAGE DESCRIPTION DIRECTORY, DIR Command/Query The DIRECTORY command is used to create or delete file directories on mass storage devices. It also allows selection of the current working directory and listing of files in the directory. The query response consists of a double-quoted string containing a DOS-like listing of the directory. If no mass storage device is present, or if it is not formatted, the string will be empty.
Remote Control Commands and Queries DISPLAY DESCRIPTION DISPLAY, DISP Command/Query The DISPLAY command controls the display screen of the oscilloscope. When remotely controlling the oscilloscope, and if you do not need to use the display, it can be useful to switch off the display via the DISPLAY OFF command. This improves oscilloscope response time, since the waveform graphic generation procedure is suppressed.
PA RT T WO : C O M M A N D S DISPLAY DOT_JOIN, DTJN Command/Query DESCRIPTION The DOT_JOIN command controls the interpolation lines between data points. Setting DOT_JOIN ON selects Points in the “Display” dialog; OFF selects Line.
Remote Control Commands and Queries DISPLAY EMAIL, MAIL Command/Query DESCRIPTION The EMAIL command sets up the e-mail configuration in the “Preferences” dialog. COMMAND SYNTAX EMAIL MODE,,TO,’’, FROM,’’,SERVER,’’ :={SMTP, MAPI} := valid recipient address, e.g., “myName@myProvider.com” :=valid originator address, e.g., “myXStreamDSO@LeCroy.com” :=valid SMTP server address, e.g., “domino.lecroy.
PA RT T WO : C O M M A N D S STATUS DESCRIPTION *ESE Command/Query The *ESE command sets the Standard Event Status Enable register (ESE). This command allows one or more events in the ESR register to be reflected in the ESB summary message bit (bit 5) of the STB register. For an overview of the ESB defined events, refer to the ESR table on page 142. The *ESE? query reads the contents of the ESE register.
Remote Control Commands and Queries STATUS *ESR? Query DESCRIPTION The *ESR? query reads and clears the contents of the Event Status Register (ESR). The response represents the sum of the binary values of the register bits 0 to 7. The table below gives an overview of the ESR register structure.
PA RT T WO : C O M M A N D S ADDITIONAL INFORMATION STANDARD EVENT STATUS REGISTER (ESR) Bit Bit Value Bit Name 15...8 Description 0 Reserved by IEEE 488.2 See Note ... 7 128 PON 1 Power off-to-ON transition has occurred 1. 6 64 URQ 1 not used 2. 5 32 CME 1 CoMmand parser Error has been detected 3. 4 16 EXE 1 EXecution Error detected 4. 3 8 DDE 1 Device Dependent (specific) Error occurred 5. 2 4 QYE 1 QuerY Error occurred 6.
Remote Control Commands and Queries 6. The QuerY Error bit (QYE) is set true (1) whenever (a) an attempt is made to read data from the Output Queue when no output is either present or pending, (b) data in the Output Queue has been lost, (c) both output and input buffers are full (deadlock state), (d) an attempt is made by the controller to read before having sent an , (e) a command is received before the response to the previous query was read (output buffer flushed). 7.
PA RT T WO : C O M M A N D S STATUS EXR? Query DESCRIPTION The EXR? query reads and clears the contents of the EXecution error Register (EXR). The EXR register specifies the type of the last error detected during execution. Refer to the table next page.
Remote Control Commands and Queries ADDITIONAL INFORMATION EXECUTION ERROR STATUS REGISTER STRUCTURE (EXR) Value 21 22 23 24 25 26 27 30 31 32 33 34 35 36 50 51 53 54 55 56 57 58 59 61 62 Description Permission error. The command cannot be executed in local mode. Environment error. The oscilloscope is not configured to correctly process a command. For instance, the oscilloscope cannot be set to RIS at a slow timebase. Option error. The command applies to an option which has not been installed.
PA RT T WO : C O M M A N D S FUNCTION DESCRIPTION COMMAND SYNTAX FIND_CTR_RANGE, FCR Command The FIND_CTR_RANGE command automatically sets the center and width of a histogram to best display the accumulated events. :Find_Ctr_Range :={TA,TB,TC,TD,F1,F2,F3,F4} AVAILABILITY Only available with an option installed that includes Histograms.
Remote Control Commands and Queries ACQUISITION FORCE_TRIGGER, FRTR Command DESCRIPTION Causes the instrument to make one acquisition.
PA RT T WO : C O M M A N D S MASS STORAGE FORMAT_FLOPPY, FFLP Command/Query DESCRIPTION The FORMAT_FLOPPY command formats a floppy disk in the Double Density or High Density format. COMMAND SYNTAX Format_FLoPpy [] : = {DD,HD,QUICK} If no argument is supplied, HD is used by default.
Remote Control Commands and Queries FUNCTION FUNCTION_RESET, FRST Command DESCRIPTION The FUNCTION_RESET command resets a waveform processing function. The number of sweeps will be reset to zero and the process restarted. COMMAND SYNTAX : Function_ReSeT EXAMPLE (GPIB) : = {F1, F2, F3, F4, F5, F6, F7, F8, TA, TB, TC, TD} TA through TD are included for backward compatibility with software designed for earlier LeCroy instruments. They are not used in responses to queries.
PA RT T WO : C O M M A N D S DISPLAY DESCRIPTION GRID Command/Query The GRID command defines the style of the grid used in the display. The GRID? query returns the grid style currently in use.
Remote Control Commands and Queries HARD COPY HARDCOPY_SETUP, HCSU Command/Query DESCRIPTION The HARDCOPY_SETUP command configures the instrument’s hard copy driver. It enables you to specify the device type and transmission mode of the hard copy unit connected to the instrument. This can be clipboard or disk drive as well as a printer. One or more individual settings can be changed by specifying the appropriate keywords, together with the new values.
PA RT T WO : C O M M A N D S QUERY SYNTAX HCSU? RESPONSE FORMAT (If preceded, for example, by hcsu dest,file; with CHDR OFF): DEV,PNG,FORMAT,PORTRAIT,BCKG,BLACK,DEST,REMOTE, DIR,“C:\LECROY\XSTREAM\HARDCOPY”, FILE,”IRHCP1.
Remote Control Commands and Queries DISPLAY DESCRIPTION HOR_MAGNIFY, HMAG Command/Query The HOR_MAGNIFY command horizontally expands the selected expansion trace by a specified factor. Magnification factors not within the range of permissible values will be rounded off to the nearest legal value. The VAB bit (bit 2) in the STB register (see table on page 225) is set when a factor outside the legal range is specified.
PA RT T WO : C O M M A N D S DISPLAY DESCRIPTION HOR_POSITION, HPOS Command/Query The HOR_POSITION command horizontally positions the geometric center of the intensified zone on the source trace. Allowed positions range from division 0 through 10. If the source trace was acquired in sequence mode, horizontal shifting will only apply to a single segment at a time.
Remote Control Commands and Queries NOTE: The segment number is only relevant for waveforms acquired in sequence mode; it is ignored in single waveform acquisitions. When the segment number is set to 0, all segments will be shown. The unit DIV is optional. QUERY SYNTAX : Hor_POSition? RESPONSE FORMAT : Hor_POSition [,] NOTE: The segment number is only given for sequence waveforms.
PA RT T WO : C O M M A N D S MISCELLANEOUS *IDN? Query DESCRIPTION The *IDN? query causes the instrument to identify itself. The response comprises manufacturer, scope model, serial number, and firmware revision level.
Remote Control Commands and Queries STATUS DESCRIPTION INE Command/Query The INE command sets the INternal state change Enable register (INE). This command allows one or more events in the INR register to be reflected in the INB summary message bit (bit 0) of the STB register. For an overview of the INR defined events, refer to the table on the next page. The INE? query reads the contents of the INE register.
PA RT T WO : C O M M A N D S STATUS INR? Query DESCRIPTION The INR? query reads and clears the contents of the INternal state change Register (INR). The INR register (table below) records the completion of various internal operations and state transitions. INTERNAL STATE REGISTER STRUCTURE (INR) Bit Bit Value 15 Description 0 Reserved for future use. 14 16384 1 Probe was changed. 13 8192 1 Trigger is ready. 12 4096 1 Pass/Fail test detected desired outcome.
Remote Control Commands and Queries QUERY SYNTAX INR? RESPONSE FORMAT INR : = 0 to 65535 EXAMPLE (GPIB) The following instruction reads the contents of the INR register: CMD$=“INR?”: CALL IBWRT(SCOPE%,CMD$) Response message: INR 1026 i.e., waveform processing in Function C and a screen dump have both terminated.
PA RT T WO : C O M M A N D S WAVEFORM TRANSFER DESCRIPTION INSPECT?, INSP? Query The INSPECT? query allows you to read parts of an acquired waveform in intelligible form. The command is based on the explanation of the format of a waveform given by the template (use the TEMPLATE? query to obtain an up-to-date copy). Any logical block of a waveform can be inspected using this query by giving its name enclosed in quotes as the first (string) parameter (see the template itself).
Remote Control Commands and Queries NOTE: Block WAVEDESC contains several variables related to scaling of data values. Values of these variables depend on the current setting of the command COMM_FORMAT (CFMT). The following example shows how these values change when you modify the CFMT setting from BYTE (default) to WORD: CFMT? CFMT DEF9,BYTE,BIN C1:INSP? WAVEDESC C1:INSP " ... COMM_TYPE : byte ... VERTICAL_GAIN : 3.1250e-003 VERTICAL_OFFSET : -2.0600e-001 MAX_VALUE : 1.2700e+002 MIN_VALUE : -1.2800e+002 ..
PA RT T WO : C O M M A N D S RESPONSE FORMAT : INSPect ““ : = A string giving name(s) and value(s) of a logical block or a variable. AVAILABILITY : = {C3, C4} only on four-channel oscilloscopes.
Remote Control Commands and Queries DISPLAY INTENSITY, INTS Command/Query DESCRIPTION The INTenSity command sets the intensity level of the grid. The command TRACE,n is accepted for backward compatibility, but the actual trace intensity is always 100%. COMMAND SYNTAX INTenSity GRID,,TRACE,[PCT] := 0 to 100 (in percent). GRID and TRACE may be interchanged; the order is immaterial.
PA RT T WO : C O M M A N D S ACQUISITION DESCRIPTION INTERLEAVED, ILVD Command/Query The INTERLEAVED command enables or disables random interleaved sampling (RIS) for timebase settings where both single shot and RIS mode are available. RIS is not available for sequence mode acquisitions. If sequence mode is on, ILVD ON turns it off. The response to the INTERLEAVED? query indicates whether the oscilloscope is in RIS mode.
Remote Control Commands and Queries STATUS *IST? Query DESCRIPTION The *IST? (Individual STatus) query reads the current state of the IEEE 488.1-defined “ist” local message. The “ist” individual status message is the status bit sent during a parallel poll operation.
PA RT T WO : C O M M A N D S ACQUISITION DESCRIPTION MEMORY_SIZE, MSIZ Command/Query On most models where this command/query is available, MEMORY_SIZE allows selection of the maximum memory length used for acquisition. See the specifications in the Operator’s Manual. TIP: Reduce the number of data points for faster throughput. The MEMORY_SIZE? query returns the current maximum memory length used to capture waveforms.
Remote Control Commands and Queries MESSAGE, MSG DISPLAY Command/Query DESCRIPTION The MESSAGE command displays a string of characters in the message field at the bottom of the instrument screen. COMMAND SYNTAX MeSsaGe ‘’ or MSG “” := a string of up to 49 characters. Longer strings will be truncated to 49 characters, but the original string will be retained and returned by the MSG? Query.
PA RT T WO : C O M M A N D S MT_ATTENUATION, MTAT ET-PMT DESCRIPTION Command/Query Controls cable attenuation factor for 2M_TP, 2M_COAX, 8M, 34M, 139M, 156M. MT_ATTENUATION COMMAND SYNTAX := 0.5 to 1 QUERY SYNTAX MTAT? RESPONSE FORMAT MT’AT = 0.
Remote Control Commands and Queries MT_FAIL_ACTION, MTFA ET-PMT Command/Query DESCRIPTION This command sets the actions that will occur whenever a waveform does not meet the pass criteria. The query form of this command returns the current actions.
PA RT T WO : C O M M A N D S MT_OFFSET, MTOF ET-PMT Command/Query DESCRIPTION Returns the offset value for STM-1E, STS-3E and 139M.
Remote Control Commands and Queries MT_OPC?, MTOP? ET-PMT Query DESCRIPTION This query returns the state of the last operation. Its functionality is similar to *OPC? (operation complete).
PA RT T WO : C O M M A N D S MT_PF_COUNTERS?, MTPC? ET-PMT Query DESCRIPTION This query returns the number of passed waveforms, the percent passed, and the total number tested. QUERY SYNTAX MTPC? RESPONSE FORMAT MT_PF_COUNTERS PASS,266,OF,286,FAIL_RATE,6.
Remote Control Commands and Queries MT_SELECT_TEST, MTST ET-PMT Command/Query DESCRIPTION The MT_SELECT_TEST command selects the signal/test type, and performs “AUTOALIGN” or “HORIZONTAL ALIGN” actions automatically on the signal. COMMAND SYNTAX MTST ,, .
PA RT T WO : C O M M A N D S MT_SYMBOL?, MTSY? ET-PMT Query DESCRIPTION For STM-1E, STS-3E and 139 M selects the “1” or “0” symbol. For DS1, DS3 and STS1 selects the “POS” or “NEG” pulse.
Remote Control Commands and Queries MT_TEST_STATE, MTTS ET-PMT Command/Query DESCRIPTION Controls the test execution: RUN/STOP or PAUSE/CONTINUE.
PA RT T WO : C O M M A N D S MT_VERTICAL_ALIGN, MTVA ET-PMT Command DESCRIPTION Performs offset alignment for STM-1E, STS-3E and 139M.
Remote Control Commands and Queries ACQUISITION DESCRIPTION OFFSET, OFST Command/Query The OFFSET command allows adjustment of the vertical offset of the specified input channel. The maximum ranges depend on the fixed sensitivity setting. See the Operator’s Manual for specifications. If an out-of-range value is entered, the oscilloscope is set to the closest possible value and the VAB bit (bit 2) in the STB register is set.
PA RT T WO : C O M M A N D S CURSOR DESCRIPTION OFFSET_CONSTANT, OFCT Command/Query As you change the gain, this command allows you to either keep the vertical offset level indicator stationary (when Div is selected) or to have it move with the actual voltage level (when Volts is selected). The advantage of selecting Div is that the waveform will remain on the grid as you increase the gain; whereas, if Volts is selected, the waveform could move off the grid.
Remote Control Commands and Queries STATUS DESCRIPTION *OPC Command/Query The *OPC (OPeration Complete) command sets to true the OPC bit (bit 0) in the standard Event Status Register (ESR). The *OPC? query always responds with the ASCII character 1 because the oscilloscope only responds to the query when the previous command has been entirely executed.
PA RT T WO : C O M M A N D S MISCELLANEOUS *OPT? Query DESCRIPTION The *OPT? query identifies oscilloscope options: installed software or hardware that is additional to the standard instrument configuration. The response consists of a series of response fields listing all the installed options. QUERY SYNTAX *OPT? RESPONSE FORMAT *OPT ,,.., : = A three- or four-character ASCII string NOTE: If no option is present, the character 0 will be returned.
Remote Control Commands and Queries SAVE/RECALL SETUP DESCRIPTION PANEL_SETUP, PNSU Command/Query The PANEL_SETUP command complements the *SAV or *RST commands. PANEL_SETUP allows you to archive panel setups in encoded form on external storage media. Only setup data read by the PNSU? query can be recalled into the oscilloscope. A panel setup error (see table on page 145) will be generated if the setup data block contains invalid data.
PA RT T WO : C O M M A N D S CURSORS PARAMETER, PARM Command/Query DESCRIPTON This command turns statistics and histicons on or off. COMMAND SYNTAX PARM ,[readout] Type:= CUST, HPAR, VPAR, OFF Readout:= STAT, HISTICON, BOTH, OFF Without argument, state of histograms and statistics is unchanged. Unlike CRMS, PARM does not change the state of cursors or pass/fail.
Remote Control Commands and Queries CURSOR PARAMETER_CLR, PACL Command DESCRIPTION The PARAMETER_CLR command clears all the current parameters from the 8-line list used in the Custom and Pass/Fail modes.
PA RT T WO : C O M M A N D S CURSOR PARAMETER_CUSTOM, PACU Command/Query DESCRIPTION The PARAMETER_CUSTOM command controls the parameters that have customizable qualifiers and can also be used to assign any parameter for histogramming. NOTE: When PAVA? is used to query a Custom parameter, the prefix is returned for consistency. However, the source for the measurement is the one configured using the PACU command. TIP: Use PAVA? to read the measured value of a parameter that was set up with PACU.
Remote Control Commands and Queries DTLEV Delta time at level DUR duration of acquisition DUTY duty cycle DULEV Duty cycle at level ,,,,abslevel >, EDLEV Edges at level ,,,,abslevel >, FALL82 Fall time 80 % to 20 % FALL Fall time 90 % to 10 % FLEV Fall at levels FRST First cursor position FREQ Frequency HOLDLEV Clock to data time LAST Last cursor position MAX Maximum value ME
PA RT T WO : C O M M A N D S RISE Rise time 10% to 90 % RISE28 Rise 20 % to 80 % RLEV Rise time at levels RMS root mean square SETUP Data edge to clock edge SDEV Standard deviation TLEV Time at level TOP Top WID Width WIDLV Width at level XMAX Pos of max data value XMIN Pos if min data value XAPK Nth highest hist peak CUSTn Custom parameter DTLEV FLEV RLEV TLEV 186 ,,,,,,, ,
Remote Control Commands and Queries AVG CROSSPERCENT CUSTOMIZABLE PARAMETERS WITH SDA & SDM OPTION Definition list Histogram mean Differential crossing % DCD DPLEV Delta period at level DTLEV Delta time at levels DWIDLEV Delta width at level EDLEV Edges at level EXTRATIO Eye level ratios EYEAMPL Eye amplitude EYEBER Eye bit error rate estim EYEHEIGHT TBD EYEWIDTH Eye width ,,,,,,,
PA RT T WO : C O M M A N D S HMEDI Histogram median HRMS Histogram rms HTOP Histogram top level HOLDLEV Clock to data edge time LOW Histogram left bin MAXP Histogram highest peak MODE Histogram mode ,,,, ,,,,,,, , ONELEVEL? PKS Histogram no of peaks PCTL Histogram percentile PLEV Period at level ,,
Remote Control Commands and Queries WIDLV Width at level XAPK Histogram Nth peak ZEROLVL? Eye diagram zero level AVG DPLEV DTLEV DWIDLEV EDLEV EXCELPARAM EXCELPARAMAR ITH FLEV ,,,,, Peaknumber CUSTOMIZABLE PARAMETERS WITH XMAP OPTION Definition list Histogram mean Delta period at level ,,,,,,,,,
PA RT T WO : C O M M A N D S HTOP Histogram top HOLDLEV Time clock to data edge ,,,, ,,,,,,, , LOW Histogram left bin MATHCADPARA M Param using Mathcad MATHCADPARA MARITH MATLABPARAM Param arith Mathcad Parameter using MATLAB MAXP Histogram highest peak MODE Histogram mode NBPH Narrow band phase NBP
Remote Control Commands and Queries SKEW Time clock to clock edge ,,,,,,,, ,,,, ,,,,,,,,,, TIELEV Time interval error TOTP Histogram total pop WIDLV Width at level XAPK Histogram
PA RT T WO : C O M M A N D S : = {POS, NEG, ALL} , , : = 1 to 99 if level is specified in percent (PCT), or , , : = Level in in the units of the waveform. : = -100 PCT to 100 PCT : = 10 to 1e9 Hz (Narrow Band center frequency) : = 0.01 to 8 divisions : = 1e-9 to 0.
Remote Control Commands and Queries EXAMPLE 2 DDLY Command Example: PACU 2,DDLY,C1,C2 Query/Response Examples: PACU? 2 returns: PACU 2,DDLY,C1,C2 PAVA? CUST2 returns: C2:PAVA CUST2,123 NS EXAMPLE 3 RLEV Command Example: PACU 3,RLEV,C1,2PCT,67PCT Query/Response Examples: PACU? 3 returns: PACU 3,RLEV,C1,2PCT,67PCT PAVA? CUST3 returns: C1:PAVA CUST3,23 MS EXAMPLE 4 FLEV Command Example: PACU 3,FLEV,C1,345E-3,122E-3 Query/Response Examples: PACU? 3 returns: PACU 3,FLEV,C1,345E-3,122E-3 PAVA? C
PA RT T WO : C O M M A N D S EXAMPLE RESPONSE to PACU? 1 where Parameter 1 is a script – PACU 1,PARAMSCRIPT,C1,VBSCRIPT,FUNCTION UPDATE() TRACELENGTH = INRESULT.SAMPLES INDATA = INRESULT.DATAARRAY YTOTAL = 0 XYTOTAL = 0 FOR K = 0 TO TRACELENGTH - 1 Y = INDATA(K) : YY = Y * Y YTOTAL = YTOTAL + YY XYTOTAL = XYTOTAL + K * YY NEXT OUTRESULT.
Remote Control Commands and Queries CURSOR DESCRIPTION PARAMETER_DELETE, PADL Command The PARAMETER_DELETE command deletes a parameter at a specified column from the list of parameters used in the Custom mode.
PA RT T WO : C O M M A N D S CURSOR PARAMETER_STATISTICS?, PAST? Query DESCRIPTION The PARAMETER_STATISTICS? query returns the current values of statistics for the specified pulse parameter mode and specified statistic for all columns of the parameter display, or all statistics for the specified parameter.
Remote Control Commands and Queries EXAMPLE (GPIB) A The following instruction reads the average values for all the columns individually: CMD$ = “PAST? CUST, AVG” CALL IBWRT (SCOPE%,CMD$) CALL IBRD(SCOPE%,RD$) EXAMPLE (GPIB) B The following instruction reads all the statistical values for parameter P2: CMD$ = “PAST? CUST, P2” CALL IBWRT (SCOPE%,CMD$) CALL IBRD(SCOPE%,RD$) RESPONSE FORMAT A PAST CUST,AVG,290.718E-3 V,389.25E-12 V.S,144.589E-3 V,93.76604E-9 S,290.725E-3 V,389.25E-12 V.S,-144.
PA RT T WO : C O M M A N D S CURSOR PARAMETER_VALUE?, PAVA? Query DESCRIPTION The PARAMETER_VALUE query returns the current values of the pulse waveform parameters and mask tests for the specified trace. Traces do not need to be displayed or selected to obtain the values measured by the pulse parameters or mask tests.
Remote Control Commands and Queries AVAILABLE WITH SDA OPTION AVG Histogram mean HTOP Histogram top level CROSSPERCENT Differential crossing % HOLDLEV Clock to data edge time LOW Histogram left bin DCD DPLEV Delta period at level MAXP Histogram highest peak DTLEV Delta time at levels MODE Histogram mode DWIDLEV Delta width at level ONELEVEL? EDLEV Edges at level PKS Histogram no of peaks EXTRATIO Eye level ratios PCTL Histogram percentile EYEAMPL Eye amplitude PLEV Period at
PA RT T WO : C O M M A N D S AVAILABLE WITH XMAP OPTION AVG Histogram mean MATLABPARAM Parameter using MATLAB DPLEV Delta period at level MAXP Histogram highest peak DTLEV Delta time at level MODE Histogram mode DWIDLEV Delta width at level NBPH Narrow band phase EDLEV Edges at level NBPW Narrow band power EXCELPARAM Parameter using Excel NUMMODES Histogram no of peaks EXCELPARAMARITH Param arithmetic Excel PCONST Parameter constant FLEV Frequency at level PSCRIPT Param VBS M
Remote Control Commands and Queries AVAILABLE WITH XMATH OPTION AVG Histogram mean MODE Histogram mode FWHM Histogram FWHM NBPH Narrow band phase FWXX Histogram FW peak NBPW Narrow band power HAMPL Histogram amplitude PKS Histogram no of peaks HBASE Histogram base PCTL Histogram percentile HIGH Histogram right bin POPATX Histogram bin population HMEDI Histogram median RANGE Histogram range HRMS Histogram RMS SIGMA Histogram standard dev HTOP Histogram top TOTP Histogram t
PA RT T WO : C O M M A N D S QUERY SYNTAX : PArameter_VAlue? [,...,] : = {F1,F2,F3,F4,F5,F6,F7,F8,TA,TB,TC,TD, C1,C2,C3,C4}. TA through TD are for backward compatibility, and are not returned by queries. NOTE: When PAVA? Is used to query a Custom parameter, the prefix is returned for consistency. However, the source for the measurement is the one configured using the PACU command. : = See table of parameters.
Remote Control Commands and Queries Response message: TB:PAVA RISE,3.
PA RT T WO : C O M M A N D S MISCELLANEOUS PASS_FAIL, PF Command/Query DESCRIPTION The PASS_FAIL command sets up the pass/fail system.
Remote Control Commands and Queries CURSOR PASS_FAIL_DO, PFDO Command/Query DESCRIPTION The PASS_FAIL_DO command defines the desired outcome and the actions that have to be performed after a Pass/Fail test. The PASS_FAIL_D? query indicates which actions are currently selected. Note that BEEP, PULS, SCDP and STO are provided for backward compatibility with existing software for earlier instruments. NOTATION COMMAND SYNTAX ALARM or BEEP Emit a beep. PRINT or SCDP Make a hard copy.
PA RT T WO : C O M M A N D S RELATED COMMANDS 206 BUZZER, CURSOR_MEASURE, CURSOR_SET, INR, PARAMETER_VALUE, PASS_FAIL_MASK ISSUED: February 2005 WM-RCM-E Rev D
Remote Control Commands and Queries DISPLAY PERSIST, PERS Command/Query DESCRIPTION The PERSIST command enables or disables the persistence display mode.
PA RT T WO : C O M M A N D S DISPLAY PERSIST_COLOR, PECL Command/Query DESCRIPTION The PERSIST_COLOR command controls the color rendering method of persistence traces. The response to the PERSIST_COLOR? query indicates the color rendering method, Analog Persistence or Color Graded Persistence. See the Operator’s Manual.
Remote Control Commands and Queries CURSOR PER_CURSOR_SET, PECS Command/Query DESCRIPTION NOTATION HABS HDIF HREF The PER_CURSOR_SET command allows you to position one or more of the six independent cursors at a given grid location. Cursors must be turned on for the PECS? query to work.
PA RT T WO : C O M M A N D S DISPLAY DESCRIPTION PERSIST_LAST, PELT Command/Query The PERSIST_LAST command controls whether or not the last trace drawn in a persistence data map is shown. This command checks or unchecks the Show Last Trace checkbox in the “Persistence” dialog. The response to the PERSIST_LAST? query indicates whether the last trace is shown within its persistence data map.
Remote Control Commands and Queries DISPLAY DESCRIPTION PERSIST_SAT, PESA Command/Query The PERSIST_SAT command sets the level at which the color spectrum of the persistence display is saturated. The level is specified in terms of percentage (PCT) of the total persistence data map population. A level of 100 PCT corresponds to the color spectrum being spread across the entire depth of the persistence data map. At lower values, the spectrum will saturate (brightest value) at the specified percentage value.
PA RT T WO : C O M M A N D S DISPLAY DESCRIPTION PERSIST_SETUP, PESU Command/Query The PERSIST_SETUP command selects the persistence duration of the display, in seconds, in persistence mode. In addition, the persistence can be set either to all traces or only the top two on the screen. The PERSIST_SETUP? query indicates the current status of the persistence. COMMAND SYNTAX PErsist_SetUp
Remote Control Commands and Queries STATUS DESCRIPTION *PRE Command/Query The *PRE command sets the PaRallel poll Enable register (PRE). The lowest eight bits of the Parallel Poll Register (PPR) are composed of the STB bits. *PRE allows you to specify which bit(s) of the parallel poll register will affect the ‘ist’ individual status bit. The *PRE? query reads the contents of the PRE register. The response is a decimal number that corresponds to the binary sum of the register bits.
PA RT T WO : C O M M A N D S *RCL Command SAVE/RECALL SETUP DESCRIPTION The *RCL command sets the state of your instrument, using one of the six non-volatile panel setups (Panel 1 to Panel 6), by recalling the complete front panel setup of the oscilloscope. Entering panel setup “0” corresponds to the default panel setup. The *RCL command produces an effect the opposite of the *SAV command.
Remote Control Commands and Queries RECALL_PANEL, RCPN SAVE/RECALL SETUP Command DESCRIPTION The RECALL_PANEL command recalls a front panel setup from the current directory on mass storage. COMMAND SYNTAX ReCall_PaNel DISK,,FILE,‘’ : = {FLPY, HDD} : = A string of up to eight characters with the extension .LSS. Include the path to the file; for example, D:\Applications\USB2\Setups\CHIRP_MEAS.
PA RT T WO : C O M M A N D S ACQUISITION REFERENCE_CLOCK, RCLK Command/Query DESCRIPTION The REFERENCE_CLOCK command allows you to choose between the internal reference clock and an external reference clock.
Remote Control Commands and Queries SAVE/RECALL SETUP *RST Command DESCRIPTION The *RST command initiates a device reset. *RST sets all eight traces to the GND line and recalls the default setup.
PA RT T WO : C O M M A N D S ACQUISITION SAMPLE_CLOCK, SCLK Command/Query DESCRIPTION The SAMPLE_CLOCK command allows you to choose between the internal sample clock and an external sample clock.
Remote Control Commands and Queries SAVE/RECALL SETUP DESCRIPTION *SAV Command The *SAV command stores the current state of your instrument in non-volatile internal memory. The *SAV command stores the complete front panel setup of the oscilloscope at the time the command is issued.
PA RT T WO : C O M M A N D S HARD COPY SCREEN_DUMP, SCDP Command DESCRIPTION The SCREEN_DUMP command causes the instrument to send the screen contents to the current hardcopy device. The time-and-date stamp corresponds to the time of the command.
Remote Control Commands and Queries ACQUISITION DESCRIPTION SEQUENCE, SEQ Command/Query The SEQUENCE command sets the conditions for the sequence mode acquisition. The response to the SEQUENCE? query gives the conditions for the sequence mode acquisition. The argument can be expressed either as numeric fixed point, exponential, or using standard suffixes.
PA RT T WO : C O M M A N D S Or, alternatively: = {50, 100, 250, 500, 1000, 2500, 5K, 10K, 25K, 50K, 100K, 250K, 500K, 1M} However, values not absolutely identical to those listed immediately above will be recognized by the scope as n u me r i c a l d a t a (see the table under this heading in Chapter 1). For example, the scope will recognize 1.0M as 1 millisample. But it will recognize 1.0MA as 1 megasample. NOTE: The oscilloscope will adapt the requested to the closest valid value.
Remote Control Commands and Queries STATUS DESCRIPTION *SRE Command/Query The *SRE command sets the Service Request Enable register (SRE). This command allows you to specify which summary message bit or bits in the STB register will generate a service request. Refer to the table on page 225 for an overview of the available summary messages. A summary message bit is enabled by writing a ‘1’ into the corresponding bit location.
PA RT T WO : C O M M A N D S STATUS DESCRIPTION *STB? Query The *STB? query reads the contents of the 488.1 defined STatus Byte register (STB), and the Master Summary Status (MSS). The response represents the values of bits 0 to 5 and 7 of the STB register and the MSS summary message. The response to a *STB? query is identical to the response of a serial poll except that the MSS summary message appears in bit 6 in place of the RQS message.
Remote Control Commands and Queries ADDITIONAL INFORMATION Bit 7 6 Bit Value 128 64 5 4 3 2 1 0 32 16 8 4 2 1 STATUS BYTE REGISTER (STB) Bit Name Description DIO7 0 reserved for future use MSS/RQS at least 1 bit in STB masked by SRE is 1 MSS = 1 service is requested RQS = 1 ESB 1 an ESR enabled event has occurred MAV 1 output queue is not empty DIO3 0 reserved VAB 1 a command data value has been adapted DIO1 0 reserved INB 1 an enabled internal state change has occurred Note 1. 2. 3. 4. 5. 6.
PA RT T WO : C O M M A N D S ACQUISITION STOP Command DESCRIPTION The STOP command immediately stops the acquisition of a signal. If the trigger mode is AUTO or NORM, STOP will place the oscilloscope in STOPPED trigger mode to prevent further acquisition.
Remote Control Commands and Queries WAVEFORM TRANSFER STORE, STO Command DESCRIPTION The STORE command stores the contents of the specified trace in one of the internal memories M1 to M4 or in the current directory in mass storage. COMMAND SYNTAX STOre [,] : = {F1,F2,F3,F4,F5,F6,F7,F8,TA,TB,TC,TD ,C1,C2,C3, C4,ALL_DISPLAYED}. TA through TD are for compatibility with existing software with earlier instruments. These four mnemonics are not returned by queries.
PA RT T WO : C O M M A N D S SAVE/RECALL SETUP DESCRIPTION STORE_PANEL, STPN Command The STORE_PANEL command stores the complete front panel setup of your oscilloscope, at the time the command is issued, in a file in the current directory in mass storage.
Remote Control Commands and Queries WAVEFORM TRANSFER STORE_SETUP, STST Command/Query DESCRIPTION The STORE_SETUP command controls the way in which traces will be stored. Any one trace, or all displayed traces, can be set up for storage, either by auto-storing or by the STORE command. Using auto-store, two modes are available, FILL, which stops when the storage medium is full, and WRAP, which replaces the oldest trace by the latest one.
PA RT T WO : C O M M A N D S RELATED COMMANDS 230 STORE, INR ISSUED: February 2005 WM-RCM-E Rev D
Remote Control Commands and Queries WAVEFORM TRANSFER DESCRIPTION TEMPLATE?, TMPL? Query The TEMPLATE? query produces a copy of the template that describes the various logical entities making up a complete waveform. In particular, the template describes in full detail the variables contained in the descriptor part of a waveform. See Chapter 4 for more on the waveform template, and Appendix II for a copy of the template itself.
PA RT T WO : C O M M A N D S ACQUISITION DESCRIPTION TIME_DIV, TDIV Command/Query The TIME_DIV command modifies the timebase setting. The new timebase setting can be specified with units: NS for nanoseconds, US for microseconds, MS for milliseconds, S for seconds, or KS for kiloseconds. Alternatively, you can use exponential notation: 10E-6, for example. An out-of-range value causes the VAB bit (bit 2) in the STB register (see table on page 225) to be set.
Remote Control Commands and Queries MISCELLANEOUS DESCRIPTION *TST? Query The *TST? query performs an internal self-test, the response indicating whether the self-test has detected any errors. The self-test includes testing the hardware of all channels, the timebase and the trigger circuits. Hardware failures are identified by a unique binary code in the returned number. A “0” response indicates that no failures occurred.
PA RT T WO : C O M M A N D S DISPLAY DESCRIPTION TRACE, TRA Command/Query The TRACE command enables or disables the display of a trace. An environment error (see table on page 145) is set if an attempt is made to display more than four waveforms. The TRACE? query indicates whether the specified trace is displayed or not. COMMAND SYNTAX : TRAce : = {C1,C2,C3,C4,F1,F2,F3,F4,F5,F6,F7, F8,TA,TB,TC,TD}.
Remote Control Commands and Queries WAVEFORM STORAGE TRANSFER_FILE, TRFL Command/Query DESCRIPTION This command allows you to transfer files to and from storage media, or between scope and computer. The command format is used to transfer files from the computer to storage media. The query format is used to transfer files from storage media to computer.
PA RT T WO : C O M M A N D S ACQUISITION *TRG Command DESCRIPTION The *TRG command executes an ARM command. *TRG is the equivalent of the 488.1 GET (Group Execute Trigger) message.
Remote Control Commands and Queries ACQUISITION DESCRIPTION TRIG_COUPLING, TRCP Command/Query The TRIG_COUPLING command sets the coupling mode of the specified trigger source. The TRIG_COUPLING? query returns the trigger coupling of the selected source.
PA RT T WO : C O M M A N D S ACQUISITION DESCRIPTION TRIG_DELAY, TRDL Command/Query The TRIG_DELAY command sets the time at which the trigger is to occur with respect to the first acquired data point (displayed at the left-hand edge of the screen). Positive trigger delays are to be expressed as a percentage of the full grid. This mode is called pre-trigger acquisition because data are acquired before the trigger occurs. Negative trigger delays must be given in seconds.
Remote Control Commands and Queries EXAMPLE (GPIB) The following instruction sets the trigger delay to -20 s (post-trigger): CMD$=“TRDL -20S”: CALL IBWRT(SCOPE%,CMD$) RELATED COMMANDS WM-RCM-E Rev D TIME_DIV, TRIG_COUPLING, TRIG_LEVEL, TRIG_MODE, TRIG_SELECT, TRIG_SLOPE ISSUED: February 2005 239
PA RT T WO : C O M M A N D S ACQUISITION DESCRIPTION TRIG_LEVEL, TRLV Command/Query The TRIG_LEVEL command adjusts the trigger level of the specified trigger source. An out-of-range value will be adjusted to the closest legal value and will cause the VAB bit (bit 2) in the STB register to be set. The TRIG_LEVEL? query returns the current trigger level. COMMAND SYNTAX : TRig_LeVel : = {C1, C2, C3, C4, EX, EX10, ETM10} NOTE: The unit V is optional.
Remote Control Commands and Queries ACQUISITION DESCRIPTION TRIG_MODE, TRMD Command/Query The TRIG_MODE command specifies the trigger mode. The TRIG_MODE? query returns the current trigger mode. COMMAND SYNTAX TRig_MoDe : = {AUTO, NORM, SINGLE, STOP} NOTE: In some older models, sending the command TRMD SINGLE while the oscilloscope is armed forces an acquisition. In current oscilloscope models this effect can be achieved by sending the command FORCE_TRIGGER.
PA RT T WO : C O M M A N D S ACQUISITION DESCRIPTION TRIG_PATTERN, TRPA Command/Query The TRIG_PATTERN command defines a trigger pattern. The command specifies the logic level of the pattern sources (Channel 1, Channel 2, Channel 3, Channel 4, External), as well as the states under which a trigger can occur. This command can be used even if the Pattern trigger mode has not been activated. Notation: L LOW H HIGH AND OR NAND NOR The TRIG_PATTERN? query returns the current trigger pattern.
Remote Control Commands and Queries EXAMPLE (GPIB) The following instruction configures the logic state of the pattern as HLXH (CH 1 = H, CH 2 = L, CH 3 = X, CH 4 = H) and defines the state as NOR.
PA RT T WO : C O M M A N D S ACQUISITION TRIG_SELECT, TRSE Command/Query DESCRIPTION The TRIG_SELECT command selects the condition that will trigger the acquisition of waveforms. Depending on the trigger type, additional parameters may need to be specified. These additional parameters are grouped in pairs. The first in the pair names the variable to be modified, while the second gives the new value to be assigned. Pairs may be given in any order and restricted to only those variables to be changed.
Remote Control Commands and Queries INTV TEQ Interval Edge Qualified IS TI Time greater than Interval smaller than I2 Interval width TL Time within COMMAND SYNTAX TRig_SElect ,SR,,QL,, HT,,HV,,HV2, : = {DROP, EDGE, GLIT, INTV, STD, SNG, SQ, TEQ} : = {C1, C2, C3, C4, LINE, EX, EX10, PA, ETM10} : = {TI, TL, EV, PS, PL, IS, IL, P2, I2, OFF} : = See specifications in the Operator’s Manual for v
PA RT T WO : C O M M A N D S AVAILABILITY : {C3, C4} only available on four-channel instruments. EXAMPLE (GPIB) The following instruction selects the single-source trigger with Channel 1 as trigger source.
Remote Control Commands and Queries ACQUISITION DESCRIPTION TRIG_SLOPE, TRSL Command/Query The TRIG_SLOPE command sets the trigger slope of the specified trigger source. The TRIG_SLOPE? query returns the trigger slope of the selected source.
PA RT T WO : C O M M A N D S AUTOMATION DESCRIPTION VBS, VBS Command/Query The VBS command allows Automation commands to be sent in the context of an existing program. The Automation command must be placed within single quotation marks. The = sign may be flanked by optional spaces for clarity.
Remote Control Commands and Queries DISPLAY DESCRIPTION VERT_MAGNIFY, VMAG Command/Query The VERT_MAGNIFY command vertically expands the specified trace. The command is executed even if the trace is not displayed. The maximum magnification allowed depends on the number of significant bits associated with the data of the trace. The VERT_MAGNIFY? query returns the magnification factor of the specified trace.
PA RT T WO : C O M M A N D S DISPLAY DESCRIPTION VERT_POSITION, VPOS Command/Query The VERT_POSITION command adjusts the vertical position of the specified trace on the screen. It does not affect the original offset value obtained at acquisition time. The VERT_POSITION? query returns the current vertical position of the specified trace. NOTE: The VPOS command and query can only be applied to math function and memory traces. It does not apply to channel inputs.
Remote Control Commands and Queries ACQUISITION DESCRIPTION VOLT_DIV, VDIV Command/Query The VOLT_DIV command sets the vertical sensitivity in Volts/div. The VAB bit (bit 2) in the STB register (see table on page 225) is set if an out-of-range value is entered. The probe attenuation factor is not taken into account for adjusting vertical sensitivity. The VOLT_DIV? query returns the vertical sensitivity of the specified channel.
PA RT T WO : C O M M A N D S STATUS *WAI Command DESCRIPTION The *WAI (WAIt to continue) command, required by the IEEE 488.2 standard, has no effect on the oscilloscope, as the instrument only starts processing a command when the previous command has been entirely executed.
Remote Control Commands and Queries ACQUISITION WAIT Command DESCRIPTION The WAIT command prevents your instrument from analyzing new commands until the current acquisition has been completed. The optional argument specifies the timeout (in seconds) after which the scope will stop waiting for new acquisitions. If is not given, or if = 0.0, the scope will wait indefinitely.
PA RT T WO : C O M M A N D S WAVEFORM TRANSFER DESCRIPTION WAVEFORM, WF Command/Query A WAVEFORM command transfers a waveform from the controller to the oscilloscope, whereas a WAVEFORM? query transfers a waveform from the oscilloscope to the controller. WAVEFORM stores an external waveform back into the oscilloscope’s internal memory. A waveform consists of several distinct entities: 1. the descriptor (DESC) 2. the user text (TEXT) 3. the time (TIME) descriptor 4.
Remote Control Commands and Queries QUERY SYNTAX : WaveForm? : = {F1,F2,F3,F4,F5,F6,F7,F8,TA,TB, TC,TD,M1,M2,M3,M4,C1,C2,C3,C4}. TA through TD are for compatibility with existing software with earlier instruments. These four mnemonics are not returned by queries. : = {DESC, TEXT, TIME, DAT1, DAT2, ALL} If you do not give a parameter, ALL will be assumed.
PA RT T WO : C O M M A N D S CALL CALL CALL CALL IBEOT(SCOPE%,0)disable EOI IBWRT(SCOPE%,CMD$) IBEOT(SCOPE%,1)re-enable EOI IBWRTF(SCOPE%,FILE$) The “M1:” command ensures that the active waveform is “M1”. When the data file is sent to the oscilloscope, it first sees the header “WF” (the characters “C1:” having been skipped when reading the file) and assumes the default destination “M1”.
Remote Control Commands and Queries WAVEFORM TRANSFER DESCRIPTION WAVEFORM_SETUP, WFSU Command/Query The WAVEFORM_SETUP command specifies the amount of data in a waveform to be transmitted to the controller. The command controls the settings of the parameters listed below. NOTATION FP first point NP number of points SN segment number SP Sparsing Sparsing (SP): Number of points (NP): The sparsing parameter defines the interval between data points.
PA RT T WO : C O M M A N D S Segment number (SN): The segment number parameter indicates which segment should be sent if the waveform was acquired in sequence mode. This parameter is ignored for non-segmented waveforms. For example: SN = 0 all segments SN = 1 first segment SN = 23 segment 23 The WAVEFORM_SETUP? query returns the transfer parameters currently in use. COMMAND SYNTAX WaveForm_SetUp SP,,NP,,FP,,SN, NOTE: After power-on, all values are set to 0 (i.e.
APPENDIX Program Examples I Programming Examples INTRODUCTION TO DSO SOFTWARE TOOLS Although the X-Stream DSOs are unrivalled in their ability to process data internally, they are sometimes required to send information to the outside world. For this purpose, LeCroy provides tools that facilitate remote interaction with the instruments. This appendix describes two types of software. The first type is provided in executable form, to enable users to make a quick start with remote control.
A P P E N D I X I : Program Examples SOURCE CODE PROGRAMS These programs can be divided into two types, those using National Instruments GPIB software and hardware, and those using ActiveDSO, which for GPIB also connects to National Instruments software and hardware. A great benefit of ActiveDSO is that the code written by the user is completely independent of the hardware connection. The selection of GPIB, LAN, or RS232 (for earlier DSOs) is made by a single command near the start of a program.
GPIB Program Examples dev4: ibrd enter byte count: 20 [2100] ( end cmpl ) count: 11 43 31 3A 43 50 4C 20 44 C 1 : C P L D 35 30 0A 5 0 z dev4: q to quit the program. SOURCE CODE EXAMPLE GPIB - 2 Use the GPIB Program for IBM PC (High-Level Function Calls) The following BASICA program allows full interactive control of the oscilloscope using an IBM PC as GPIB controller. As in Example 1, it is assumed that the controller is equipped with a National Instruments GPIB interface card.
A P P E N D I X I : Program Examples CALL IBWRT(SCOPE%,CMD$) IF IBSTA% < 0 THEN GOSUB GPIBError : END GOSUB GetData LoopEnd : WEND LocalMode: ‘ Put DSO into Local Mode. CALL IBLOC (SCOPE%) : PRINT RETURN GetData : ‘ Get data from DSO. ' If there are no data to read, simply wait until timeout occurs CALL IBRD (SCOPE%,RD$) I = IBCNT% 'IBCNT% is the number of characters read FOR J = 1 TO I PRINT MID$ (RD$,J,1); NEXT J PRINT : RETURN StoreData : ‘ Store waveform data in a file.
GPIB Program Examples NOTE: ¾ It is assumed that the National Instruments GPIB driver GPIB.COM is in its default state. This means that the interface board can be referred to by its symbolic name ‘GPIB0’ and that devices on the GPIB with addresses 1 to 16 can be called by the symbolic name ‘DEV1’ to ‘DEV16’. ¾ Lines 1–99 are a copy of the file DECL.BAS supplied by National Instruments. The first six lines are required for the initialization of the GPIB handler. DECL.BAS requires access to the file BIB.
A P P E N D I X I : Program Examples BaseListen% = 32 : BaseTalk% = 64 DSOAddress% = 4 DSOListen$ = UnListen$ + UnTalk$ + Chr$ (BaseTalk%) + Chr$ (BaseListen% + DSOAddress%) DSOTalk$ = UnListen$ + UnTalk$ + Chr$ (BaseListener%) + Chr$ (BaseTalk% + DSOAddress%) BDNAME$= "GPIB0" : CALL IBFIND (BDNAME$,BRD0%) IF BRD0% < 0 THEN PRINT “IBFIND ERROR” : STOP CALL IBSIC (BRD0%) : IF IBSTA% < 0 THEN PRINT “IBFIND ERROR” : STOP LOOP = 1 WHILE LOOP LINE INPUT "Enter command (EX --> Exit) : ",CMD$ V% = 1: CALL IBSRE(BR
GPIB Program Examples LINE INPUT "Specify target memory (M1...M4) : ",MEM$ LINE INPUT "Enter filename : ",FILE$ CALL IBCMD (BRD0%,DSOListen$) CMD$=MEM$+":" : CALL IBWRT (BRD0%,CMD$) CALL IBWRTF (BRD0%,FILE$) IF IBSTA% < 0 THEN GOSUB GPIBError : STOP PRINT : RETURN GPIBError : PRINT "GPIB ERROR -- IBERR : ";IBERR%;"IBSTA : ";HEX$ (IBSTA%) : RETURN END NOTE: The Template also describes an array named DUAL. This is simply a way to allow you to use the INSPECT? query to examine the two data arrays together.
A P P E N D I X I : Program Examples SOURCE CODE EXAMPLE ACTIVEDSO -- 1 AND 2 The picture shows the screen of a program, ActiveDSOExcel1, that uses ActiveDSO embedded in Excel. ActiveDSOExcel2 is similar. This example shows how to create some simple applications, and can be a basis for further explorations in ActiveDSO. This example is included in the ActiveDSO system that can be downloaded from LeCroy’s website at http://www.lecroy.com/tm/library/software/.
GPIB Program Examples The fragment below is the subroutine that reads waveform data from the DSO and places the values in column I (9th column) of the spreadsheet. Private Sub GetScaledWaveformButton_Click() Dim o As Object ‘ Define variable o as an object. ‘ Equate object o with the ActiveDSO object LeCroy.ActiveDSOCtrl1. Set o = CreateObject("LeCroy.ActiveDSOCtrl.1") ‘ Read the device address from cell 2C, and use it to connect the PC to the DSO.
A P P E N D I X I : Program Examples SOURCE CODE EXAMPLE ACTIVEDSO -- 3 AND 4 The picture below shows the screen of programs ActiveDSOExcel3, which enables commands and queries to be sent to the X-Stream DSO, using LeCroy’s ActiveDSO system. The VBA source code can be seen by clicking Tools / Macro / Visual Basic Editor. The Clear button clears all the commands and queries. The Execute button sends the commands and queries in order down the page.
GPIB Program Examples Dim DeviceAddress As String ‘ Read the device address from cell 2D, and use it to connect the PC to the DSO. DeviceAddress = Worksheets("Sheet1").Cells(2, 4).Value Call o.MakeConnection(DeviceAddress) ‘ Set the DSO into remote control mode. Call o.SetRemoteLocal(1) ' Set TimeOut to 3 seconds instead of the default, which is 10 seconds. Call o.
A P P E N D I X I : Program Examples ' Look for"?" in command string. If InStr(NextData, Query) > 0 Then ‘ Collect response from instrument. Worksheets("Sheet1").Cells(Row, Column + 2).Value = o.ReadString(1000) End If ‘ Check for Error If o.ErrorFlag = True Then ' Show error message. Worksheets("Sheet1").Cells(Row, Column + 2).Value = o.ErrorString Waiting = True: HoldOff = 0: ErrorFound = Tru ‘ Store command line for restart. Worksheets("Sheet1").Cells(2, 6).Value = Row + 1 End If End If Next Counter .
GPIB Program Examples EXAMPLE ACTIVEDSO – 5 The picture below shows the screen of program ActiveDSOVB1, a Visual Basic program using ActiveDSO. This example shows how to arm the trigger, get a parameter from the X-Stream DSO, get waveforms, and draw them on the screen of the PC. TRANSLATION EXAMPLES Some source code examples are available for decoding binary waveform files. These are TranWM in Microsoft Visual Basic and TraceLook in VBA/Microsoft Excel.
A P P E N D I X I : Program Examples INTRODUCTION TO ACTIVEDSO This ActiveXTM control enables LeCroy oscilloscopes to be controlled by, and to exchange data with, a variety of Windows applications that support the ActiveX standard. MS Office programs, Internet Explorer, Visual Basic, Visual C++, Visual Java, and MATLAB (v5.3) are a few of the many applications that support ActiveX controls. ActiveDSO is available on the internet at http://www.lecroy.
GPIB Program Examples Example Syntax: Boolean controlName.WriteString The WriteString method has the following arguments: controlname The name of the ActiveDSO control object textStringString Text string to send to the device EOI Boolean TRUE = terminate with EOI Returns: True on success, False on failure Remarks: This method sends a string command to the instrument. If EOI is set to TRUE, the device will start to interpret the command immediately. This is normally the desired behavior.
A P P E N D I X I : Program Examples • As an invisible object accessed through a scripting language (VBA, for example) to remotely control the X-Stream DSO. See the VBA example below for more details. The ActiveDSO control may be embedded in any ActiveX containment-capable client, and may be used manually without need of any programming or scripting. EXAMPLE USING POWERPOINT 97 This example shows the control being embedded in a Microsoft PowerPoint slide.
GPIB Program Examples 5. From the pop-up window, select LeCroy ActiveDSO Control object: 6. From the Edit menu, select LeCroy ActiveDSO Control Object, then Edit: 7. Right-click the object and select “Make Connection.
A P P E N D I X I : Program Examples 8. Select “Network TCP/IP connection” (“scope” = WaveMaster): 9. Enter the X-Stream DSO’s IP address and click “OK.
GPIB Program Examples 10. Right-click the object again and select the Refresh Image menu item. A captured waveform will be displayed similar to the one shown here: X-Stream DSO’s captured waveform imported into PowerPoint. Once the ActiveDSO object has been properly set within the application, a macro script can be created utilizing an object method such as WriteString() to send DISP ON, C1:TRA ON, TRMD. Then RefreshImage() method can be used to update the screen.
A P P E N D I X I : Program Examples EXAMPLE IN VBA VBA is the programming language built in to many of the more recent Windows applications. It is a subset of Visual Basic that makes using OLE Automation Servers and ActiveX Controls very simple. The following VBA subroutine demonstrates how easy it is to connect to an X-Stream DSO and send remote commands to it. _______________________________________________________ Sub LeCroyDSOTest() Dim dso As Object Set dso = CreateObject("LeCroy.ActiveDSO.
APPENDIX Waveform Template II Waveform Template This appendix contains the Waveform Template that describes the contents of the Waveform Descriptor that is produced by the commands WF? DESC and WF? ALL. After the template are explanations of the construction of floating point numbers from bytes in the descriptor, followed by program fragments that show a method of performing the calculations.
A P P E N D I X I I : Waveform Template ; In the following explanation, every element of a block is described by a ; single line in the form ; ; : ; ; ; where ; ; = position in bytes (decimal offset) of the variable, ; relative to the beginning of the block. ; ; = name of the variable.
Waveform Template ; time_stamp double precision floating point number, ; for the number of seconds and some bytes ; for minutes, hours, days, months and year. ; ; double seconds (0 to 59) ; byte minutes (0 to 59) ; byte hours (0 to 23) ; byte days (1 to 31) ; byte months (1 to 12) ; word year (0 to 16000) ; word unused ; There are 16 bytes in a time field.
A P P E N D I X I I : Waveform Template ; The following variables of this basic wave descriptor block specify ; the block lengths of all blocks of which the entire waveform (as it is ; currently being read) is composed. If a block length is zero, this ; block is (currently) not present. ; ; Blocks and arrays that are present will be found in the same order ; as their descriptions below.
Waveform Template ; The following variables describe the waveform and the time at ; which the waveform was generated. ; <116> WAVE_ARRAY_COUNT: long ; number of data points in the data ; array. If there are two data ; arrays (FFT or Extrema), this number ; applies to each array separately. ; <120> PNTS_PER_SCREEN: long ; nominal number of data points ; on the screen ; <124> FIRST_VALID_PNT: long ; count of number of points to skip ; before first good point ; FIRST_VALID_POINT = 0 ; for normal waveforms.
A P P E N D I X I I : Waveform Template <152> always POINTS_PER_PAIR: word ; for Peak Detect waveforms (which ; include data points in DATA_ARRAY_1 and ; min/max pairs in DATA_ARRAY_2). ; Value is the number of data points for ; each min/max pair. ; <154> PAIR_OFFSET: word ; <156> ; <160> VERTICAL_GAIN: float VERTICAL_OFFSET: float ; to get floating values from raw data : ; VERTICAL_GAIN * data - VERTICAL_OFFSET ; <164> MAX_VALUE: float ; maximum allowed value.
Waveform Template _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 endenum ; <318> ; <320> ; <322> single_sweep interleaved histogram graph filter_coefficient complex extrema sequence_obsolete centered_RIS peak_detect PROCESSING_DONE: enum _0 no_processing _1 fir_filter _2 interpolated _3 sparsed _4 autoscaled _5 no_result _6 rolling _7 cumulative endenum RESERVED5: word ; expansion entry RIS_SWEEPS: word ; for RIS, the number of sweeps ; else 1 ; ; The following variables describe the basic acquisition ; conditions us
A P P E N D I X I I : Waveform Template <324> ; <326> 286 TIMEBASE: enum _0 1_ps/div _1 2_ps/div _2 5_ps/div _3 10_ps/div _4 20_ps/div _5 50_ps/div _6 100_ps/div _7 200_ps/div _8 500_ps/div _9 1_ns/div _10 2_ns/div _11 5_ns/div _12 10_ns/div _13 20_ns/div _14 50_ns/div _15 100_ns/div _16 200_ns/div _17 500_ns/div _18 1_us/div _19 2_us/div _20 5_us/div _21 10_us/div _22 20_us/div _23 50_us/div _24 100_us/div _25 200_us/div _26 500_us/div _27 1_ms/div _28 2_ms/div _29 5_ms/div _30 10_ms/div _31 20_ms/div _
Waveform Template _3 ground _4 AC,_1MOhm endenum ; <328> ; <332> PROBE_ATT: float FIXED_VERT_GAIN: enum _0 1_uV/div _1 2_uV/div _2 5_uV/div _3 10_uV/div _4 20_uV/div _5 50_uV/div _6 100_uV/div _7 200_uV/div _8 500_uV/div _9 1_mV/div _10 2_mV/div _11 5_mV/div _12 10_mV/div _13 20_mV/div _14 50_mV/div _15 100_mV/div _16 200_mV/div _17 500_mV/div _18 1_V/div _19 2_V/div _20 5_V/div _21 10_V/div _22 20_V/div _23 50_V/div _24 100_V/div _25 200_V/div _26 500_V/div _27 1_kV/div endenum ; WM-RCM-E Rev D ISSUED:
A P P E N D I X I I : Waveform Template <334> ; <336> ; <340> ; <344> BANDWIDTH_LIMIT: enum _0 off _1 on endenum VERTICAL_VERNIER: float ACQ_VERT_OFFSET: float WAVE_SOURCE: enum _0 CHANNEL_1 _1 CHANNEL_2 _2 CHANNEL_3 _3 CHANNEL_4 _9 UNKNOWN endenum ; /00 ENDBLOCK ; ;========================================================================== ; USERTEXT: BLOCK ; ; Explanation of the descriptor block USERTEXT at most 160 bytes long.
Waveform Template < 0> RIS_OFFSET: double ; seconds from trigger to zeroth ; point of segment ; /00 ENDARRAY ; ;========================================================================== ; DATA_ARRAY_1: ARRAY ; ; Explanation of the data array DATA_ARRAY_1. ; This main data array is always present. It is the only data array for ; most waveforms. ; The data item is repeated for each acquired or computed data point ; of the first data array of any waveform.
A P P E N D I X I I : Waveform Template ; DUAL: ARRAY ; ; Explanation of the DUAL array. ; This data array is identical to DATA_ARRAY_1, followed by DATA_ARRAY_2. ; DUAL is an accepted alias name for the combined arrays DATA_ARRAY_1 and ; DATA_ARRAY_2 (e.g. real and imaginary parts of an FFT). ; < 0> MEASUREMENT_1: data ; data in DATA_ARRAY_1. ; < 0> MEASUREMENT_2: data ; data in DATA_ARRAY_2.
Waveform Template DECODING FLOATING POINT NUMBERS Single precision values are held in four bytes. If these are arranged in decreasing order of value we get the following bits: bit 31, bit 30, bit 29, bit 28 . . . . . bit 3, bit 2, bit 1, bit 0 We must remember that if the byte order command CORD has been set for low byte first, the bytes as received in a waveform descriptor will be received in the reverse order. But within a byte, the bits keep their order, highest at the left as expected.
A P P E N D I X I I : Waveform Template In a way that does not follow the byte boundaries, the bits are to be segregated as follows: 31 sign bit 30, 29 . . . . 24, 23 exponent bits 22, 21 . . . . 2, 1, 0 fractional bits 0.5, 0.25, 0.125 . . . The sign bit s is 1 for a negative number and 0 for a positive number, so it is easy to construct the sign from this: S = (-1)^s The 8 exponent bits have the following values: bit 23 is worth 1, bit 24 is worth 2 . . .
Waveform Template 0 01101001 00000110001001001101111. The first bit, 0, makes the sign of the number S, using the formula S = (-1)s = 1. The next eight bits make the exponent e as follows: 0 X 128 + 1 X 64 + 1 X 32 + 0 X 16 + 1 X 8 + 0 X 4 + 0 X 2 + 1 X 1 = 105, from which we subtract 127, giving -22. So the factor E is 2(e-127) = 2-22, which is 2.3842E-7. Finally, we need to make the multiplier F. The remaining bits are given the values 0.5, 0.25, 0.125, 0.0625, 0.03125, etc.
A P P E N D I X I I : Waveform Template In a way that does not follow the byte boundaries, the bits are to be segregated as follows: 63 sign bit 62, 61 . . . . 53, 52 51, 50 . . . . 2, 1, 0 11 exponent bits 52 fractional bits 0.5, 0.25, 0.125 . . . The sign bit is 1 for a negative number and 0 for a positive number, so it is easy to construct the sign from this: S = (-1)^s. The 11 exponent bits have the following values: 52 Æ 1, 53 Æ 2 . . .
Waveform Template Then we have to create the multiplying number. The values of the 52 bits are as follows: 51 Æ 0.5, 50 Æ 0.25, 49 Æ 0.125, 48 Æ 0.0625 . . . . When all the bits are added together, we obtain a positive number f that can be very close to one, differing from it only by the value of the smallest bit, if all the bits are ones. Generally the value will be much less than one. Then we add one to the result, obtaining 1 + f = F. The use of the added one extends the dynamic range of the data.
A P P E N D I X I I : Waveform Template HOW TO CONSTRUCT A FLOATING POINT NUMBER FROM FOUR BYTES ' Routine to construct a floating point number from four bytes. Function GetFloat(DescPoint as Integer) ' ' ‘ DescPoint is the address of the byte in the waveform descriptor where the data begin. The data are assumed to be in an array called Desc (0 to 350). ' For example, to calculate VERTICAL_GAIN, DescPoint = 156.
Waveform Template FFraction = CDbl(FDigit And 127) FFraction = FFraction * Mult2 ' Fraction FByte = ByteOrd3 + 2 * ByteOrd FDigit = Desc(DescPoint + FByte) FFraction = FFraction + CDbl(FDigit) * ' started Mult3 FByte = ByteOrd3 + 3 * ByteOrd FDigit = Desc(DescPoint + FByte) FFraction = FFraction + CDbl(FDigit) * Mult4 ' Fraction completed ______________________________________________________________ FVariable = 2 ^ FExponent GetFloat = FVariable * FSign * (1 + completed FFraction) ' Conversion E
A P P E N D I X I I : Waveform Template HOW TO CONSTRUCT A FLOATING POINT NUMBER FROM FOUR BYTES ' Routine to construct a double precision floating point number from eight bytes. Function GetDoubleFloat (DescPoint as Integer) ' ' ‘ DescPoint is the address of the byte in the waveform descriptor where the data begin. The data are assumed to be in an array called Desc (0 to 350). ' For example, to calculate HORIZontal_OFFSET, DescPoint = 180.
Waveform Template ' For I = 2 To FByte = ByteOrd7 + I * ByteOrd FDigit = Desc(DescPoint + FByte) FFraction = FFraction + CDbl(FDigit) * DMult3 DMult3 = DMult3 / 256 Next I ' Fraction completed ______________________________________________________________ FVariable = 2 ^ FExponent GetDoubleFloat = FVariable * FSign * (1 + FFraction) End ' End of GetDoubleFloat ________________________________________ §§§ WM-RCM-E Rev D ISSUED: February 2005 299