Book 86100 Programming Guide
86100_Programming_Guide
86100_Programming_Guide
86100_Programming_Guide
User Manual: Pdf
Open the PDF directly: View PDF .
Page Count: 368
Download | |
Open PDF In Browser | View PDF |
Keysight 86100A/B/C/D Wide-Bandwidth Oscilloscope (for programming the legacy instrument GUI. To program the FlexDCA GUI, refer to the 86100D help.) Programmer’s Guide Notices © Keysight Technologies, Inc. 2000-2014 Manual Part Number No part of this manual may be reproduced in any form or by any means (including electronic storage and retrieval or translation into a foreign language) without prior agreement and written consent from Keysight Technologies, Inc. as governed by United States and international copyright laws. 86100-90131 Ed ition Eleventh edition, April 2015 Printed in USA Published by: Keysight Technologies, Inc. 1400 Fountaingrove Parkway Santa Rosa, CA 95403 Warranty The material contained in this document is provided “as is,” and is subject to being changed, without notice, in future ed itions. Further, to the maximum extent permitted by applicable law, Keysight d isclaims all warranties, either express or implied, with regard to this manual and any information contained herein, includ ing but not limited to the implied warranties of merchantability and fitness for a particular purpose. Keysight shall not be liable for errors or for incidental or consequential damages in connection with the furnishing, use, or performance of this document or of any information contained herein. Should Keysight and the user have a separate written agreement with warranty terms covering the material in this document that conflict with these terms, the warranty terms in the separate agreement shall control. Technology Licenses The hardware and/or software described in this document are furnished under a license and may be used or copied only in accordance with the terms of such license. Restricted Rights Legend If software is for use in the performance of a U.S. Government prime contract or subcontract, Software is delivered and licensed as “Commercial computer software” as defined in DFAR 252.227-7014 (June 1995), or as a “commercial item” as defined in FAR 2.101(a) or as “Restricted computer software” as defined in FAR 52.227-19 (June 1987) or any equivalent agency regulation or contract clause. Use, duplication or disclosure of Software is subject to Keysight Technologies’ standard commercial license terms, and non-DOD Departments and Agencies of the U.S. Government will receive no greater than Restricted Rights as defined in FAR 52.227-19(c)(1-2) (June 1987). U.S. Government users will receive no greater than Limited Rights as defined in FAR 52.227-14 (June 1987) or DFAR 252.227-7015 (b)(2) (November 1995), as applicable in any technical data. Safety Notices CAUTION A CAUTION notice denotes a hazard. It calls attention to an operating procedure, practice, or the like that, if not correctly performed or adhered to, could result in damage to the product or loss of important data. Do not proceed beyond a CAUTION notice until the indicated conditions are fully understood and met. WARNING A WARNING notice denotes a hazard. It calls attention to an operating procedure, practice, or the like that, if not correctly performed or adhered to, could resul t in personal injury or death. Do not proceed beyond a WARNING notice until the ind icated cond itions are fully understood and met. Contents 1 Introduction / 7 Who Should Use This Book / 7 Supported Firmware Versions / 8 IEEE 488.2 (SCPI) / 8 SICL/LAN Support / 9 The Command Tree / 13 Command Syntax / 14 Queries / 17 Starting a Program / 19 Multiple Databases / 21 Files / 23 Status Reporting / 26 Interface Functions / 37 Commands Unavailable in Jitter Mode / 39 Error Messages / 41 Language Compatibility / 49 2 Programming Examples / 55 Listings of the C sample programs in this section include: / 56 BASIC Programming Examples / 78 3 Common Commands / 89 Introduction / 90 Commands / 91 4 Root Level Commands / 103 5 System Commands / 117 6 Acquire Commands / 123 7 Calibration Commands / 131 8 Channel Commands / 141 9 Clock Recovery Commands / 151 10 Disk Commands / 165 3 11 Display Commands / 175 12 Function Commands / 187 13 Hardcopy Commands / 195 14 Histogram Commands / 199 15 Limit Test Commands / 203 16 Marker Commands / 213 17 Mask Test Commands / 219 18 Measure Commands / 235 Introduction / 239 Commands / 241 19 S-Parameter Commands (Rev. A.08.00 and Above) / 287 Introduction / 288 Commands / 290 20 S-Parameter Commands (Rev. A.07.00 and Below) / 297 Introduction / 298 Commands / 299 21 Signal Processing Commands / 303 Introduction / 304 Commands / 305 22 TDR/TDT Commands (Rev. A.06.00 and Above) / 309 Introduction / 309 Commands / 312 23 TDR/TDT Commands (Rev. A.05.00 and Below) / 319 24 Timebase Commands / 329 25 Trigger Commands / 335 26 Waveform Commands / 341 Introduction / 342 Commands / 344 4 27 Waveform Memory Commands / 355 5 6 Keysight 86100A/B/C/D Wide-Bandwidth Oscilloscope Programmer’s Guide 1 Introduction SICL/LAN Support 9 The Command Tree 13 Command Syntax 14 Queries 17 Starting a Program 19 Multiple Databases 21 Files 23 Status Reporting 26 Interface Functions 37 Commands Unavailable in Jitter Mode 39 Error Messages 41 Language Compatibility 49 Who Should Use This Book Use this book if you are programming an 86100D that is running the instrument’s legacy GUI. To program an 86100D that is running the FlexDCA GUI, do not use the commands in this book. Instead, with the 86100D FlexDCA GUI displayed click Help > Contents. Then, click the “Programming” link to learn about the programming commands for FlexDCA. Table 1 86100D GUIs 86100D Running Legacy GUI NOTE 86100D Running FlexDCA GUI If you are using FlexDCA on a PC to control the 86100D with the legacy GUI, do not use this book. Instead send FlexDCA programming commands to FlexDCA and let FlexDCA control the 86100D. Use the commands documented in FlexDCA’s help system. 7 1 Introduction Supported Firmware Versions This edition of this book documents remote control of the instruments shown in the following table. Table 2 NOTE Supported Instruments Instrument Firmware Vision 86100D A.13.00 and below 86100C A.10.80 and below 86100B A.05.00 and below 86100A A.05.00 and below Starting with firmware version A.12.00, the information in this book applies to an 86100D that is running in Legacy configuration. The instrument can also be operated in Standard configuration, in which case you must use the remote commands that are documented in the 86100D online help. Refer to the online help for information on the different 86100D configurations. IEEE 488.2 (SCPI) The programming syntax documented in this book conforms to the IEEE 488.2 Standard Digital Interface for Programmable Instrumentation and to the Standard Commands for Programmable Instruments (SCPI). For a listing of commands that are new or revised, refer to “New and Revised Commands” on page 9. If you are unfamiliar with programming instruments using the SCPI standard, refer to “Command Syntax” on page 16. For more detailed information regarding the GPIB, the IEEE 488.2 standard, or the SCPI standard, refer to the following books: • International Institute of Electrical and Electronics Engineers. IEEE Standard 488.1-1987, IEEE Standard Digital Interface for Programmable Instrumentation. New York, NY, 1987. • International Institute of Electrical and Electronics Engineers. IEEE Standard 488.2-1987, IEEE Standard Codes, Formats, Protocols and Common commands For Use with ANSI/IEEE Std 488.1-1987. New York, NY, 1987. You can configure the instrument and transfer data between the instrument and a computer using GPIB (General Purpose Interface Bus) connection or SICL/LAN connection (firmware revision A08.00 and above). 8 Programmer’s Guide Introduction 1 SICL/LAN Support The ability to control the instrument over SICL/LAN is a new feature introduced with revision A.08.00. For SICL/LAN support, use the Keysight IO Libraries Suite which is shipped on a disc with the instrument. This software includes the Keysight Connection Expert, which facilitates the sending of remote commands to the instrument by using a LAN device address. If you can not establish a LAN connection on the instrument, install the Keysight IO Libraries LAN patch. This patch is located on the instrument at C:\InfiniiumInstaller\AgtInstIoLanPatch.msi. An IP address can be substituted instead of using domain names. To create the device address within the Keysight Connection Expert, 1 Locate the instrument device address, which should look similar to the following examples: TCPIP0::10.0.0.5::inst0::INSTR TCPIP0::YourInstrument.YourDomain::inst0::INSTR 2 Right-click the instrument device address to view the shortcut menu and select Change Properties. 3 In the Advanced section, change the remote instrument name to gpib0,7. The device address should now be: TCPIP0::10.0.0.5::gpib0,7::INSTR After configuring the Keysight Connection Expert with the above steps, sending commands to the instrument changes the instrument from local mode into remote mode, which is similar to GPIB control. If, however, the device address inst0 is used instead of gpib0,7 the instrument will not change from local to the remote mode and some dialog boxes may be presented during the SICL/LAN session that requires front-panel operation. SICL/LAN support requires that two programs be unblocked by the instrument’s firewall. If you upgraded the instrument firmware versions A.07.00 and below to revision A.08.00 and above, you might be prompted by a firewall application to block the Keysight Remote I/O Port Mapper Utility and the Keysight Remote I/O Server. If you decide to allow the features to be blocked, then remote control of the DCA over SICL/LAN will not be possible. We recommend that you select Unblock on these features. However, if you block these features, you can always reconfigure the firewall at a later time to allow SICL/LAN. Some firewall applications might block an echo request (ping) from the Keysight Connection Expert version 15.0 and above. If a ping is blocked the "Instrument I/O on this PC" auto-detect function will not find the instrument even though it has been added and tested correctly under the Change Properties dialog box. To resolve this on the Microsoft Windows Firewall, refer to “To configure the firewall” on page 12. For more information on communicating with the instrument using the Keysight's IO Libraries Suite, refer to the book IO Libraries Suite Connectivity Guide with Getting Started. To upgrade instrument software After you have obtained the software upgrade file for your instrument, perform the following steps to install the upgrade. 1 Copy the software upgrade file to a USB Flash Drive, external USB CD-RW drive, LAN folder, or other device so that the file will be available to copy to the instrument. 2 On the instrument’s File menu, click Exit and then click Yes to exit the application. 3 On the Windows Start menu, click My Computer. 4 Select the D: drive and create a new folder. Give the new folder a meaningful name. For example, Software Upgrade. 5 Copy the upgrade file (.exe file extension) from an external memory device to your new folder. Programmer’s Guide 9 1 Introduction 6 Select the upgrade file to begin the installation. Click Next twice for the installation wizard to automatically uninstall the current version and install the newer version. 7 If you are prompted by a firewall application to block the Keysight Remote I/O Port Mapper Utility and the Keysight Remote I/O Server, select Unblock as shown in Figure 1 on page 10. See the introduction to this section for more information. 8 On the Windows desktop, double click the program icon to start the instrument. Figure 1 Example Windows Firewall Security Alerts To configure the firewall This procedure applies to instrument software revision A.08.00 and above. Although it describes the settings for the Windows Firewall, settings using a different firewall will be similar. These settings allow control of the instrument over SICL/LAN and allow the Keysight Connection Expert to locate the instrument. 1 On the instrument, click Help > About 86100C/D and confirm that software revision A.08.00 or above is installed. 2 Minimize the 86100C/D application to view the Windows desktop. 3 On the Start menu, click Control Panel. 4 If Category View is set, click Switch to Classic View. 5 Open Windows Firewall. 6 On the Exceptions tab, clear or select to unblock (allow) the Keysight Remote I/O Port Mapper Utility and the Keysight Remote I/O Server. These programs allow control of the instrument over SICL/LAN. If these utilities are not listed, click Add Program in the dialog box and add them using the following paths: Keysight Remote I/O Port Mapper Utility found at C:\Program Files\Keysight\IO Libraries Suite\bin\ portmap.exe Keysight Remote I/O Server found at C:\Program Files\Keysight\IO Libraries Suite\bin\siclland.exe 10 Programmer’s Guide Introduction Figure 2 1 86100C/D SICL/LAN Programs 7 On the Windows Firewall, click the Advanced tab. 8 Click ICMP to open the ICMP Settings dialog box. 9 Clear or select Allow incoming echo request. Selecting this feature allows the Keysight Connection Expert’s (version 15.0 and above) Instrument I/O on this PC to automatically find the instrument. Figure 3 Allow Incoming Echo Request Examples Throughout this book, BASIC and ANSI C are used in the examples of individual commands. If you are using other languages, you will need to find the equivalents of BASIC commands like OUTPUT, ENTER, and CLEAR, to convert the examples. The instrument’s GPIB address is configured at the factory to a value of 7. You must set the output and input functions of your programming language to send the commands to this address. You can change the GPIB address from the instrument’s front panel. Measurement Process Figure 4 is a instrument block diagram that shows where the measurements are made on the acquired data and when the post-signal processing is applied to the data. The diagram is laid out serially for a visual perception of how the data is affected by the instrument. Programmer’s Guide 11 1 Introduction Figure 4 Sample Data Processing The sample data is stored in the channel memory for further processing before being displayed. The time it takes for the sample data to be displayed depends on the number of post processes you have selected. Averaging your sampled data helps remove any unwanted noise from your waveform. You can store your sample data in the instrument’s waveform memories for use as one of the sources in Math functions or to visually compare against a waveform that is captured at a future time. The Math functions allow you to apply mathematical operations on your sampled data. You can use these functions to duplicate many of the mathematical operations that your circuit may be performing to verify that your circuit is operating correctly. The measurements section performs any of the automated measurements that are available in the instrument. The measurements that you have selected appear at the bottom of the display. The Connect Dots section draws a straight line between sample data points, giving an analog look to the waveform. This is sometimes called linear interpolation. 12 Programmer’s Guide Introduction 1 The Command Tree The command tree refers to the relationship of the commands to each other. The IEEE 488.2 common commands do not affect the position of the parser within the tree. A leading colon or a program message terminator (or EOI true on the last byte) places the parser at the root of the command tree. A leading colon is a colon that is the first character of a program header. Executing a subsystem command places you in that subsystem until a leading colon or a program message terminator is found. The commands in this instrument can be placed into three types: common commands, root level commands, and subsystem commands. • Common commands (defined by IEEE 488.2) control functions that are common to all IEEE 488.2 instruments. These commands are independent of the tree and do not affect the position of the parser within the tree. *RST is an example of a common command. • Root level commands control many of the basic functions of the instrument. These commands reside at the root of the command tree. They can always be parsed if they occur at the beginning of a program message or are preceded by a colon. Unlike common commands, root level commands place the parser back at the root of the command tree. AUTOSCALE is an example of a root level command. • Subsystem commands are grouped together under a common node of the command tree, such as the TIMEBASE commands. Only one subsystem may be selected at a given time. When the instrument is initially turned on, the command parser is set to the root of the command tree and no subsystem is selected. Command headers are created by traversing down the command tree. A legal command header from the command tree would be :TIMEBASE:RANGE. It consists of the subsystem followed by a command separated by colons. The compound header contains no spaces. In the command tree, use the last mnemonic in the compound header as a reference point (for example, RANGE). Then find the last colon above that mnemonic (TIMEBASE:). That is the point where the parser resides. Any command below this point can be sent within the current program message without sending the mnemonics which appear above them (for example, REFERENCE). Use a colon to separate two commands in the same subsystem. OUTPUT 707;":CHANNEL1:RANGE 0.5;OFFSET 0" The colon between CHANNEL1 and RANGE is necessary because CHANNEL1:RANGE specifies a command in a subsystem. The semicolon between the RANGE command and the OFFSET command is required to separate the two commands. The OFFSET command does not need CHANNEL1 preceding it because the CHANNEL1:RANGE command sets the parser to the CHANNEL1 node in the tree. Programmer’s Guide 13 1 Introduction Command Syntax In accordance with IEEE 488.2, the instrument’s commands are grouped into “subsystems.” Commands in each subsystem perform similar tasks. Starting with Chapter 5, “System Commands" each chapter covers a separate subsystem. Sending a Command It’s easy to send a command to the instrument. Simply create a command string from the commands listed in this book, and place the string in your program language’s output statement. For commands other than common commands, include a colon before the subsystem name. For example, the following string places the cursor on the peak laser line and returns the power level of this peak: OUTPUT 720;”:MEAS:SCAL:POW? MAX” Commands can be sent using any combination of uppercase or lowercase ASCII characters. Instrument responses, however, are always returned in uppercase. The program instructions within a data message are executed after the program message terminator is received. The terminator may be either a NL (new line) character, an EOI (End-Or-Identify) asserted in the GPIB interface, or a combination of the two. Asserting the EOI sets the EOI control line low on the last byte of the data message. The NL character is an ASCII linefeed (decimal 10). The NL (New Line) terminator has the same function as an EOS (End Of String) and EOT (End Of Text) terminator. Short or Long Forms Commands and queries may be sent in either long form (complete spelling) or short form (abbreviated spelling). The description of each command in this manual shows both versions; the extra characters for the long form are shown in lowercase. However, commands can be sent using any combination of uppercase or lowercase ASCII characters. Instrument responses, however, are always returned in uppercase. Programs written in long form are easily read and are almost self-documenting. Using short form commands conserves the amount of controller memory needed for program storage and reduces the amount of I/O activity. The short form is the first four characters of the keyword, unless the fourth character is a vowel. Then the mnemonic is the first three characters of the keyword. If the length of the keyword is four characters or less, this rule does not apply, and the short form is the same as the long form. For example: :TIMEBASE:DELAY 1E-6 is the long form. :TIM:DEL 1E-6 is the short form. . Table 3 14 Long and Short Command Forms Long Form Short Form How the Rule is Applied RANGE RANG Short form is the first four characters of the keyword. PATTERN PATT Short form is the first four characters of the keyword. DISK DISK Short form is the same as the long form. DELAY DEL Fourth character is a vowel, short form is the first three characters. Programmer’s Guide 1 Introduction White Space White space is defined to be one or more characters from the ASCII set of 0 through 32 decimal, excluding 10 (NL). White space is usually optional, and can be used to increase the readability of a program. Combining Commands You can combine commands from the same subsystem provided that they are both on the same level in the subsystem’s hierarchy. Simply separate the commands with a semi-colon (;). If you have selected a subsystem, and a common command is received by the instrument, the instrument remains in the selected subsystem. For example, the following commands turn averaging on, then clears the status information without leaving the selected subsystem. ":ACQUIRE:AVERAGE ON;*CLS;COUNT 1024" You can send commands and program queries from different subsystems on the same line. Simply precede the new subsystem by a semicolon followed by a colon. Multiple commands may be any combination of compound and simple commands. For example: :CHANNEL1:RANGE 0.4;:TIMEBASE:RANGE 1 Adding parameters to a command Many commands have parameters that specify an option. Use a space character to separate the parameter from the command as shown in the following line: OUTPUT 720;”:INIT:CONT ON” Separate multiple parameters with a comma (,). Spaces can be added around the commas to improve readability. OUTPUT 720;”:MEAS:SCAL:POW:FREQ? 1300, MAX” String Arguments Strings contain groups of alphanumeric characters which are treated as a unit of data by the instrument. You may delimit embedded strings with either single (') or double (") quotation marks. These strings are case-sensitive, and spaces act as legal characters just like any other character. For example, this command writes the line string argument to the instrument’s advisory line: :SYSTEM:DSP ""This is a message."" Numbers Some commands require number arguments. All numbers are expected to be strings of ASCII characters. You can use exponential notation or suffix multipliers to indicate the numeric value. The following numbers are all equal: 28 = 0.28E2 = 280E-1 = 28000m = 0.028K = 28E-3K When a syntax definition specifies that a number is an integer, any fractional part is ignored and truncated. Using "mV" or "V" following the numeric voltage value in some commands will cause Error 138–Suffix not allowed. Instead, use the convention for the suffix multiplier. . Table 4 Programmer’s Guide Value Mnemonic Value Mnemonic 1E18 EX 1E-3 m 1E15 PE 1E-6 u 1E12 T 1E-9 n 1E9 G 1E-12 p 15 1 Introduction Table 4 Value Mnemonic Value Mnemonic 1E6 MA 1E-15 f 1E3 K 1E-18 a Table 5 Suffix Referenced Unit V Volt s Second W Watt BIT Bits dB Decibel % Percent Hz Hertz Infinity Representation The representation for infinity for this instrument is 9.99999E+37. This is also the value returned when a measurement cannot be made. Sequential and Overlapped Commands IEEE 488.2 makes a distinction between sequential and overlapped commands. Sequential commands finish their task before the execution of the next command starts. Overlapped commands run concurrently. Commands following an overlapped command may be started before the overlapped command is completed. The common commands *WAI and *OPC may be used to ensure that commands are completely processed before subsequent commands are executed. 16 Programmer’s Guide 1 Introduction Queries Command headers immediately followed by a question mark (?) are queries. After receiving a query, the instrument interrogates the requested subsystem and places the answer in its output queue. The answer remains in the output queue until it is read or until another command is issued. When read, the answer is transmitted across the bus to the designated listener (typically a computer). For example, the query: :TIMEBASE:RANGE? places the current time base setting in the output queue. In BASIC, the computer input statement: ENTER < device address >;Range passes the value across the bus to the computer and places it in the variable Range. You can use query commands to find out how the instrument is currently configured. They are also used to get results of measurements made by the instrument. For example, the command: :MEASURE:RISETIME? tells the instrument to measure the rise time of your waveform and place the result in the output queue. The output queue must be read before the next program message is sent. For example, when you send the query :MEASURE:RISETIME? you must follow it with an input statement. In BASIC, this is usually done with an ENTER statement immediately followed by a variable name. This statement reads the result of the query and places the result in a specified variable. If you send another command or query before reading the result of a query, the output buffer is cleared and the current response is lost. This also generates a query-interrupted error in the error queue. If you execute an input statement before you send a query, it will cause the computer to wait indefinitely. If a measurement cannot be made because of the lack of data, because the source signal is not displayed, the requested measurement is not possible (for example, a period measurement on an FFT waveform), or for some other reason, 9.99999E+37 is returned as the measurement result. In TDR mode with ohms specified, the returned value is 838 MW. You can send multiple queries to the instrument within a single program message, but you must also read them back within a single program message. This can be accomplished by either reading them back into a string variable or into multiple numeric variables. For example, you could read the result of the query :TIMEBASE:RANGE?;DELAY? into the string variable Results$ with the command: ENTER 707;Results$ When you read the result of multiple queries into string variables, each response is separated by a semicolon. For example, the response of the query :TIMEBASE:RANGE?;DELAY? would be: ; Use the following program message to read the query :TIMEBASE:RANGE?;DELAY? into multiple numeric variables: ENTER 707;Result1,Result2 Definite-Length Block Response Data Definite-length block response data allows any type of device-dependent data to be transmitted over the system interface as a series of 8-bit binary data bytes. This is particularly useful for sending large quantities of data or 8-bit extended ASCII codes. The syntax is a pound sign (#) followed by a non-zero digit representing the number of digits in the decimal integer. After the non-zero digit is the decimal integer that states the number of 8-bit data bytes being sent. This is followed by the actual data. For example, for transmitting 4000 bytes of data, the syntax would be: #44000 <4000 bytes of data> Programmer’s Guide 17 1 Introduction The leftmost “4” represents the number of digits in the number of bytes, and “4000” represents the number of bytes to be transmitted. Byte order can affect the ability of your programs to correctly interpret block data. The byte order, or endianness, of returned block data differs between the Waveform and Measure subsystems. By default, the Waveform subsystem queries return block data in MSB (Most Significant Byte) first format. If needed, you can change the order to LSB (Least Significant Byte) first using the command “BYTeorder" on page 9. The following Measure sybsystem queries return block data in LSB first format: :MEASure:AMPLitutde:ISIVsbit? :MEASure:AMPLitutde:ISIVsbit:BITS? :MEASure:JITTer:DDJVsbit? :MEASure:JITTer:DDJVsbit:BITS? :MEASure:JITTer:EBITs? :MEASure:JITTer:PATTern? :MEASure:SINTegrity:PATTern? Be aware that the Keysight IO Libraries Suite, by default, interprets received block data as MSB first format and there is no Measure subsystem command to change the byte order to LSB. When using these Measure subsystem queries, you must change the byte order received from MSB to LSB. For example, you could do one of the following: 18 • Open Keysight VEE’s Advanced Instrument Properties dialog box, select the General tab, and change the byte order setting. However, using this method results in incorrect Waveform queries. • Write a function to change the byte order in your program. • Use a function already available in your authoring tool such as provided in Microsoft Excel. Programmer’s Guide Introduction 1 Starting a Program The commands and syntax for initializing the instrument are listed in Chapter 3, “Common Commands". Refer to your GPIB manual and programming language reference manual for information on initializing the interface. To make sure the bus and all appropriate interfaces are in a known state, begin every program with an initialization statement. For example, BASIC provides a CLEAR command which clears the interface buffer. When you are using GPIB, CLEAR also resets the instrument's parser. After clearing the interface, initialize the instrument to a preset state using the *RST command. The AUTOSCALE command is very useful on unknown waveforms. It automatically sets up the vertical channel, time base, and trigger level of the instrument. A typical instrument setup configures the vertical range and offset voltage, the horizontal range, delay time, delay reference, trigger mode, trigger level, and slope. An example of the commands sent to the instrument are: :CHANNEL1:RANGE 16;OFFSET 1.00 :SYSTEM:HEADER OFF :TIMEBASE:RANGE 1E-3;DELAY 100E-6 This example sets the time base at 1 ms full-scale (100 ms/div), with delay of 100 ms. Vertical is set to 16V full-scale (2 V/div), with center of screen at 1V, and probe attenuation of 10. The following program demonstrates the basic command structure used to program the instrument. 10 CLEAR 707 ! Initialize instrument interface 20 OUTPUT 707;"*RST" !Initialize instrument to preset state 30 OUTPUT 707;":TIMEBASE:RANGE 5E-4"! Time base to 500 us full scale 40 OUTPUT 707;":TIMEBASE:DELAY 25E-9"! Delay to 25 ns 50 OUTPUT 707;":TIMEBASE:REFERENCE CENTER"! Display reference at center 60 OUTPUT 707;":CHANNEL1:RANGE .16"! Vertical range to 160 mV full scale 70 OUTPUT 707;":CHANNEL1:OFFSET -.04"! Offset to -40 mV 80 OUTPUT 707;":TRIGGER:LEVEL,-.4"! Trigger level to -0.4 90 OUTPUT 707;":TRIGGER:SLOPE POSITIVE"! Trigger on positive slope 100OUTPUT 707;":SYSTEM:HEADER OFF" 110OUTPUT 707;":DISPLAY:GRATICULE FRAME"! Grid off 120END • Line 10 initializes the instrument interface to a known state and Line 20 initializes the instrument to a preset state. • Lines 30 through 50 set the time base, the horizontal time at 500 ms full scale, and 25 ns of delay referenced at the center of the graticule. • Lines 60 through 70 set the vertical range to 160 mV full scale and the center screen at -40 mV. • Lines 80 through 90 configure the instrument to trigger at -0.4 volts with normal triggering. • Line 100 turns system headers off. • Line 110 turns the grid off. The DIGITIZE command is a macro that captures data using the acquisition (ACQUIRE) subsystem. When the digitize process is complete, the acquisition is stopped. The captured data can then be measured by the instrument or transferred to the computer for further analysis. The captured data consists of two parts: the preamble and the waveform data record. After changing the instrument configuration, the waveform buffers are cleared. Before doing a measurement, the DIGITIZE command should be sent to ensure new data has been collected. You can send the DIGITIZE command with no parameters for a higher throughput. Refer to the DIGITIZE command in Chapter 4, “Root Level Commands" for details. When the DIGITIZE command is sent to an instrument, the specified channel’s waveform is digitized with the current ACQUIRE parameters. Before sending the Programmer’s Guide 19 1 Introduction :WAVEFORM:DATA? query to get waveform data, specify the WAVEFORM parameters. The number of data points comprising a waveform varies according to the number requested in the ACQUIRE subsystem. The ACQUIRE subsystem determines the number of data points, type of acquisition, and number of averages used by the DIGITIZE command. This allows you to specify exactly what the digitized information contains. The following program example shows a typical setup: OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT 707;":SYSTEM:HEADER OFF" 707;":WAVEFORM:SOURCE CHANNEL1" 707;":WAVEFORM:FORMAT BYTE" 707;":ACQUIRE:COUNT 8" 707;":ACQUIRE:POINTS 500" 707;":DIGITIZE CHANNEL1" 707;":WAVEFORM:DATA?" This setup places the instrument to acquire eight averages. This means that when the DIGITIZE command is received, the command will execute until the waveform has been averaged at least eight times. After receiving the :WAVEFORM:DATA? query, the instrument will start passing the waveform information when queried. Digitized waveforms are passed from the instrument to the computer by sending a numerical representation of each digitized point. The format of the numerical representation is controlled with the :WAVEFORM:FORMAT command and may be selected as BYTE, WORD, or ASCII. The easiest method of entering a digitized waveform depends on data structures, available formatting, and I/O capabilities. You must scale the integers to determine the voltage value of each point. These integers are passed starting with the leftmost point on the instrument's display. For more information, refer to Chapter 26, “Waveform Commands". When using GPIB, a digitize operation may be aborted by sending a Device Clear over the bus (for example, CLEAR 707). NOTE 20 The execution of the DIGITIZE command is subordinate to the status of ongoing limit tests. (See commands ACQuire:RUNTil on page 126, MTEST:RUNTil on page 225, and LTEST:RUNTil on page 205.) The DIGITIZE command will not capture data if the stop condition for a limit test has been met. Programmer’s Guide 1 Introduction Multiple Databases Eye/Mask measurements are based on statistical data that is acquired and stored in the color grade/gray scale database. The color grade/gray scale database consists of all data samples displayed on the display graticule. The measurement algorithms are dependent upon histograms derived from the database. This database is internal to the instrument’s applications. The color grade/gray scale database cannot be imported into an external database application. If you want to perform an eye measurement, it is necessary that you first produce an eye diagram by triggering the instrument with a synchronous clock signal. Measurements made on a pulse waveform while in Eye/Mask mode will fail. Firmware revision A.03.00 and later allows for multiple color grade/gray scale databases to be acquired and displayed simultaneously, including • all four instrument channels • all four math functions • one saved color grade/gray scale file The ability to use multiple databases allows for the comparison of • channels to each other • channels to a saved color grade/gray scale file • functions to the channel data on which it is based The advantage of acquiring and displaying channels and functions simultaneously is test times are greatly reduced. For example, the time taken to acquire two channels in parallel is approximately the same time taken to acquire a single channel. Using Multiple Databases in Remote Programs Most commands that control histograms, mask tests, or color grade data have additional optional parameters that were not available in firmware revisions prior to A.03.00. You can use the commands to control a single channel or add the argument APPend to enable more than one channel. The following example illustrates two uses of the CHANnel :DISPlay command. SYSTem:MODE EYE CHANnel1:DISPlay ON CHANnel2:DISPlay ON The result using the above set of commands, is Channel 1 cleared and disabled while Channel 2 is enabled and displayed. However, by adding the argument APPend to the last command of the set, both Channels 1 and 2 will be enabled and displayed . SYSTem:MODE EYE CHANnel1:DISPlay ON CHANnel2:DISPlay ON,APPend For a example of using multiple databases, refer to “Multi-Database Example” on page 21. Downloading a Database The general process for downloading a color grade/gray scale database is as follows: 1 Send the command :WAVEFORM:SOURCE CGRADE. This will select the color grade/gray scale database as the waveform source. 2 Issue :WAVeform:FORMat WORD. Database downloads only support word formatted data (16-bit integers). 3 Send the query :WAVeform:DATA? The data will be sent by means of a block data transfer as a two-dimensional array, 451 words wide by 321 words high (refer to “Definite-Length Block Programmer’s Guide 21 1 Introduction Response Data” on page 21). The data is transferred starting with the upper left pixel of the display graticule, column by column, until the lower right pixel is transferred. 4 Send the command :WAVeform:XORigin to obtain the time of the left column. 5 Send the command :WAVeform:XINC to obtain the time increment of each column. 6 Send the command :WAVeform:YORigin to obtain the voltage or power of the vertical center of the database. 7 Send the command :WAVeform:YORigin to obtain the voltage or power of the incremental row. The information from steps 4 through 7 can also be obtained with the command :WAVeform:PREamble. Auto Skew Another multiple database feature is the auto skew. You can use the auto skew feature to set the horizontal skew of multiple, active channels with the same bit rate, so that the waveform crossings align with each other. This can be very convenient when viewing multiple eye diagrams simultaneously. Slight differences between channels and test devices may cause a phase difference between channels. Auto skew ensures that each eye is properly aligned, so that measurements and mask tests can be properly executed. In addition, auto skew optimizes the instrument trigger level. Prior to auto skew, at least one channel must display a complete eye diagram in order to make the initial bit rate measurement. Auto skew requires more data to be sampled; therefore, acquisition time during auto skew is slightly longer than acquisition time during measurements. 22 Programmer’s Guide Introduction 1 Files When specifying a file name in a remote command, enclose the name in double quotation marks, such as "filename". If you specify a path, the path should be included in the quotation marks. All files stored using remote commands have file name extensions as listed in Table 6. You can use the full path name, a relative path name, or no path. If you do not specify an extension when storing a file, or specify an incorrect extension, it will be corrected automatically according to the following rules: • No extension specified: add the extension for the file type. • Extension does not match file type: retain the filename, (including the current extension) and add the appropriate extension. You do not need to use an extension when loading a file if you use the optional destination parameter. For example, :DISK:LOAD "STM1_OC3",SMASK automatically adds .msk to the file name. ASCII waveform files can be loaded only if the file name explicitly includes the .txt extension. Table 7 on page 24 shows the rules used when loading a specified file. If you don’t specify a directory when storing a file, the location of the file will be based on the file type. Table 8 on page 24 shows the default locations for storing files. On 86100C/D instruments, files are stored on the D: drive. On 86100A/B instruments, files are stored on the C: drive. When loading a file, you can specify the full path name, a relative path name, or no path name. Table 9 on page 25 lists the rules for locating files, based on the path specified. Standard masks loaded from D:\Scope\masks. Files may be stored to or loaded from any path external drive or on any mapped network drive. Programmer’s Guide 23 1 Introduction Table 6 File Name Extensions File Type File Name Extension Command Waveform - internal format .wfm “STORe" on page 19 Waveform - text format (Verbose, XY Verbose, or Y values) .txt “STORe" on page 19 Pattern Waveform .csv “PWAVeform:SAVE" on page 14 Setup .set “STORe" on page 19 Color grade - Gray Scale .cgs “STORe" on page 19 Jitter Memory .jd “STORe" on page 19 Screen image * .bmp, .eps, .gif, .pcx, .ps, .jpg, .tif “SIMage" on page 15 Mask .msk, .pcm “SAVE" on page 17 TDR/TDT .tdr “STORe" on page 19 MATLAB script .m “MATLab:SCRipt" on page 13 S-Parameter (Touchstone format) .s1p, .s2p, .s4p “SPARameter:SAVE" on page 17 S-Parameter (text format) .txt “SPARameter:SAVE" on page 17 *For .gif and .tif file formats, this instrument uses LZW compression/decompression licensed under U.S. patent No 4,558,302 and foreign counterparts. End user should not modify, copy, or distribute LZW compression/decompression capability. For .jpg file format, this instrument uses the .jpg software written by the Independent JPEG Group. Table 7 Rules for Loading Files File Name Extension Destination Rule No extension Not specified Default to internal waveform format; add .wfm extension Extension does not match file type Not specified Default to internal waveform format; add .wfm extension Extension matches file type Not specified Use file name with no alterations; destination is based on extension file type No extension Specified Add extension for destination type; default for waveforms is internal format (.wfm) Extension does not match destination file type Specified Retain file name; add extension for destination type. Default for waveforms is internal format (.wfm) Extension matches destination file type Specified Retain file name; destination is as specified Table 8 Default File Locations File Type Defaul t Location Waveform - internal format, text format (Verbose, XY Verbose, or Y values), D:\User Files\waveforms Pattern Waveforms D:\User Files\waveforms 24 Programmer’s Guide Introduction Table 8 Default File Locations (continued) File Type Defaul t Location Setup D:\User Files\setups Color Grade - Gray Scale D:\User Files\colorgrade-grayscale Jitter Memory D:\User Files\jitter data Screen Image D:\User Files\screen images Mask C:\Scope\masks (standard masks) D:\User Files\masks (user-defined masks) TDR/TDT calibration data (software revision A.05.00 and below) D:\User Files\TDR normalization TDR/TDT calibration data (software revision A.06.00 and above) D:\User Files\TDR calibration MATLAB script D:\User Files\MATLAB scripts S-Parameters D:\User Files\S-parameter data Table 9 1 File Locations (Loading Files) File Name Rule Full path name Use file name and path specified Relative path name Full path name is formed relative to the present working directory, set with the command :DISK:CDIR. The present working directory can be read with the query :DISK:PWD? File name with no preceding path Add the file name to the default path (D:\User Files) based on the file type. (C drive on 86100A/B instruments.) Programmer’s Guide 25 1 Introduction Status Reporting Almost every program that you write will need to monitor the instrument for its operating status. This includes querying execution or command errors and determining whether or not measurements have been completed. Several status registers and queues are provided to accomplish these tasks. In this section, you’ll learn how to enable and read these registers. • Refer to Figure 5 on page 27 for an overall status reporting decision chart. • See Figure 6 and Figure 7 to learn the instrument's status reporting structure which allows you to monitor specific events in the instrument. • Table 10 on page 32 lists the bit definitions for each bit in the status reporting data structure. The Status Byte Register, the Standard Event Status Register group, and the Output Queue are defined as the Standard Status Data Structure Model in IEEE 488.2-1987. IEEE 488.2 defines data structures, commands, and common bit definitions for status reporting. There are also instrument-defined structures and bits. To monitor an event, first clear the event, then enable the event. All of the events are cleared when you initialize the instrument. To generate a service request (SRQ) interrupt to an external computer, enable at least one bit in the Status Byte Register. To make it possible for any of the Standard Event Status Register bits to generate a summary bit, the corresponding bits must be enabled. These bits are enabled by using the *ESE common command to set the corresponding bit in the Standard Event Status Enable Register. To generate a service request (SRQ) interrupt to the computer, at least one bit in the Status Byte Register must be enabled. These bits are enabled by using the *SRE common command to set the corresponding bit in the Service Request Enable Register. These enabled bits can then set RQS and MSS (bit 6) in the Status Byte Register. For more information about common commands, see Chapter 3, “Common Commands". Status Byte Register The Status Byte Register is the summary-level register in the status reporting structure. It contains summary bits that monitor activity in the other status registers and queues. The Status Byte Register is a live register. That is, its summary bits are set and cleared by the presence and absence of a summary bit from other event registers or queues. If the Status Byte Register is to be used with the Service Request Enable Register to set bit 6 (RQS/MSS) and to generate an SRQ, at least one of the summary bits must be enabled, then set. Also, event bits in all other status registers must be specifically enabled to generate the summary bit that sets the associated summary bit in the Status Byte Register. The Status Byte Register can be read using either the *STB? common command query or the GPIB serial poll command. Both commands return the decimal-weighted sum of all set bits in the register. The difference between the two methods is that the serial poll command reads bit 6 as the Request Service (RQS) bit and clears the bit which clears the SRQ interrupt. The *STB? query reads bit 6 as the Master Summary Status (MSS) and does not clear the bit or have any affect on the SRQ interrupt. The value returned is the total bit weights of all of the bits that are set at the present time. 26 Programmer’s Guide Introduction Figure 5 1 Status Reporting Decision Chart The use of bit 6 can be confusing. This bit was defined to cover all possible computer interfaces, including a computer that could not do a serial poll. The important point to remember is that, if you are using an SRQ interrupt to an external computer, the serial poll command clears bit 6. Clearing bit 6 allows the instrument to generate another SRQ interrupt when another enabled event occurs. The only other bit in the Status Byte Register affected by the *STB? query is the Message Available bit (bit 4). If there are no other messages in the Output Queue, bit 4 (MAV) can be cleared as a result of reading the response to the *STB? query. Programmer’s Guide 27 1 Introduction If bit 4 (weight = 16) and bit 5 (weight = 32) are set, a program would print the sum of the two weights. Since these bits were not enabled to generate an SRQ, bit 6 (weight = 64) is not set. Figure 6 28 Status Reporting Overview Programmer’s Guide Introduction Figure 7 Programmer’s Guide 1 Status Reporting Data Structures 29 1 Introduction Status Reporting Data Structures (continued) This BASIC example uses the *STB? query to read the contents of the instrument’s Status Byte Register when none of the register's summary bits are enabled to generate an SRQ interrupt. 10 20 30 40 OUTPUT 707;":SYSTEM:HEADER OFF;*STB?"!Turn headers off ENTER 707;Result!Place result in a numeric variable PRINT Result!Print the result End The next program prints 132 and clears bit 6 (RQS) of the Status Byte Register. The difference in the decimal value between this example and the previous one is the value of bit 6 (weight = 64). Bit 6 is set when the first enabled summary bit is set, and is cleared when the Status Byte Register is read by the serial poll command. 30 Programmer’s Guide 1 Introduction This example uses the BASIC serial poll (SPOLL) command to read the contents of the instrument’s Status Byte Register. 10 Result = SPOLL(707) 20 PRINT Result 30 END Use Serial Polling to Read the Status Byte Register. Serial polling is the preferred method to read the contents of the Status Byte Register because it resets bit 6 and allows the next enabled event that occurs to generate a new SRQ interrupt. Service Request Enable Register Setting the Service Request Enable Register bits enables corresponding bits in the Status Byte Register. These enabled bits can then set RQS and MSS (bit 6) in the Status Byte Register. Bits are set in the Service Request Enable Register using the *SRE command, and the bits that are set are read with the *SRE? query. Bit 6 always returns 0. Refer to the Status Reporting Data Structures shown in Figure 7 on page 29. This example sets bit 4 (MAV) and bit 5 (ESB) in the Service Request Enable Register. OUTPUT 707;"*SRE 48" This example uses the parameter “48” to allow the instrument to generate an SRQ interrupt under the following conditions: • When one or more bytes in the Output Queue set bit 4 (MAV). • When an enabled event in the Standard Event Status Register generates a summary bit that sets bit 5 (ESB). Trigger Event Register (TRG) This register sets the TRG bit in the status byte when a trigger event occurs. The TRG event register stays set until it is cleared by reading the register or using the *CLS (clear status) command. If your application needs to detect multiple triggers, the TRG event register must be cleared after each one. If you are using the Service Request to interrupt a computer operation when the trigger bit is set, you must clear the event register after each time it is set. Programmer’s Guide 31 1 Introduction Table 10 Status Reporting Bit Definition (Sheet 1 of 2) Bit Description Definition ACQ Acquisition Indicates that acquisition test has completed in the Acquisition Register. AREQD Autoscale Required Indicates that a parameter change in Jitter Mode has made an autoscale necessary. CLCK CloCk Indicates that one of the enabled conditions in the Clock Recovery Register has occurred. CME Command Error Indicates if the parser detected an error. COMP Complete Indicates the specified test has completed. DDE Device Dependent Error Indicates if the device was unable to complete an operation for device dependent reasons. EFAIL Edge Characterization Fail Indicates that the characterizing of edges in Jitter Mode has failed. ESB Event Status Bit Indicates if any of the enabled conditions in the Standard Event Status Register have occurred. EXE Execution Error Indicates if a parameter was out of range or was inconsistent with the current settings. FAIL Fail Indicates the specified test has failed. FIN Finished Indicates that a clock recovery relock operation has completed. JLOSS Pattern Synchronization Loss Indicates that the pattern synchronization is lost in Jitter Mode. LCL Local Indicates if a remote-to-local transition occurs. LOCK LOCKed Indicates that a locked or trigger capture condition has occurred in the Clock Recovery Module. LOSS Time Reference Loss Indicates the Precision Timebase (provided by the Keysight 86107A module) has detected a time reference loss due to a change in the reference clock signal. LTEST Limit Test Indicates that one of the enabled conditions in the Limit Test Register has occurred. MAV Message Available Indicates if there is a response in the output queue. MSG Message Indicates if an advisory has been displayed. MSS Master Summary Status Indicates if a device has a reason for requesting service. MTEST Mask Test Indicates that one of the enabled conditions in the Mask Test Register has occurred. NSPR1 No Signal Present Receiver 1 Indicates that the Clock Recovery Module has detected the loss of an optical signal on receiver one. NSPR2 No Signal Present Receiver 2 Indicates that the Clock Recovery Module has detected the loss of an optical signal on receiver two. OPC Operation Complete Indicates if the device has completed all pending operations. OPER Operation Status Register Indicates if any of the enabled conditions in the Operation Status Register have occurred. PON Power On Indicates power is turned on. PTIME Precision Timebase Indicates that one of the enabled conditions in the Precision Timebase Register has occurred. QYE Query Error Indicates if the protocol for queries has been violated. RQL Request Control Indicates if the device is requesting control. 32 Programmer’s Guide Introduction Table 10 Status Reporting Bit Definition (Sheet 2 of 2) Bit Description Definition RQS Request Service Indicates that the device is requesting service. SPR1 Signal Present Receiver 1 Indicates that the Clock Recovery Module has detected an optical signal on receiver one. SPR2 Signal Present Receiver 2 Indicates that the Clock Recovery Module has detected an optical signal on receiver two. TRG Trigger Indicates if a trigger has been received. UNLK UNLoCKed Indicates that an unlocked or trigger loss condition has occurred in the Clock Recovery Module. URQ USR 1 Not used. Permanently set to zero. User Event Register Indicates if any of the enabled conditions have occurred in the User Event Register. Standard Event Status Register The Standard Event Status Register (SESR) monitors the following instrument status events: • PON - Power On • CME - Command Error • EXE - Execution Error • DDE - Device Dependent Error • QYE - Query Error • RQC - Request Control • OPC - Operation Complete When one of these events occurs, the corresponding bit is set in the register. If the corresponding bit is also enabled in the Standard Event Status Enable Register, a summary bit (ESB) in the Status Byte Register is set. The contents of the Standard Event Status Register can be read and the register cleared by sending the *ESR? query. The value returned is the total bit weights of all of the bits set at the present time. If bit 4 (weight = 16) and bit 5 (weight = 32) are set, the program prints the sum of the two weights. This example uses the *ESR? query to read the contents of the Standard Event Status Register. 10 20 30 40 50 OUTPUT 707;":SYSTEM:HEADER OFF"!Turn headers off OUTPUT 707;"*ESR?" ENTER 707;Result!Place result in a numeric variable PRINT Result!Print the result End Standard Event Status Enable Register For any of the Standard Event Status Register (SESR) bits to generate a summary bit, you must first enable the bit. Use the *ESE (Event Status Enable) common command to set the corresponding bit in the Standard Event Status Enable Register. Set bits are read with the *ESE? query. Suppose your application requires an interrupt whenever any type of error occurs. The error status bits in the Standard Event Status Register are bits 2 through 5. The sum of the decimal weights of these bits is 60. Therefore, you can enable any of these bits to generate the summary bit by sending: OUTPUT 707;"*ESE 60" Whenever an error occurs, the instrument sets one of these bits in the Standard Event Status Register. Because the bits are all enabled, a summary bit is generated to set bit 5 (ESB) in the Status Byte Register. If bit 5 (ESB) in the Status Byte Register is enabled (via the *SRE command), a service request interrupt (SRQ) is sent to the external computer. Programmer’s Guide 33 1 Introduction NOTE Disabled SESR Bits Respond, but Do Not Generate a Summary Bit. Standard Event Status Register bits that are not enabled still respond to their corresponding conditions (that is, they are set if the corresponding event occurs). However, because they are not enabled, they do not generate a summary bit in the Status Byte Register. User Event Register (UER) This register hosts the LCL bit (bit 0) from the Local Events Register. The other 15 bits are reserved. You can read and clear this register using the UER? query. This register is enabled with the UEE command. For example, if you want to enable the LCL bit, you send a mask value of 1 with the UEE command; otherwise, send a mask value of 0. Local Event Register (LCL) This register sets the LCL bit in the User Event Register and the USR bit (bit 1) in the Status byte. It indicates a remote-to-local transition has occurred. The LER? query is used to read and to clear this register. Operation Status Register (OPR) This register hosts the CLCK bit (bit 7), the LTEST bit (bit 8), the ACQ bit (bit 9) and the MTEST bit (bit 10). The CLCK bit is set when any of the enabled conditions in the Clock Recovery Event Register have occurred. The LTEST bit is set when a limit test fails or is completed and sets the corresponding FAIL or COMP bit in the Limit Test Events Register. The ACQ bit is set when the COMP bit is set in the Acquisition Event Register, indicating that the data acquisition has satisfied the specified completion criteria. The MTEST bit is set when the Mask Test either fails specified conditions or satisfies its completion criteria, setting the corresponding FAIl or COMP bits in the Mask Test Events Register. The PTIME bit is set when there is a loss of the precision timebase reference occurs setting a bit in the Precision Timebase Events Register. The JIT bit is set in Jitter Mode when a bit is set in the Jitter Events Register. This occurs when there is a failure or an autoscale is needed. If any of these bits are set, the OPER bit (bit 7) of the Status Byte register is set. The Operation Status Register is read and cleared with the OPER? query. The register output is enabled or disabled using the mask value supplied with the OPEE command. Acquisition Event Register (AER) Bit 0 (COMP) of the Acquisition Event Register is set when the acquisition limits complete. The Acquisition completion criteria are set by the ACQuire:RUNtil command. Refer to “RUNTil” on page 13. The Acquisition Event Register is read and cleared with the ALER? query. Refer to “ALER?” on page 9. Clock Recovery Event Register (CRER) This register hosts the UNLK bit (bit 0), LOCK bit (bit 1), NSPR1 bit (bit 2), SPR1 bit (bit 3), NSPR2 bit (bit 4) and SPR2 (bit 5). Bit 0 (UNLK) of the Clock Recovery Event Register is set when an 83491/2/3/4/5/6A clock recovery module becomes unlocked or trigger loss has occurred. Bit 1 (LOCK) of the Clock Recovery Event Register is set when a clock recovery module becomes locked or a trigger capture has occurred. If an 83496A module is locked, sending the CRECovery:RELock command does not set UNLK bit (bit 0) or LOCK bit (bit 1). To determine if the RELock command has completed, use the CRECovery:LOCKed? query. Refer to “RELock" on page 23. Bits 2 through 5 are valid only for modules that support the :SPResent command (refer to Table 28 on page 152 and “SPResent?" on page 24), which includes the 83491/2/3/4A and 86108A/B modules. Since these bits provide information on optical signals they are not effected by 83495/6A modules. Bit 2 (NSPR1) of the Clock Recovery Event Register is set when an clock recovery module transitions to no longer detecting an optical signal on receiver one. Bit 3 (SPR1) of the Clock Recovery Event Register is set when an clock recovery module transitions to detecting an optical signal on receiver one. Bit 4 (NSPR2) of the Clock Recovery Event Register is set when an clock recovery module transitions to no longer detecting an optical signal on receiver two. Bit 5 (SPR2) of 34 Programmer’s Guide Introduction 1 the Clock Recovery Event Register is set when an clock recovery module transitions to detecting an optical signal on receiver two. The Clock Recovery Event Register is read and cleared with the CRER? query. Refer to “CRER?” on page 13. When either of the UNLK, LOCK, NSPR1, SPR1, NSPR2 or SPR2 bits are set, they in turn set CLCK bit (bit 7) of the Operation Status Register. Results from the Clock Recovery Event Register can be masked by using the CREE command to set the Clock Recovery Event Enable Register. Refer to Refer to “CREE” on page 12 for enable and mask value definitions. Limit Test Event Register (LTER) Bit 0 (COMP) of the Limit Test Event Register is set when the Limit Test completes. The Limit Test completion criteria are set by the LTESt:RUN command. Refer to “RUNTil” on page 10. Bit 1 (FAIL) of the Limit Test Event Register is set when the Limit Test fails. Failure criteria for the Limit Test are defined by the LTESt:FAIL command. Refer to “FAIL” on page 7. The Limit Test Event Register is read and cleared with the LTER? query. Refer to “LTER?” on page 17. When either the COMP or FAIL bits are set, they in turn set the LTEST bit (bit 8) of the Operation Status Register. You can mask the COMP and FAIL bits, thus preventing them from setting the LTEST bit, by defining a mask using the LTEE command. Refer to “LTEE” on page 16. When the COMP bit is set, it in turn sets the ACQ bit (bit 9) of the Operation Status Register. Results from the Acquisition Register can be masked by using the AEEN command to set the Acquisition Event Enable Register to the value 0. You enable the COMP bit by setting the mask value to 1. Jitter Event Register (JIT) Bit 0 (EFAIL) of the Jitter Event Register is set when characterizing edges in Jitter Mode fails. Bit 1 (JLOSS) of the register is set when pattern synchronization is lost in Jitter Mode. Bit 2 (AREQD) of the register is set when a parameter change in Jitter Mode has made autoscale necessary. Bit 12 of the Operation Status Register (JIT) indicates that one of the enabled conditions in the Jitter Event Register has occurred. You can mask the EFAIL, JLOSS, and AREQD bits, thus preventing them from setting the JIT bit, by setting corresponding bits to zero using the JEE command. Refer to “JEE” on page 15. Mask Test Event Register (MTER) Bit 0 (COMP) of the Mask Test Event Register is set when the Mask Test completes. The Mask Test completion criteria are set by the MTESt:RUNTil command. Refer to “RUNTil” on page 16. Bit 1 (FAIL) of the Mask Test Event Register is set when the Mask Test fails. This will occur whenever any sample is recorded within any region defined in the mask. The Mask Test Event Register is read and cleared with the MTER? query. Refer to “MTER?” on page 19. When either the COMP or FAIL bits are set, they in turn set the MTEST bit (bit 10) of the Operation Status Register. You can mask the COMP and FAIL bits, thus preventing them from setting the MTEST bit, by setting corresponding bits to zero using the MTEE command. Refer to “MTEE” on page 18. Precision Timebase Event Register (PTER) The Precision Timebase feature requires the installation of the Keysight 86107A Precision Timebase Module. Bit 0 (LOSS) of the Precision Timebase Event Register is set when loss of the time reference occurs. Time reference is lost when a change in the amplitude or frequency of the reference clock signal is detected. The Precision Timebase Event Register is read and cleared with the PTER? query. Refer to “PTER?” on page 20. When the LOSS bit is set, it in turn sets the PTIME bit (bit 11) of the Operation Status Register. Results from the Precision Timebase Register can be masked by using the PTEE command to set the Precision Timebase Event Enable Register to the value 0. You enable the LOSS bit by setting the mask value to 1. Refer to “PTEE” on page 20. Error Queue As errors are detected, they are placed in an error queue. This queue is first in, first out. If the error queue overflows, the last error in the queue is replaced with error –350, “Queue overflow”. Any time the queue overflows, the oldest errors remain in the queue, and the most recent error is discarded. Programmer’s Guide 35 1 Introduction The length of the instrument's error queue is 30 (29 positions for the error messages, and 1 position for the “Queue overflow” message). The error queue is read with the SYSTEM:ERROR? query. Executing this query reads and removes the oldest error from the head of the queue, which opens a position at the tail of the queue for a new error. When all the errors have been read from the queue, subsequent error queries return 0, “No error.” The error queue is cleared when any of the following occurs: • When the instrument is powered up. • When the instrument receives the *CLS common command. • When the last item is read from the error queue. For more information on reading the error queue, refer to the SYSTEM:ERROR? query in Chapter 5, “DATE 117". For a complete list of error messages, refer to “Error Messages" on page 46. Output Queue The output queue stores the instrument-to-computer responses that are generated by certain instrument commands and queries. The output queue generates the Message Available summary bit when the output queue contains one or more bytes. This summary bit sets the MAV bit (bit 4) in the Status Byte Register. The output queue may be read with the BASIC ENTER statement. Message Queue The message queue contains the text of the last message written to the advisory line on the screen of the instrument. The queue is read with the SYSTEM:DSP? query. Note that messages sent with the SYSTem:DSP command do not set the MSG status bit in the Status Byte Register. Clearing Registers and Queues The *CLS common command clears all event registers and all queues except the output queue. If *CLS is sent immediately following a program message terminator, the output queue is also cleared. 36 Programmer’s Guide 1 Introduction Interface Functions The interface functions deal with general bus management issues, as well as messages that can be sent over the bus as bus commands. In general, these functions are defined by IEEE 488.1. The instrument is equipped with a GPIB interface connector on the rear panel. This allows direct connection to a GPIB equipped computer. You can connect an external GPIB compatible device to the instrument by installing a GPIB cable between the two units. Finger tighten the captive screws on both ends of the GPIB cable to avoid accidentally disconnecting the cable during operation. A maximum of fifteen GPIB compatible instruments (including a computer) can be interconnected in a system by stacking connectors. This allows the instruments to be connected in virtually any configuration, as long as there is a path from the computer to every device operating on the bus. The interface capabilities of this instrument, as defined by IEEE 488.1, are listed in the Table 11 on page 38. CAUTION Avoid stacking more than three or four cables on any one connector. Multiple connectors produce leverage that can damage a connector mounting. GPIB Default Startup Conditions The following default GPIB conditions are established during power-up: 1) The Request Service (RQS) bit in the status byte register is set to zero. 2) All of the event registers, the Standard Event Status Enable Register, Service Request Enable Register, and the Status Byte Register are cleared. Command and Data Concepts The GPIB has two modes of operation, command mode and data mode. The bus is in the command mode when the Attention (ATN) control line is true. The command mode is used to send talk and listen addresses and various bus commands such as group execute trigger (GET). The bus is in the data mode when the ATN line is false. The data mode is used to convey device-dependent messages across the bus. The device-dependent messages include all of the instrument specific commands, queries, and responses found in this manual, including instrument status information. Communicating Over the Bus Device addresses are sent by the computer in the command mode to specify who talks and who listens. Because GPIB can address multiple devices through the same interface card, the device address passed with the program message must include the correct interface select code and the correct instrument address. Device Address = (Interface Select Code * 100) + (Instrument Address) The examples in this manual assume that the instrument is at device address 707. Each interface card has a unique interface select code. This code is used by the computer to direct commands and communications to the proper interface. The default is typically “7” for GPIB interface cards. Each instrument on the GPIB must have a unique instrument address between decimal 0 and 30. This instrument address is used by the computer to direct commands and communications to the proper instrument on an interface. The default is typically “7” for this instrument. You can change the instrument address in the Utilities, Remote Interface dialog box. NOTE Programmer’s Guide Do Not Use Address 21 for an Instrument Address. Address 21 is usually reserved for the Computer interface Talk/Listen address and should not be used as an instrument address. 37 1 Introduction Bus Commands The following commands are IEEE 488.1 bus commands (ATN true). IEEE 488.2 defines many of the actions that are taken when these commands are received by the instrument. The device clear (DCL) and selected device clear (SDC) commands clear the input buffer and output queue, reset the parser, and clear any pending commands. If either of these commands is sent during a digitize operation, the digitize operation is aborted. The group execute trigger (GET) command arms the trigger. This is the same action produced by sending the RUN command. The interface clear (IFC) command halts all bus activity. This includes unaddressing all listeners and the talker, disabling serial poll on all devices, and returning control to the system computer. Table 11 Interface Capabilities Code Interface Function Capability SH1 Source Handshake Full Capability AH1 Acceptor Handshake Full Capability T5 Talker Basic Talker/Serial Poll/Talk Only Mode/. Unaddress if Listen Address (MLA) L4 Listener Basic Listener/Unaddresses if Talk Address (MTA) SR1 Service Request Full Capability RL1 Remote Local Complete Capability PP1 Parallel Poll Remote Configuration DC1 Device Clear Full Capability DT1 Device Trigger Full Capability C0 Computer No Capability E2 Driver Electronics Tri State (1 MB/SEC MAX) 38 Programmer’s Guide 1 Introduction Commands Unavailable in Jitter Mode This section describes the commands that can generate errors when controlling the instrument in Jitter mode. This can be due to the command or one of its arguments that are not allowed in Jitter mode. Refer to the individual command reference for detailed information. Measure Commands • MATLab 270 • MATLab :SCRipt • MATLab :ETENable • MATLab :ETEXt? 270 270 270 Waveform Files Waveform and Color Grade/Gray Scale files cannot be saved or loaded in Jitter mode. The commands listed below produce a "Settings conflict" error when executed in Jitter Mode. • STORe 173 When used with sources other than SETup and JDMemory. • STORe:WAVeform 114 • ACQuire:SWAVeform • LTESt:SWAVeform • MTESt:SWAVeform 128 209 231 Waveform Queries Only jitter database waveforms may be set or queried in Jitter mode. Using the following command produces the error, "Signal or trigger source selection is not available". • :WAVeform:DATA 345 Waveform Memory Load/Store Waveforms cannot be saved into waveform memories in Jitter mode. All waveform memories are turned off when entering Jitter mode. The commands listed below produce a "Settings conflict" error when executed in Jitter mode. • WMEMory :LOAD 355 • WMEMory :SAVE 356 • DISK:LOAD 167 When used with sources other than SETup and JDMemory. WAveform Memory Display Waveform memories cannot be turned on in Jitter mode. The following command produces a "Settings conflict" error when executed in Jitter mode. • WMEMory :DISPlay 355 Waveform and Color Grade-Gray Scale Memory The Waveform and Color Grade/Gray Scale memories cannot be turned on in Jitter mode. The following command produces an "Illegal parameter value" error when executed in Jitter mode. • Programmer’s Guide VIEW 115 39 1 Introduction When used with arguments other than JDMemory. Timebase Scale And Delay Scale and position controls on the Horizontal setup dialog are disabled in Jitter Mode. The following commands produce a "Settings conflict" error when executed in Jitter Mode: • TIMebase:RANGe 332 • TIMebase:SCALe 333 • TIMebase:POSition 330 Channel Scale And Offset Channel scale and offset controls are disabled in Jitter mode. The following commands produce a "Settings conflict" error when executed in Jitter Mode. • CHANnel :OFFSet 144 • CHANnel :RANGe 146 • CHANnel :SCALe 147 Acquisition Settings Acquisition (Averaging) controls are disabled in Jitter mode. The following commands produce a "Settings conflict" error when executed in Jitter mode. • ACQuire:AVERage • ACQuire:BEST • ACQuire:POINts 123 124 125 Histograms Histograms are turned off when entering Jitter mode. The following commands produce a "Control is set to default" error. • HISTogram:MODE • VIEW 200 115 Software Skewing of Channels All skew adjustments are disabled in jitter mode. The following commands produce a "Settings conflict" error when executed in Jitter mode. 40 • CALibrate:SKEW 139 • CALibrate:SKEW:AUTO 139 Programmer’s Guide 1 Introduction Error Messages This chapter describes the error messages and how they are generated. Use the command “ERRor?" on page 9 to return an error number and message. The possible causes for the generation of the error messages are also listed in Table 12 on page 42. Error Queue As errors are detected, they are placed in an error queue. This queue is first in, first out. If the error queue overflows, the last error in the queue is replaced with error –350, “Queue overflow.” Anytime the error queue overflows, the oldest errors remain in the queue, and the most recent error is discarded. The length of the instrument's error queue is 30 (29 positions for the error messages, and 1 position for the “Queue overflow” message). Reading an error from the head of the queue removes that error from the queue, and opens a position at the tail of the queue for a new error. When all errors have been read from the queue, subsequent error queries return 0, “No error.” The error queue is cleared when any of the following occur: • the instrument is powered up, • a *CLS command is sent, • the last item from the queue is read, or • the instrument is switched from talk only to addressed mode on the front panel. Error Numbers The error numbers are grouped according to the type of error that is detected. • +0 indicates no errors were detected. • –100 to –199 indicates a command error was detected. • –200 to –299 indicates an execution error was detected. • –300 to –399 indicates a device-specific error was detected. • –400 to –499 indicates a query error was detected. • +1 to +32767 indicates an instrument-specific error has been detected. Refer to the Keysight 86100A/B/C online Help for instrument specific errors. Command Error An error number in the range –100 to –199 indicates that an IEEE 488.2 syntax error has been detected by the instrument's parser. The occurrence of any error in this class sets the command error bit (bit 5) in the event status register and indicates that one of the following events occurred: • An IEEE 488.2 syntax error was detected by the parser. That is, a controller-to-instrument message was received that is in violation of the IEEE 488.2 standard. This may be a data element that violates the instrument's listening formats, or a data type that is unacceptable to the instrument. • An unrecognized header was received. Unrecognized headers include incorrect instrument-specific headers and incorrect or unimplemented IEEE 488.2 common commands. • A Group Execute Trigger (GET) was entered into the input buffer inside of an IEEE 488.2 program message. Events that generate command errors do not generate execution errors, instrument-specific errors, or query errors. Programmer’s Guide 41 1 Introduction Execution Error An error number in the range –200 to –299 indicates that an error was detected by the instrument's execution control block. The occurrence of any error in this class causes the execution error bit (bit 4) in the event status register to be set. It also indicates that one of the following events occurred: • The program data following a header is outside the legal input range or is inconsistent with the instrument's capabilities. • A valid program message could not be properly executed due to some instrument condition. Execution errors are reported by the instrument after expressions are evaluated and rounding operations are completed. For example, rounding a numeric data element will not be reported as an execution error. Events that generate execution errors do not generate command errors, instrument specific errors, or query errors. Device- or Instrument-Specific Error An error number in the range of –300 to –399 or +1 to +32767 indicates that the instrument has detected an error caused by an instrument operation that did not properly complete. This may be due to an abnormal hardware or firmware condition. For example, this error may be generated by a self-test response error, or a full error queue. The occurrence of any error in this class causes the instrument-specific error bit (bit 3) in the event status register to be set. Query Error An error number in the range –400 to –499 indicates that the output queue control of the instrument has detected a problem with the message exchange protocol. An occurrence of any error in this class causes the query error bit (bit 2) in the event status register to be set. An occurrence of an error also means one of the following is true: Table 12 • An attempt is being made to read data from the output queue when no output is either present or pending. • Data in the output queue has been lost. Error Messages Returned by Instrument Parser (Sheet 1 of 7) Error Returned String Description 208 Incident Wave not Subtracted Incident wave not subtracted. Turn response ___ off and then on to restore. The blank space ( ___ ) represents a TDR/TDT response waveform (response 1 through response 4).One of the following settings changed after performing a TDR/TDT calibration: record length, timebase, or channel bandwidth. The incident waveform can no longer be subtracted until original settings have been restored. 191 Response Turned Off Response ___ turned off: Time base, record length or bandwidth changed. The blank space ( ___ ) represents a TDR/TDT response waveform (response 1 through response 4). Timescale or bandwidth no longer match because there has been a change in either timebase, record length, or bandwidth. The TDR/TDT response waveform has been turned off because of this mismatch. 190 Execution not Possible Execution not possible: Calibration is required. The operation requires the calibration of the TDR/TDT waveform. For example, TDR calibration parameters cannot be saved to a file before the calibration procedure is performed. 178 Measured RN is invalid The current measured RN is invalid or questionable. To apply RN stabilization in Jitter Mode, you must first have a valid RN measurement. Pressing the Get Measured RN button in the Advanced Jitter tab while a questionable RN measurement is displayed results in this error message. 177 Defined lead/lag for one/zero level not found in pattern Defined lead/lag (%n: %n) for one/zero level not found in pattern. Using closest (%n: %n). 42 Programmer’s Guide Introduction Table 12 1 Error Messages Returned by Instrument Parser (Sheet 2 of 7) Error Returned String Description 172 Automatic tap calculation failed Automatic tap calculation failed: error message 164 No Time Reference Set No time reference set: Reference clock not present or amplitude too small . The instrument fails to set the time reference when the reference clock amplitude is too small or not present. 163 Execution not Possible Execution not possible: No valid ___ destination available. A valid TDR/TDT destination is not specified. 162 Execution not Possible Execution not possible: Select TDR/TDT destination. . No TDR/TDT destination has been specified. 151 Unable to connect to MATLAB Unable to connect to MATLAB. Improper or corrupted MATLAB installation. 147 Printer Error Printer error: Install and select a default printer. The instrument was unable to locate the default printer. 141 Turn on Source for Specified Measurement Turn on ___ for the ___ measurement. The first blank space ( ___ ) represents the source that is required for the specific measurement (for example, an optical channel). The second blank space ( ___ ) is replaced with the name of the measurement (for example, jitter). 140 Exceeded Maximum ASCII List Length Exceeded maximum ASCII list length. An attempt was made to load a waveform in ASCII format into waveform memory. Waveform size exceeded ASCII record limit of 128K. Contents of the file may be corrupted; the waveform file can not be loaded. 139 Unable to normalize the equalizer tap values Unable to normalize the equalizer tap values: __. During normalization, the tap values are adjusted so that the DC gain (the sum of the tap values) is one while preserving the relative magnitudes of the tap values. 135 Jitter Exceeds Measurable Range Jitter exceeds measurable range for this signal. Reduce jitter or retard edge speeds.. The jitter analysis provided in Jitter Mode cannot accurately measure jitter if the combined RJ and PJ (δ-δ) exceeds the rise or fall time of the signal. 133 Unable to characterize edges: Sampling level is not in the valid range. In Jitter Mode, the jitter sampling level determines the active sample area for the measurements. The default is a value that is 50% of the logic highs and lows values. If you change this setting above or below the acceptable limits, this message appears. Enter a units value for the Jitter Sampling Level that is inside the minimum and maximum values shown on the message line. 131 Error Saving Mask Error saving mask: only parametric custom masks can be saved. A remote command was executed attempting to save a standard mask. 130 Error Loading Mask Error loading mask, ____. The custom mask cannot be loaded due to illegal values, structure, or commands contained in the mask file. 127 All Labels are in Use All 32 labels are in use, delete an old label before adding a new one. A maximum of 32 labels can be used. 125 Header Information not Valid Header information is not valid. Error when loading a waveform from text (ASCII) data. 120 Execution not possible: Calibration does not match mainframe. Execution not possible: Calibration does not match mainframe. The instrument attempted to load mainframe timebase calibration data that does not match the current mainframe model number or serial number. 117 You must start the mask test You must start the mask test prior to calculating auto margin. Without a running mask test, the instrument can not determine the auto margins. 116 Too Many Points Sent Too many points sent Programmer’s Guide 43 1 Introduction Table 12 Error Messages Returned by Instrument Parser (Sheet 3 of 7) Error Returned String Description 115 Network Path not Found The network path was not found. The network path may be unavailable or unmapped. For example, if you attempt to load or save a file to an unmapped or non-existent network path. 112 Unknown File Type Unknown file type. The contents of the file do not match the expected format. The file may be corrupted or may not be the correct type. 85 Incompatible Setup Incompatible setup. A previously saved setup is incompatible, possibly due to an instrument software change. 79 Probe Attenuation (or Gain) Exceeds Limits Probe attenuation (or gain) exceeds calibration limits. If the probe is broken or if the probe connections are not securely fastened, the probe calibration process fails. 78 No Significant Asynchronous Components Present No significant asynchronous components present. When using the Enhanced Jitter Analysis Software (Option 200), scanning for asynchronous PJ components can only be done if there are significant PJ frequencies detected in the aliased jitter spectrum. If there are no components, or if the components are too small to be accurately identified, scanning will not take place. 74 Mainframe Calibration Required Execution is not possible: Mainframe calibration is required. The mainframe calibration is required when a change in the temperature of the mainframe exceeds 15C compared to the temperature of the last mainframe timebase calibration (ΔT > 15°C). 72 Could not Save Calibration Factors Could not save calibration factors: Service is required. Possible errors during calibration. 69 Calibration in Progress Execution not possible while calibration is in progress. Unable to execute some remote commands during calibration. 68 Service Mainframe Timebase Uncalibrated Service mainframe timebase is uncalibrated. 67 Right Module Uncalibrated Right module is uncalibrated Calibration is recommended. 66 Left Module Uncalibrated Left module is uncalibrated. Calibration is recommended. 65 Module Memory Contents Obsolete Module memory contents obsolete: reinitialize ___ module. The blank spaces ( ___ ) represent the module model number. An error due to a recent software upgrade may have occurred. 64 Module not Supported The ___ module is not supported. The blank spaces ( ___ ) represent the module model number. An error due to a recent software upgrade may have occurred. 62 Unable to Communicate Unable to communicate with ___ module: remove and reinsert firmly. The instrument can not recognize the module. The blank space ( ___ ) indicates which module has the error (left or right). 61 Memory Error Occurred Memory error occurred in ___ module: Try reinstalling module. The plug-in module memory is incorrect. The blank space (___) indicates which module has the error (left or right). 59 Action cannot be performed on Jitter Data Memory Action cannot be performed on Jitter Data Memory. When Jitter Data Memory is viewed, the Run, Stop Single, Clear Display, or Auto Scale functions are unavailable. 52 Disconnect Probe from Module Probe must be disconnected from module. During a module calibration, the probe must be disconnected from the module. This ensures an accurate calibration. 48 No Measurements for Limit Test No measurements are on for limit test. Unable to perform a measurement limit test through GPIB when there are no active measurements. 47 No Mask Loaded No mask loaded. Unable to perform a mask test when a mask is not selected. 46 No Valid Mask Test Sources No valid mask test sources turned on. Unable to perform a mask test from a remote command when a valid source is not available. 44 Programmer’s Guide Introduction Table 12 1 Error Messages Returned by Instrument Parser (Sheet 4 of 7) Error Returned String Description 41 Waveform Data is Not Valid Waveform data is not valid. Remote command error occurred when the instrument attempted to save a waveform to disk or read the waveform over GPIB. 40 Command Execution not Possible Command execution is not possible on the selected waveform. Unable to perform remote command. 39 Function Cannot be Performed Function cannot be performed on the selected waveform. The function is not defined for this waveform type; therefore it cannot be performed. 38 Measurement Cannot be Performed Measurement cannot be performed on the selected waveform. The measurement is not defined for this waveform type, and cannot be made. 36 Autoscale not Completed Autoscale not completed. Unable to perform a complete autoscale. 15 Execution not Possible Execution is not possible. This message occurs when a remote command is sent to a value on a channel that does not have the feature. For example, this message will occur when you try to set the channel wavelength on an electrical channel. 14 System Software Error Fatal system software error occurred: Please cycle power. The instrument is still operable. Normally, the address (defect diagnostic) where the error occurred is also displayed. Record this address to help in servicing the instrument. 12 Source not Available Signal source is not available. Signal source may be currently unavailable. For example, if you activate markers using remote commands without having a signal source activated. 11 Date and Time Incorrect System date and time are incorrect. This error occurs when loading a waveform file with an invalid date or time stamp. 7 Mask Test Align Failed Mask test align failed. The mask test align algorithm was not able to detect a signal compatible with the installed mask. This can occur when there are not enough points on an edge or when the required edges are not present. 6 Unrecognizable Waveform Format The file format is incompatible with the file open operation. 2 Uninstalled Option The ___ option is not installed. The instrument was unable to execute a feature that requires an upgrade option that is not installed in the instrument. 0 No error The error queue is empty. Every error in the queue has been read (SYSTEM:ERROR? query) or the queue was cleared by power-up or *CLS. -100 Command error This is the generic syntax error used if the instrument cannot detect more specific errors. -101 Invalid character A syntactic element contains a character that is invalid for that type. -102 Syntax error An unrecognized command or data type was encountered. -103 Invalid separator The parser was expecting a separator and encountered an illegal character. -104 Data type error The parser recognized a data element different than one allowed. For example, numeric or string data was expected but block data was received. -105 GET not allowed A Group Execute Trigger was received within a program message. -108 Parameter not allowed More parameters were received than expected for the header. -109 Missing parameter Fewer parameters were received than required for the header. -112 Program mnemonic too long The header or character data element contains more than twelve characters. Programmer’s Guide 45 1 Introduction Table 12 Error Messages Returned by Instrument Parser (Sheet 5 of 7) Error Returned String Description -113 Undefined header The header is syntactically correct, but it is undefined for the instrument. For example, *XYZ is not defined for the instrument. -121 Invalid character in number An invalid character for the data type being parsed was encountered. For example, a “9” in octal data. -123 Exponent too large Number is too large or too small to be represented internally. -124 Too many digits The mantissa of a decimal numeric data element contained more than 255 digits excluding leading zeros. -128 Numeric data not allowed A legal numeric data element was received, but the instrument does not accept one in this position for the header. -131 Invalid suffix The suffix does not follow the syntax described in IEEE 488.2 or the suffix is inappropriate for the instrument. -138 Suffix not allowed A suffix was encountered after a numeric element that does not allow suffixes. -141 Invalid character data Either the character data element contains an invalid character or the particular element received is not valid for the header. -144 Character data too long -148 Character data not allowed A legal character data element was encountered where prohibited by the instrument. -150 String data error This error can be generated when parsing a string data element. This particular error message is used if the instrument cannot detect a more specific error. -151 Invalid string data A string data element was expected, but was invalid for some reason. For example, an END message was received before the terminal quote character. -158 String data not allowed A string data element was encountered but was not allowed by the instrument at this point in parsing. -160 Block data error This error can be generated when parsing a block data element. This particular error message is used if the instrument cannot detect a more specific error. -161 Invalid block data -168 Block data not allowed A legal block data element was encountered but was not allowed by the instrument at this point in parsing. -170 Expression error This error can be generated when parsing an expression data element. It is used if the instrument cannot detect a more specific error. -171 Invalid expression -178 Expression data not allowed Expression data was encountered but was not allowed by the instrument at this point in parsing. -200 Execution error This is a generic syntax error which is used if the instrument cannot detect more specific errors. -220 Parameter error Indicates that a program data element related error occurred. -221 Settings conflict Indicates that a legal program data element was parsed but could not be executed due to the current device state. -222 Data out of range Indicates that a legal program data element was parsed but could not be executed because the interpreted value is outside the legal range defined by the instrument. 46 Programmer’s Guide Introduction Table 12 1 Error Messages Returned by Instrument Parser (Sheet 6 of 7) Error Returned String Description -223 Too much data Indicates that a legal program data element of block, expression, or string type was received that contained more data than the instrument could handle due to memory or related instrument-specific requirements. -224 Illegal parameter value Used where exact value, from a list of possibles, was expected. -225 Out of memory The device has insufficient memory to perform the requested operation. -231 Data questionable Indicates that measurement accuracy is suspect. -240 Hardware error Indicates that a legal program command or query could not be executed because of a hardware problem in the device. -241 Hardware missing Indicates that a legal program command or query could not be executed because of missing device hardware; for example, an option was not installed, or current module does not have hardware to support command or query. Definition of what constitutes missing hardware is completely device-specific or module specific. -250 Mass storage error Indicates that a mass storage error occurred. -251 Missing mass storage Indicates that a legal program command or query could not be executed because of missing mass storage; for example, an option that was not installed. -252 Missing media Indicates that a legal program command or query could not be executed because of a missing media; for example, no disk. -253 Corrupt media Indicates that a legal program command or query could not be executed because of corrupt media; for example, bad disk or wrong format. -254 Media full Indicates that a legal program command or query could not be executed because the media was full; for example, there is no room on the disk. -255 Directory full Indicates that a legal program command or query could not be executed because the media directory was full. -256 File name not found Indicates that a legal program command or query could not be executed because the file name on the device media was not found; for example, an attempt was made to read or copy a nonexistent file. -257 File name error Indicates that a legal program command or query could not be executed because the file name on the device media was in error; for example, an attempt was made to copy to a duplicate file name. -258 Media protected Indicates that a legal program command or query could not be executed because the media was protected; for example, the write-protect tab on a disk was present. -300 Service specific error -310 System error Indicates that a system error occurred. -340 Calibration failed Indicates that a calibration has failed. -350 Queue overflow Indicates that there is no room in the error queue and an error occurred but was not recorded. -400 Query error This is the generic query error. -410 Query INTERRUPTED -420 Query UNTERMINATED -430 Query DEADLOCKED Programmer’s Guide 47 1 Introduction Table 12 Error Messages Returned by Instrument Parser (Sheet 7 of 7) Error Returned String -440 Query UNTERMINATED after indefinite response 48 Description Programmer’s Guide Introduction 1 Language Compatibility This section lists Keysight 83480A commands that are not used in the 86100A/B/C/D. Table 13 Keysight 83480A/54750A Commands Not Used in the Instrument (Sheet 1 of 6) Programming Commands/Queries Replacement Commands/Queries Common Commands *LRN SYSTEM:SETUP Root Level Commands :AER? No replacement :ERASe No replacement :HEEN :AEEN :MENU No replacement :MERGe No replacement :STORe:PMEMory1 No replacement :TEER No replacement System Commands :SYSTem :SYSTem:KEY No replacement Calibration Commands :CALibrate :CALibrate:FRAMe:CANCel :CALibrate:CANcel :CALibrate:FRAMe:CONTinue :CALibrate:CONTinue :CALibrate:FRAMe:DATA No replacement :CALibrate:FRAMe:DONE? :CALibrate:STATus? :CALibrate:FRAMe:MEMory? No replacement :CALibrate:PLUGin:ACCuracy :CALibrate:MODule:STATus :CALibrate:PLUGin:CANCel :CALibrate:CANcel :CALibrate:PLUGin:CONTinue :CALibrate:CONTinue :CALibrate:PLUGin:DONE? :CALibrate:STATus? :CALibrate:PLUGin:MEMory? No replacement :CALibrate:PLUGin:OFFSet :CALibrate:MODule:OFFSet :CALibrate:PLUGin:OPOWer :CALibrate:MODule:OPOWer :CALibrate:PLUGin:OPTical :CALibrate:MODule:OPTical :CALibrate:PLUGin:OWAVelength :CALibrate:MODule:OWAVelength :CALibrate:PLUGin:TIME? :CALibrate:MODule:TIME? :CALibrate:PLUGin:VERTical :CALibrate:MODule:VERtical Programmer’s Guide 49 1 Introduction Table 13 Keysight 83480A/54750A Commands Not Used in the Instrument (Sheet 2 of 6) :CALibrate:PROBe :CALibrate:PROBe CHANnel Channel Commands :CHANnel :CHANnel :AUTOscale :AUToscale :CHANnel :SKEW :CALibrate:SKEW Disk Commands :DISK :DISK:DATA? No replacement :DISK:FORMat No replacement Display Commands :DISPlay :DISPlay:ASSign No replacement :DISPlay:CGRade :SYSTem:MODE EYE :DISPlay:CGRade? :SYSTem:MODE? :DISPlay:COLumn :DISPlay:LABel :DISPlay:DATA :WAVeform:DATA :DISPlay:DWAVeform No replacement :DISPlay:FORMat No replacement :DISPlay:INVerse :DISPlay:LABel :DISPlay:LINE :DISPlay:LABel :DISPlay:MASK No replacement :DISPlay:ROW :DISPlay:LABel :DISPlay:SOURce No replacement :DISPlay:STRing :DISPlay:LABel :DISPlay:TEXT :DISPlay:LABel:DALL FFT Commands :FFT FFT is not available in the 86100A/B. Function Commands :FUNCtion 50 :FUNCtion :ADD No replacement :FUNCtion :BWLimit No replacement :FUNCtion :DIFFerentiate No replacement :FUNCtion :DIVide No replacement :FUNCtion :FFT No replacement, FFT not available :FUNCtion :INTegrate No replacement :FUNCtion :MULTiply No replacement :FUNCtion :ONLY :FUNCtion :MAGNify Programmer’s Guide Introduction Table 13 1 Keysight 83480A/54750A Commands Not Used in the Instrument (Sheet 3 of 6) Hardcopy Commands :HARDcopy :HARDcopy:ADDRess :HARDcopy:DPRinte :HARDcopy:BACKground :HARDcopy:IMAGe INVert :HARDcopy:BACKground? No replacement :HARDcopy:DESTination No replacement :HARDcopy:DEVice No replacement :HARDcopy:FFEed No replacement :HARDcopy:FILename No replacement :HARDcopy:LENGth No replacement :HARDcopy:MEDia No replacement Histogram Commands :HISTogram :HISTogram:RRATe :DISPlay:RRATe :HISTogram:RUNTil :ACQuire:RUNTil :HISTogram:SCALe :HISTogram:SCALe:SIZE :HISTogram:SCALe:OFFSet :HISTogram:SCALe:SIZE :HISTogram:SCALe:RANGe :HISTogram:SCALe:SIZE :HISTogram:SCALe:SCALe :HISTogram:SCALe:SIZE :HISTogram:SCALe:TYPE :HISTogram:SCALe:SIZE Limit Test Commands :LTESt :LTESt:SSCReen:DDISk:BACKground :LTESt:SSCReen:IMAGe :LTESt:SSCReen:DDISk:MEDia No replacement :LTESt:SSCReen:DDISk:PFORmat No replacement :LTESt:SSCReen:DPRinter:ADDRess No replacement :LTESt:SSCReen:DPRinter:BACKground No replacement :LTESt:SSCReen:DPRinter:MEDia No replacement :LTESt:SSCReen:DPRinter:PORT No replacement :LTESt:SSUMmary:ADDRess No replacement :LTESt:SSUMmary:MEDia No replacement :LTESt:SSUMmary:PFORmat No replacement :LTESt:SSUMmary:PORT No replacement Marker Commands :MARKer :MARKer:CURSor? No replacement. Use individual queries. :MARKer:MEASurement:READout No replacement Programmer’s Guide 51 1 Introduction Table 13 Keysight 83480A/54750A Commands Not Used in the Instrument (Sheet 4 of 6) :MARKer:MODE :MARKer:STATe :MARKer:MODE? No replacement :MARKer:TDELta? :MARKer:XDELta? :MARKer:TSTArt :MARKer:X1Position :MARKer:TSTOp :MARKer:X2Position :MARKer:VDELta :MARKer:YDELta :MARKer:VSTArt :MARKer:Y1Position :MARKer:VSTOp :MARKer:Y2Position Mask Test Commands :MTESt 52 :MTESt:AMASk:CReate No replacement :MTESt:AMASk:SOURce No replacement :MTESt:AMASk:UNITs No replacement :MTESt:AMASk:XDELta No replacement :MTESt:AMASk:YDELta No replacement :MTESt:AMODe No replacement :MTESt:COUNt:FWAVeforms? MTESt:COUNt:HITS? TOTal :MTESt:FENable No replacement :MTESt:MASK:DEFine No replacement a :MTESt:POLYgon:DEFine No replacement a :MTESt:POLYgon:DELete No replacement a :MTESt:POLYgon:MOVE No replacement a :MTESt:RECall :MTESt:LOAD :MTESt:SAVE No replacement :MTESt:SSCReen:DDISk:BACKground :MTESt:SSCReen:IMAGe :MTESt:SSCReen:DDISk:MEDia No replacement :MTESt:SSCReen:DDISk:PFORmat No replacement :MTESt:SSCReen:DPRinter No replacement :MTESt:SSCReen:DPRinter:ADDRess No replacement :MTESt:SSCReen:DPRinter:BACKground No replacement :MTESt:SSCReen:DPRinter:MEDia No replacement :MTESt:SSCReen:DPRinter:PFORmat No replacement :MTESt:SSCReen:DPRinter:PORT No replacement :MTESt:SSUMmary:ADDRess No replacement Programmer’s Guide Introduction Table 13 1 Keysight 83480A/54750A Commands Not Used in the Instrument (Sheet 5 of 6) :MTESt:SSUMmary:BACKground No replacement :MTESt:SSUMmary:MEDia No replacement :MTESt:SSUMmary:PFORmat No replacement :MTESt:SSUMmary:PORT No replacement Measure Commands :MEASure :MEASure:CGRade:ERCalibrate :CALibrate:ERATio:STARt CHANnel :MEASure:CGRade:ERFactor No replacement :MEASure:CGRade:QFACtor :MEASure:CGRade:ESN :MEASure:FFT No replacement. FFT not available. :MEASure:HISTogram:HITS Query only :MEASure:HISTogram:MEAN Query only :MEASure:HISTogram:MEDian Query only :MEASure:HISTogram:M1S Query only :MEASure:HISTogram:M2S Query only :MEASure:HISTogram:OFFSET? No replacement :MEASure:HISTogram:PEAK Query only :MEASure:HISTogram:PP Query only :MEASure:PREShoot No replacement :MEASure:STATistics No replacement. Statistics always on. :MEASure:TEDGe Query only :MEASure:VLOWer No replacement :MEASure:VMIDdle No replacement :MEASure:VTIMe Query only :MEASure:VUPPer No replacement Timebase Commands :TIMebase :TIMebase:DELay :TIMebase:POSition :TIMebase:VIEW No replacement :TIMebase:WINDow:DELay No replacement :TIMebase:WINDow:POSition No replacement :TIMebase:WINDow:RANGe No replacement :TIMebase:WINDow:SCALe No replacement :TIMebase:WINDow:SOURce No replacement Trigger Commands :TRIGger Programmer’s Guide 53 1 Introduction Table 13 Keysight 83480A/54750A Commands Not Used in the Instrument (Sheet 6 of 6) :TRIGger:SWEep :TRIGger:SOURce FRUN :TRIGger:SWEep? :TRIGger:SOURce? :TRIGger :BWLimit :TRIGger:BWLimit and :TRIGger:GATed :TRIGger :PROBe :TRIGger:ATTenuation Waveform Commands :WAVeform :WAVeform:COMPlete No replacement :WAVeform:COUPling No replacement :WAVeform:VIEW? No replacement a Refer to the Infiniium DCA Online Help to view information about defining custom masks. 54 Programmer’s Guide Keysight 86100A/B/C/D Wide-Bandwidth Oscilloscope Programmer’s Guide 2 Programming Examples Programming Examples 55 BASIC Programming Examples 78 55 2 Programming Examples Listings of the C sample programs in this section include: General Measurement Example 56 Service Request Example 61 SRQ From GPIB Device Example 63 Learn String Example 65 SICL I/O Example 67 National I/O Example 70 Multi-Database Example 73 GPIB Header File 76 General Measurement Example In this example, the main function inclues a call to init_IO() which initializes the instrument and interface so that the instrument can capture data and perform measurements on the data. At the start of the program, global symbols are defined which will be used to store and convert the digitized data to time and voltage values. In the transfer_data function, the header string (header_str) resembles the following string when the information is stripped off: #510225. The left-most "5" defines the number of digits that follow (10225). The example number "10225" is the number of points in the waveform. The information is stripped off of the header to get the number of data bytes that need to be read from the instrument. In the convert_data function, the data values are returned as digitized samples (sometimes called quantization levels or q-levels). These data values must be converted into voltage and time values. In the store_csv function, the time and voltage information of the waveform is stored in integer format, with the time stored first, followed by a comma, and the voltage stored second. File: init.c /* init. c */ /* * * * * * * * * * * */ Command Order Example. This program demonstrates the order of commands suggested for operation of the Agilent 86100 analyzer via GPIB. This program initializes the scope, acquires data, performs automatic measurements, and transfers and stores the data on the PC as time/voltage pairs in a comma-separated file format useful for spreadsheet applications. It assumes a SICL INTERFACE exists as 'gpib7' and an Agilent 86100 analyzer at address 7. It also requires the cal signal attached to Channel 1. See the README file on the demo disk for development and linking information. #include #include #include "hpibdecl.h" void void void void void void /* location of: printf ( ) */ /* location of: atof(), atoi ( ) */ /* prototypes, global declarations, constants */ initialize ( ); /* initialize the scope */ acquire_data ( ); /* digitize signal */ auto_measurements ( );/* perform built-in automatic measurements */ transfer_data ( ); /* transfers waveform data from scope to PC */ convert_data ( ); /* converts data to time/voltage values */ store_csv ( ); /* stores time/voltage pairs to comma-separated variable file format */ /* GLOBALS */ int count; double xorg,xref,xinc; /* values necessary for conversion of data */ double yorg,yref,yinc; int Acquired_length; char data [MAX_LENGTH]; /* data buffer */ double time_value [MAX_LENGTH];/* time value of data */ double volts [MAX_LENGTH];/* voltage value of data */ void main( void ) 56 Programmer’s Guide 2 Programming Examples { /* initialize interface and device sessions */ /* note: routine found in sicl_IO.c or natl_IO.c init_IO ( ); */ initialize ( ); /* initialize the scope and interface and set up SRQ */ acquire_data ( );/* capture the data */ auto_measurements ( );/* perform automated measurements on acquired data */ transfer_data ( );/* transfer waveform data to the PC from scope */ convert_data ( );/* convert data to time/voltage pairs */ store_csv ( ); /* store the time/voltage pairs as csv file */ close_IO ( ); /* close interface and device sessions */ /* note: routine found in sicl_IO.c or natl_IO.c */ } /* end main ( ) */ /* * * * * * * * * * */ Function name: initialize Parameters: none Return value: none Description: This routine initializes the analyzer for proper acquisition of data. The instrument is reset to a known state and the interface is cleared. System headers are turned off to allow faster throughput and immediate access to the data values requested by queries. The analyzer time base, channel, and trigger subsystems are then configured. Finally, the acquisition subsystem is initialized. void initialize ( ) { write_IO ("*RST"); write_IO ("*CLS"); /* reset scope - initialize to known state */ /* clear status registers and output queue */ write_IO (":SYSTem:HEADer OFF"); /* turn off system headers */ /* initialize time base parameters to center reference, 2 ms full-scale (200 us/div), and 20 us delay */ write_IO (":TIMebase:REFerence CENTer;RANGe 2e-3;POSition 20e-6"); /* initialize Channel1 1.6V full-scale (200 mv/div); offset -400mv */ write_IO (":CHANnel1:RANGe 1.6;OFFSet -400e-3"); /* initialize trigger info: channel1 signal on positive slope at 300mv */ write_IO (":TRIGger:SOURce FPANel;SLOPe POSitive"); write_IO (":TRIGger:LEVel-0.40"); /* initialize acquisition subsystem */ /* Real time acquisition - no averaging; record length 4096 */ write_IO (":ACQuire:AVERage OFF;POINts 4096"); } /* end initialize ( ) */ /* * Function name: acquire_data * Parameters: none * Return value: none * Description: This routine acquires data according to the current instrument settings. */ void acquire_data ( ) { /* * The root level :DIGitize command is recommended for acquisition of new * data. It will initialize data buffers, acquire new data, and ensure that * acquisition criteria are met before acquisition of data is stopped. * The captured data is then available for measurements, storage, or transfer * to a PC. Note that the display is automatically turned off by the * :DIGitize command and must be turned on to view the captured data. */ write_IO (":DIGitize CHANnel1"); write_IO (":CHANnel1:DISPlay ON");/* turn on channel 1 display which is turned off by the :DIGitize command */ } /* /* * * * * * * */ end acquire_data() */ Function name: auto_measurements Parameters: none Return value: none Description: This routine performs automatic measurements of volts peak-to-peak and period on the acquired data. It also demonstrates two methods of error detection when using automatic measurements. Programmer’s Guide 57 2 Programming Examples void auto_measurements ( ) { float period, vpp; unsigned char vpp_str[16]; unsigned char period_str[16]; int bytes_read; /* * * * * * * * Error checking on automatic measurements can be done using one of two methods. The first method requires that you turn on results in the Measurements subsystem using the command :MEASure:SEND ON. When this is on, the analyzer will return the measurement and a result indicator. The result flag is zero if the measurement was successfully completed, otherwise a non-zero value is returned which indicates why the measurement failed. See the Programmer's Manual for descriptions of result indicators. * * * * * The second method simply requires that you check the return value of the measurement. Any measurement not made successfully will return with the value +9.999E37. This could indicate that either the measurement was unable to be performed, or that insufficient waveform data was available to make the measurement. * METHOD ONE - turn on results to indicate whether the measurement completed * successfully. Note that this requires transmission of extra data from the scope. */ write_IO (":MEASure:SEND ON"); /* turn results on */ /* query -- volts peak-to-peak channel 1*/ write_IO (":MEASure:VPP? CHANnel1"); bytes_read = read_IO (vpp_str,16L);/* read in value and result flag */ if (vpp_str[bytes_read-2] != '0') printf ("Automated vpp measurement error with result %c\n", vpp_str[bytes_read-2]); else printf ("VPP is %f\n", (float)atof (vpp_str)); write_IO (":MEASure:PERiod? CHANnel1");/* period channel 1 */ bytes_read = read_IO (period_str,16L);/* read in value and result flag */ if (period_str[bytes_read-2] != '0') printf ("Automated period measurement error with result %c\n", period_str [bytes_read-2]); else printf ("Period is %f\n", (float) atof (period_str)); /* METHOD TWO - perform automated measurements and error checking with :MEAS:SEND OFF */ period = (float) 0; vpp = (float) 0; /* turn off results */ write_IO (":MEASure:SEND OFF"); write_IO (":MEASure:PERiod? CHANnel1");/* period channel 1 */ bytes_read = read_IO (period_str,16L);/* read in value and result flag */ period = (float) atof (period_str); if ( period > 9.99e37 ) printf ("\nPeriod could not be measured.\n"); else printf ("\nThe period of channel 1 is %f seconds.\n", period ); write_IO (":MEASure:VPP? CHANnel1"); bytes_read = read_IO ( vpp_str,16L ); vpp = (float) atof (vpp_str); if ( vpp > 9.99e37 ) printf ("Peak-to-peak voltage could not be measured.\n"); else printf ("The voltage peak-to-peak is %f volts.\n", vpp ); } /* end auto_measurements ( ) */ /* * Function name: transfer_data * Parameters: none 58 Programmer’s Guide Programming Examples 2 * Return value: none * Description: This routine transfers the waveform conversion factors and waveform data to the PC. */ void transfer_data ( ) { int header_length; char header_str[8]; char term; char xinc_str[32],xorg_str[32],xref_str[32]; char yinc_str[32],yref_str[32],yorg_str[32]; int bytes_read; /* waveform data source channel 1 */ write_IO (":WAVeform:SOURce CHANnel1"); /* setup transfer format */ write_IO (":WAVeform:FORMat BYTE"); /* request values to allow interpretation of raw data */ write_IO (":WAVeform:XINCrement?"); bytes_read = read_IO (xinc_str,32L); xinc = atof (xinc_str); write_IO (":WAVeform:XORigin?"); bytes_read = read_IO (xorg_str,32L); xorg = atof (xorg_str); write_IO (":WAVeform:XREFerence?"); bytes_read = read_IO (xref_str,32L); xref = atof (xref_str); write_IO (":WAVeform:YINCrement?"); bytes_read = read_IO (yinc_str,32L); yinc = atof (yinc_str); write_IO (":WAVeform:YORigin?"); bytes_read = read_IO (yorg_str,32L); yorg = atof (yorg_str); write_IO (":WAVeform:YREFerence?"); bytes_read = read_IO (yref_str,32L); yref = atof (yref_str); write_IO (":WAVeform:DATA?");/* request waveform data */ bytes_read = read_IO (data,1L); /* ignore leading # */ bytes_read = read_IO (header_str,1L);/* input byte counter */ header_length = atoi (header_str); /* read number of points - value in bytes */ bytes_read = read_IO (header_str,(long)header_length); Acquired_length = atoi (header_str);/* number of bytes */ bytes_read = read_IO (data,Acquired_length); /* input waveform data */ bytes_read = read_IO (&term,1L);/* input termination character */ } /* end transfer_data ( ) */ /* * * * * * * */ Function name: convert_data Parameters: none Return value: none Description: This routine converts the waveform data to time/voltage information using the values that describe the waveform. These values are stored in global arrays for use by other routines. void convert_data ( ) { int i; for (i = 0; i < Acquired_length; i++) { time_value[i] = ((i - xref) * xinc) + xorg; volts[i] = ((data[i] - yref) * yinc) + yorg; /* calculate time info */ /* calculate volt info */ } } /* end convert_data ( ) */ Programmer’s Guide 59 2 /* * * * * * * */ Programming Examples Function name: store_csv Parameters: none Return value: none Description: This routine stores the time and voltage information about the waveform as time/voltage pairs in a comma-separated variable file format. void store_csv ( ) { FILE *fp; int i; fp = fopen ("pairs.csv","wb"); /* open file in binary mode - clear file if already exists */ if (fp != NULL) { for (i = 0; i < Acquired_length; i++) { /* write time,volt pairs to file */ fprintf ( fp,"%e,%lf\n",time_value[i],volts[i]); } fclose ( fp ); /* close file */ } else printf ("Unable to open file 'pairs.csv'\n"); } 60 /* end store_csv ( ) */ Programmer’s Guide Programming Examples 2 Service Request Example The sample C program, gen_srq.c, shows how to initialize the interface and instrument and generate a service request. The init_IO() function initializes the instrument and interface and sets up and generates a service request. In the initialize function, the *RST command is a common command that resets the instrument to a known default configuration. Using this command ensures that the instrument is in a known state before you configure it. *RST ensures very consistent and repeatable results. Without *RST, a program may run one time, but it may give different results in following runs if the instrument is configured differently. *RST defaults the instrument to a set configuration so that the program can proceed from the same state each time. The *CLS command clears the status registers and the output queue. AUToscale finds and displays all signals that are attached to the instrument. You should program the instrument's time base, channel, and trigger for the specific measurement to be made, as you would do from the front panel, and use whatever other commands are needed to configure the instrument for the desired measurement. File: gen_srq.c /* gen_srq.c */ /* * * * * */ This example programs initializes the Agilent 86100 scope, runs an autoscale, then generates and responds to a Service Request from the scope. The program assumes an Agilent 86100 at address 7, an interface card at interface select code 7, and a signal source attached to channel 1. #include #include "hpibdecl.h" /* location of: printf ( ) */ void initialize ( ); void setup_SRQ ( ); void create_SRQ ( ); void main ( void ) { init_IO ( ); initialize ( ); setup_SRQ ( ); create_SRQ ( ); close_IO ( ); /* /* /* /* /* initialize interface and device sessions */ initialize the scope and interface */ enable SRQs on scope and set up SRQ handler */ generate SRQ */ close interface and device sessions */ } /* end main ( ) */ /* * Function name: initialize * Parameters: none * Return value: none * Description: This routine initializes the analyzer for proper acquisition of data. * The instrument is reset to a known state and the interface is cleared. * System headers are turned off to allow faster throughput and immediate access * to the data values requested by queries. The analyzer performs an autoscale to acquire waveform data. */ void initialize ( ) { write_IO ("*RST"); /* reset scope - initialize to known state */ write_IO ("*CLS"); /* clear status registers and output queue */ write_IO (":SYSTem:HEADer OFF"); /* turn off system headers */ write_IO (":AUToscale");/* perform autoscale */ } /* end initialize ( ) */ /* * * * * * * * */ Function name: setup_SRQ Parameters: none Return value: none Description: This routine initializes the device to generate Service Requests. It sets the Service Request Enable Register Event Status Bit and the Standard Event Status Enable Register to allow SRQs on Command or Query errors. void setup_SRQ ( ) { /* Enable Service Request Enable Register - Event Status Bit */ Programmer’s Guide 61 2 Programming Examples write_IO ("*SRE 32"); /* Enable Standard Event Status Enable Register enable Command Error - bit 4 - value 32 Query Error - bit 1 - value 4 */ write_IO ("*ESE 36"); } /* end setup_SRQ ( ) */ /* * Function name: create_SRQ * Parameters: none * Return value: none * Description: This routine sends two illegal commands to the scope which will generate an * SRQ and will place two error strings in the error queue. The scope ID is requested to allow * time for the SRQ to be generated. The ID string will contain a leading character which * is the response placed in the output queue by the interrupted query. */ void create_SRQ ( ) { char buf [256] = { 0 }; //read buffer for id string int bytes_read = 0; int srq_asserted; /* Generate query error (interrupted query)*/ /* send legal query followed by another command other than a read query response */ write_IO (":CHANnel2:DISPlay?"); write_IO (":CHANnel2:DISPlay OFF"); /* Generate command error - send illegal header */ write_IO (":CHANnel:DISPlay OFF"); /* get instrument ID - allow time for SRQ to set */ write_IO ("*IDN?"); bytes_read = read_IO (buf,256L); /* add NULL to end of string */ buf [bytes_read] = '\0'; printf ( "%s\n", buf); srq_asserted = check_SRQ ( ); if ( srq_asserted ) srq_handler ( ); } /* end create_SRQ ( ) */ 62 Programmer’s Guide Programming Examples 2 SRQ From GPIB Device Example File: srq.c /* file: /* srq.c */ This file contains the code to handle Service Requests from an GPIB device */ #include /* location of printf ( ), fopen ( ), and fclose ( ) */ #include "hpibdecl.h" /* * Function name: srq_handler * Parameters: none * Return value: none * Description: This routine services the scope when an SRQ is generated. * An error file is opened to receive error data from the scope. */ void srq_handler ( ) { FILE *fp; unsigned char statusbyte = 0; int i =0; int more_errors = 0; char error_str[64] ={0}; int bytes_read; int srq_asserted = TRUE; srq_asserted = check_SRQ ( ); while (srq_asserted) { statusbyte = read_status ( ); if ( statusbyte & SRQ_BIT ) { fp = fopen ( "error_list","wb" );/* open error file */ if (fp == NULL) printf ("Error file could not be opened.\n"); /* read error queue until no more errors */ more_errors = TRUE; while ( more_errors ) { write_IO (":SYSTEM:ERROR? STRING"); bytes_read = read_IO (error_str, 64L); error_str[bytes_read] = '\0'; /* write error msg to std IO */ printf ("Error string:%s\n", error_str ); if (fp != NULL) /* write error msg to file*/ fprintf (fp,"Error string:%s\n", error_str ); if ( error_str[0] == '0' ) { /* Clear event registers and queues,except output */ write_IO("*CLS"); more_errors = FALSE; if ( fp != NULL) fclose ( fp ); } for (i=0;i<64;i++) /* clear string */ error_str[i] = '\0'; } /* end while (more_errors) */ } else { printf (" SRQ not generated by scope.\n ");/* scope did not cause SRQ */ } srq_asserted = check_SRQ ( ); /* check for SRQ line status */ }/* end while ( srq_asserted ) */ Programmer’s Guide 63 2 Programming Examples }/* end srq_handler */ 64 Programmer’s Guide Programming Examples 2 Learn String Example File: learnstr.c /* learnstr.c */ /* * * * * */ This example program initializes the Agilent 86100 scope, runs autoscale to acquire a signal, queries for the learnstring, and stores the learnstring to disk. It then allows the user to change the setup, then restores the original learnstring. It assumes that a signal is attached to the scope. #include #include "hpibdecl.h" void void void void /* location of: printf ( ), fopen ( ), fclose ( ), fwrite ( ),getchar */ initialize ( ); store_learnstring ( ); change_setup ( ); get_learnstring ( ); void main ( void ) { init_IO ( ); /* /* initialize ( ); /* store_learnstring ( );/* change_setup ( ); /* get_learnstring ( ); /* close_IO ( ); /* /* initialize device and interface */ Note: routine found in sicl_IO.c or initialize the scope and interface, request learnstring and store */ request user to change setup */ restore learnstring */ close device and interface sessions Note: routine found in sicl_IO.c or natl_IO.c */ and set up SRQ */ */ natl_IO.c */ } /* end main */ /* * Function name: initialize * Parameters: none * Return value: none * Description: This routine initializes the analyzer for proper acquisition of data. * The instrument is reset to a known state and the interface is cleared. * System headers are turned off to allow faster throughput and immediate access to the data values requested by queries. * Autoscale is performed to acquire a waveform. The signal is then * digitized, and the channel display is turned on following the acquisition. */ void initialize ( ) { write_IO ("*RST"); write_IO ("*CLS"); /* reset scope - initialize to known state */ /* clear status registers and output queue */ write_IO (":SYSTem:HEADer ON");/* turn on system headers */ /* initialize Timebase parameters to center reference, 2 ms full-scale (200 us/div), and 20 us delay */ write_IO (":TIMebase:REFerence CENTer;RANGe 5e-3;POSition 20e-6"); /* initialize Channel1 1.6v full-scale (200 mv/div); offset -400mv */ write_IO (":CHANnel1:RANGe 1.6;OFFSet -400e-3"); /* initialize trigger info: channel1 signal on positive slope at 300mv */ write_IO (":TRIGger:SOURce FPANel;SLOPe POSitive"); write_IO (":TRIGger:LEVel-0.40"); /* initialize acquisition subsystem */ /* Real time acquisition - no averaging; record length 4096 */ write_IO (":ACQuire:AVERage OFF;POINts 4096"); } /* end initialize ( ) */ /* * Function name: store_learnstring * Parameters: none * Return value: none * Description: This routine requests the system setup known as a learnstring. * The learnstring is read from the scope and stored in a file called Learn2. Programmer’s Guide 65 2 Programming Examples */ void store_learnstring ( ) { FILE *fp; unsigned char setup[MAX_LRNSTR] ={0}; int actualcnt = 0; write_IO (":SYSTem:SETup?"); /* request learnstring */ actualcnt = read_IO (setup, MAX_LRNSTR); fp = fopen ( "learn2","wb"); if ( fp != NULL ) { fwrite ( setup,sizeof (unsigned char), (int) actualcnt,fp); printf ("Learn string stored in file Learn2\n"); fclose ( fp ); } else printf ("Error in file open\n"); }/* end store_learnstring */ /* * Function name: change_setup * Parameters: none * Return value: none * Description: This routine places the scope into local mode to allow the customer to change the system setup. */ void change_setup ( ) { printf ("Please adjust setup and press ENTER to continue.\n"); getchar(); } /* end change_setup */ /* * * * * * */ Function name: get_learnstring Parameters: none Return value: none Description: This routine retrieves the system setup known as a learnstring from a disk file called Learn2. It then restores the system setup to the scope. void get_learnstring ( ) { FILE *fp; unsigned char setup[MAX_LRNSTR]; unsigned long count = 0; fp = fopen ( "learn2","rb"); if ( fp != NULL ) { count = fread ( setup,sizeof(unsigned char),MAX_LRNSTR,fp); fclose ( fp ); } write_lrnstr (setup,count); write_IO (":RUN"); /* send learnstring */ }/* end get_learnstring */ 66 Programmer’s Guide Programming Examples 2 SICL I/O Example File: sicl_IO.c /* sicl_IO.c */ #include #include #include "hpibdecl.h" /* /* * * * * * * * */ /* location of: printf ( ) */ /* location of: strlen ( ) */ This file contains IO and initialization routines for the SICL libraries. */ Function name: init_IO Parameters: none Return value: none Description: This routine initializes the SICL environment. It sets up error handling, opens both an interface and device session, sets timeout values, clears the interface by pulsing IFC, and clears the instrument by performing a Selected Device Clear. void init_IO ( ) { ionerror (I_ERROR_EXIT); /* set-up interface error handling */ /* open interface session for verifying SRQ line */ bus = iopen ( INTERFACE ); if ( bus == 0 ) printf ("Bus session invalid\n"); itimeout ( bus, 20000 ); iclear ( bus ); /* set bus timeout to 20 sec */ /* clear the interface - pulse IFC */ scope = iopen ( DEVICE_ADDR );/* open the scope device session */ if ( scope == 0) printf ( "Scope session invalid\n"); itimeout ( scope, 20000 ); /* set device timeout to 20 sec */ iclear ( scope ); /* perform Selected Device Clear on scope */ } /* end init_IO */ /* * * * * * * */ Function name: write_IO Parameters: char *buffer which is a pointer to the character string to be output; unsigned long length which is the length of the string to be output Return value: none Description: This routine outputs strings to the scope device session using the unformatted I/O SICL commands. void write_IO ( void *buffer ) { unsigned long actualcnt; unsigned long length; int send_end = 1; length = strlen ( buffer ); iwrite ( scope, buffer, length, send_end, &actualcnt ); } /* end write_IO */ /* * * * * * * */ Function name: write_lrnstr Parameters: char *buffer which is a pointer to the character string to be output; long length which is the length of the string to be output Return value: none Description: This routine outputs a learnstring to the scope device session using the unformatted I/O SICL commands. void write_lrnstr ( void *buffer, long length ) { unsigned long actualcnt; int send_end = 1; iwrite ( scope, buffer, (unsigned long) length, send_end, &actualcnt ); Programmer’s Guide 67 2 Programming Examples } /* end write_lrnstr ( ) */ /* * * * * * */ Function name: read_IO Parameters: char *buffer which is a pointer to the character string to be input; unsigned long length which indicates the max length of the string to be input Return value: integer which indicates the actual number of bytes read Description: This routine inputs strings from the scope device session using SICL commands. int read_IO (void *buffer,unsigned long length) { int reason; unsigned long actualcnt; iread (scope,buffer,length,&reason,&actualcnt); return( (int) actualcnt ); } /* * Function name: check_SRQ * Parameters: none * Return value: integer indicating if bus SRQ line was asserted * Description: This routine checks for the status of SRQ on the bus and returns a value to indicate the status. */ int check_SRQ( ) { int srq_asserted; /* check for SRQ line status */ ihpibbusstatus(bus, I_GPIB_BUS_SRQ, &srq_asserted); return ( srq_asserted ); } /* end check_SRQ ( ) */ /* * * * * */ Function name: read_status Parameters: none Return value: unsigned char indicating the value of status byte Description: This routine reads the scope status byte and returns the status. unsigned char read_status ( ) { unsigned char statusbyte; /* Always read the status byte from instrument */ /* NOTE: ireadstb uses serial poll to read status byte - this should clear bit 6 to allow another SRQ. */ ireadstb ( scope, &statusbyte ); return ( statusbyte ); } /* end read_status ( ) */ /* * * * * * * */ Function name: close_IO Parameters: none Return value: none Description: This routine closes device and interface sessions for the SICL environment and calls the routine _siclcleanup which de-allocates resources used by the SICL environment. void close_IO ( ) { iclose ( scope ); iclose ( bus ); 68 /* close device session */ /* close interface session */ Programmer’s Guide Programming Examples _siclcleanup ( ); 2 /* required for 16-bit applications */ } /* end close_SICL ( ) */ Programmer’s Guide 69 2 Programming Examples National I/O Example File: natl_IO.c /* natl_IO.c */ #include #include #include "hpibdecl.h" /* /* * * * * */ /* location of: printf ( ) */ /* location of: strlen ( ) */ This file contains IO and initialization routines for the NI488.2 commands. */ Function name: hpiberr Parameters: char* - string describing error Return value: none Description: This routine outputs error descriptions to an error file. void hpiberr( char *buffer ) { printf ("Error string: %s\n",buffer ); } /* end hpiberr ( ) */ /* * * * * * * * */ Function name: init_IO Parameters: none Return value: none Description: This routine initializes the NI environment. It sets up error handling, opens both an interface and device session, sets timeout values clears the interface by pulsing IFC, and clears the instrument by performing a Selected Device Clear. void init_IO ( ) { bus = ibfind ( INTERFACE );/* open and initialize GPIB board */ if ( ibsta & ERR ) hpiberr ("ibfind error"); ibconfig ( bus, IbcAUTOPOLL, 0);/* turn off autopolling */ ibsic ( bus ); /* clear interface - pulse IFC */ if ( ibsta & ERR ) { hpiberr ( "ibsic error" ); } /* open device session */ scope = ibdev ( board_index, prim_addr, second_addr, timeout, eoi_mode, eos_mode ); if ( ibsta & ERR ) { hpiberr ( "ibdev error" ); } ibclr ( scope ); /* clear the device( scope ) */ if ( ibsta & ERR) { hpiberr ("ibclr error" ); } } /* end init_IO */ /* * Function name: write_IO * Parameters: void *buffer which is a pointer to the character string to be output * Return value: none * Description: This routine outputs strings to the scope device session. */ void write_IO ( void *buffer ) { long length; length = strlen ( buffer ); ibwrt ( scope, buffer, (long) length ); 70 Programmer’s Guide Programming Examples 2 if ( ibsta & ERR ) { hpiberr ( "ibwrt error" ); } } /* end write_IO() */ /* * Function name: write_lrnstr * Parameters: void *buffer which is a pointer to the character string to * be output; length which is the length of the string to be output * Return value: none * Description: This routine outputs a learnstring to the scope device session. */ void write_lrnstr ( void *buffer, long length ) { ibwrt ( scope, buffer, (long) length ); if ( ibsta & ERR ) { hpiberr ( "ibwrt error" ); } } /* end write_lrnstr ( ) */ /* * Function name: read_IO * Parameters: char *buffer which is a pointer to the character string to be input; * unsigned long length which indicates the max length of the string to be input * Return value: integer which indicates the actual number of bytes read * Description: This routine inputs strings from the scope device session. */ int read_IO (void *buffer,unsigned long length) { ibrd (scope, buffer, ( long ) length ); return ( ibcntl ); } /* end read_IO ( ) */ /* * * * * * */ Function name: check_SRQ Parameters: none Return value: integer indicating if bus SRQ line was asserted Description: This routine checks for the status of SRQ on the bus and returns a value to indicate the status. int check_SRQ ( ) { int srq_asserted; short control_lines = 0; iblines ( bus, &control_lines); if ( control_lines & BusSRQ ) srq_asserted = TRUE; else srq_asserted = FALSE; return ( srq_asserted ); } /* end check_SRQ ( ) */ /* * Function name: read_status * Parameters: none * Return value: unsigned char indicating the value of status byte * Description: This routine reads the scope status byte and returns the status. */ unsigned char read_status ( ) { unsigned char statusbyte; /* Always read the status byte from instrument */ Programmer’s Guide 71 2 Programming Examples ibrsp ( scope, &statusbyte ); return ( statusbyte ); } /* end read_status ( ) */ /* * * * * */ Function name: close_IO Parameters: none Return value: none Description: This routine closes device session. void close_IO ( ) { ibonl ( scope,0 ); /* close device session */ } /* end close_IO ( ) */ 72 Programmer’s Guide Programming Examples 2 Multi-Database Example File: multidatabase.c /*multidatabase.c*/ /* * This example program demonstrates the use of the Multidatabase functionality of the * Agilent 86100 DCA. The program sets up an acquitision of 200 waveforms on two * channels, first serially, then in parallel. A mask test and simple * measurements are made on each channel. NOTE: the timeout value must * be set to a higher value (~30s) so that there is enough time to acquire the * data. */ #include //standard c++ io funcitons #include //time funcitons //GPIB prototypes (from IO file) void init_IO ( ); void write_IO ( char* ); int read_IO ( char*, unsigned long ); void close_IO ( ); //prototypes void initialize(); int acquire_serial(); int acquire_parallel(); void main() { int serialTime, parallelTime; //declarations init_IO(); //initial the interface and open GPIB communications initialize(); //set up the instrument serialTime = acquire_serial();//acquire the data in serial parallelTime = acquire_parallel();//acquire the data in parallel close_IO(); //close GPIB communications printf("\nSerial Acquisition Time: %d ms\nParallel Acquisition Time: %d ms\n", serialTime, parallelTime);//display acquisition times printf("Time Savings: %d ms\n", serialTime-parallelTime); //display the time savings }//main() /* * Function Name: initialize * Paramters: none * Returned value: none * Description: This method sets up the channels and acquisition limits of the * DCA */ void initialize() { write_IO("*RST");//reset the DCA write_IO("*CLS");//clear the status registers write_IO("SYSTem:MODE EYE");//switch to Eye/mask mode write_IO("STOP");//stop acquistion write_IO("CDISplay");//clear the display write_IO("ACQuire:RUNTil WAVeforms,200"); //set the acquistion limit to 200 waveforms write_IO("CHANnel1:FSELect 1");//choose filter #1 on channel 1 write_IO("CHANnel1:FILTer ON");//turn on the filter write_IO("CHANnel3:FSELect 1");//choose filter #1 on channel 3 write_IO("CHANnel3:FILTer ON");//turn on the filter }//initialize() /* * Funciton Name: acquireSerial * Parameters: none * Returned value: int - the time to acquire the data * Description: This routine turns on channel 1, performs an autoscale, acquires Programmer’s Guide 73 2 Programming Examples * 200 waveforms, performs a mask test, and then performs the measurements. * process is then repeated for channel 2. */ The int acquire_serial() { printf("Serial Acquisition in progress\n");//status report //decalrations int start=clock(),stop; char Msk_hits1[16],Crss_pct1[16],Ext_rat1[16],buff[32]; char Msk_hits2[16],Crss_pct2[16],Ext_rat2[16]; write_IO("CHANnel1:DISPlay ON");//turn on channel one write_IO("RUN"); //start acquistion write_IO("AUToscale");//Autoscale write_IO("*OPC?"); //query for completion read_IO(buff,5); //read completion response write_IO("MTESt:LOAD \"STM016_OC48.msk\"");//load OC-48 mask write_IO("MTESt:START");//start mask test write_IO("MTESt:COUNt:FSAMples?");//query the number of failed samples Msk_hits1[read_IO(Msk_hits1, 15)]=0;//get the number of mask hits write_IO("MTESt:TEST OFF");//trun off the maks test write_IO("MEASure:CGRade:CROSsing?");//query the crossing percentage Crss_pct1[read_IO(Crss_pct1,15)]=0;//get the crossing percentage write_IO("MEASure:CGRade:ERATio? DECibel");//query the extinction ratio Ext_rat1[read_IO(Ext_rat1,15)]=0;//get the extinction ratio write_IO("CHANnel3:DISPlay ON");//turn on channel three write_IO("RUN"); //start acquistion write_IO("AUToscale");//Autoscale write_IO("*OPC?"); //query for completion read_IO(buff,5); //read completion response write_IO("MTESt:TEST ON");//start mask test write_IO("MTESt:COUNt:FSAMples?");//query the number of failed samples Msk_hits2[read_IO(Msk_hits2, 15)]=0;//get the number of mask hits write_IO("MEASure:CGRade:CROSsing?");//query the crossing percentage Crss_pct2[read_IO(Crss_pct2,15)]=0;//get the crossing percentage write_IO("MEASure:CGRade:ERATio? DECibel");//query the extinction ratio Ext_rat2[read_IO(Ext_rat2,15)]=0;//get the extinction ratio stop = clock(); //display the results printf("Channel 1:\n Mask hits:%s Crossing %%:%s Extinction Ratio:%s\n", Msk_hits1,Crss_pct1,Ext_rat1); printf("Channel 3:\n Mask hits:%s Crossing %%:%s Extinction Ratio:%s\n", Msk_hits2,Crss_pct2,Ext_rat2); return (stop-start); }//acquireSerial() /* * Funciton Name: acquireParallel * Parameters: none * Returned value: int - the time to acquire the data * Description: This routine is identical to acquireSerial, except that the data * is aquired at the same time. */ int acquire_parallel() { printf("Parallel Acquisition In progress\n");//status report //decalrations int start=clock(),stop; char Msk_hits1[16],Crss_pct1[16],Ext_rat1[16],buff[32]; char Msk_hits2[16],Crss_pct2[16],Ext_rat2[16]; write_IO("CHANnel1:DISPlay ON");//turn on channel one write_IO("CHANnel3:DISPlay ON, APPEnd");//turn on channel three write_IO("RUN"); //start acquistion 74 Programmer’s Guide Programming Examples 2 write_IO("AUToscale"); //Autoscale write_IO("CALibrate:SKEW:AUTO");//auto deskew the two channels write_IO("*OPC?"); //query for completion read_IO(buff,5); //read completion response write_IO("MTESt:LOAD \"STM016_OC48.msk\"");//load OC-48 mask write_IO("MTESt:SOURce CHANnel1");//set mask test channel1 write_IO("MTESt:START");//start mask test write_IO("MTESt:COUNt:FSAMples?");//query the number of failed samples Msk_hits1[read_IO(Msk_hits1, 15)]=0;//get the number of mask hits write_IO("MTESt:SOURce CHANnel3");//mask test channel3 write_IO("MTESt:TEST ON");//start mask test write_IO("MTESt:COUNt:FSAMples?");//query the number of failed samples Msk_hits2[read_IO(Msk_hits2, 15)]=0;//get the number of mask hits write_IO("MEASure:CGRade:SOURce CHANnel1"); //measure Channel 1 write_IO("MEASure:CGRade:CROSsing?");//query the crossing percentage Crss_pct1[read_IO(Crss_pct1,15)]=0;//get the crossing percentage write_IO("MEASure:CGRade:ERATio? DECibel");//query the extinction ratio Ext_rat1[read_IO(Ext_rat1,15)]=0;//get the extinction ratio write_IO("MEASure:CGRade:SOURce CHANnel3"); //measure Channel 1 write_IO("MEASure:CGRade:CROSsing?");//query the crossing percentage Crss_pct2[read_IO(Crss_pct2,15)]=0;//get the crossing percentage write_IO("MEASure:CGRade:ERATio? DECibel");//query the extinction ratio Ext_rat2[read_IO(Ext_rat2,15)]=0;//get the extinction ratio stop = clock(); //display the results printf("Channel 1:\n Mask hits:%s Crossing %%:%s Extinction Ratio:%s\n", Msk_hits1,Crss_pct1,Ext_rat1); printf("Channel 3:\n Mask hits:%s Crossing %%:%s Extinction Ratio:%s\n", Msk_hits2,Crss_pct2,Ext_rat2); return (stop-start); //return the total run time return 1; }//acquireParallel() Programmer’s Guide 75 2 Programming Examples GPIB Header File File: gpibdecl.c /* gpibdecl.h */ /* * This file includes necessary prototypes and declarations for * the example programs for the Agilent 86100*/ */ /* * User must indicate which GPIB card (Agilent or National) is being used. * Also, if using a National card, indicate which version of windows * (WIN31 or WIN95) is being used. */ #define Agilent /* #define NATL */ /* Uncomment if using Agilent interface card */ /* #define WIN31 */ #define WIN95 /* For National card ONLY - select windows version */ #ifdef Agilent #include #else #ifdef WIN95 #include /* include file for Windows 95 */ #include #else #include /* include file for Windows 3.1 */ #endif #endif #define #define #define #define CME 32 EXE 16 DDE 8 QYE 4 #define #define #define #define SRQ_BIT 64 MAX_LRNSTR 14000 MAX_LENGTH 4096 MAX_INT 4192 #ifdef Agilent #define DEVICE_ADDR "hpib7,7" #define INTERFACE "hpib7" #else #define INTERFACE "hpib0" #define #define #define #define #define #define #endif board_index 0 prim_addr 7 second_addr 0 timeout 13 eoi_mode 1 eos_mode 0 #define TRUE 1 #define FALSE 0 /* GLOBALS */ #ifdef Agilent INST bus; INST scope; #else int bus; int scope; #endif /* GPIB prototypes */ void init_IO ( ); 76 Programmer’s Guide Programming Examples 2 void write_IO ( void* ); void write_lrnstr ( void*, long ); int read_IO ( void*, unsigned long ); int check_SRQ ( ); unsigned char read_status ( ); void close_IO ( ); void hpiberr ( ); void srq_handler ( ); Programmer’s Guide 77 2 Programming Examples BASIC Programming Examples Listings of the BASIC sample programs in this section include: General Measurement Example 78 Service Request Example 83 Learn String Example 86 General Measurement Example File: init.bas 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 78 !file: init ! ! ! This program demonstrates the order of commands suggested for operation of ! the Agilent 86100 analyzer via GPIB. This program initializes the scope, acquires ! data, performs automatic measurements, and transfers and stores the data on the ! PC as time/voltage pairs in a comma-separated file format useful for spreadsheet ! applications. It assumes an interface card at interface select code 7, an ! Agilent 86100 scope at address 7, and the Agilent 86100 cal signal connected to Channel 1. ! ! ! COM /Io/@Scope,@Path,Interface COM /Raw_data/ INTEGER Data(4095) COM /Converted_data/ REAL Time(4095),Volts(4095) COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg COM /Variables/ INTEGER Record_length ! ! CALL Initialize CALL Acquire_data CALL Auto_msmts CALL Transfer_data CALL Convert_data CALL Store_csv CALL Close END ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! BEGIN SUBPROGRAMS ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! Subprogram name: Initialize ! Parameters: none ! Return value: none ! Description: This routine initializes the interface and the scope. The instrument ! is reset to a known state and the interface is cleared. System headers ! are turned off to allow faster throughput and immediate access to the ! data values requested by the queries. The analyzer time base, ! channel, and trigger subsystems are then configured. Finally, the ! acquisition subsystem is initialized. ! ! SUB Initialize COM /Io/@Scope,@Path,Interface COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg COM /Variables/ INTEGER Record_length Interface=7 ASSIGN @Scope TO 707 RESET Interface CLEAR @Scope OUTPUT @Scope;"*RST" OUTPUT @Scope;"*CLS" OUTPUT @Scope;":SYSTem:HEADer OFF" !Initialize Timebase: center reference, 2 ms full-scale (200 us/div), 20 us delay OUTPUT @Scope;":TIMebase:REFerence CENTer;RANGe 2e-3;POSition 20e-6" Programmer’s Guide 2 Programming Examples 610 620 630 640 650 660 665 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000 1010 1020 1030 1040 1050 1060 1070 1080 1090 1100 1110 1120 1130 1140 1150 1160 1170 1180 1190 1200 1210 1220 1230 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 1340 1350 1360 1370 ! Initialize Channel1: 1.6V full-scale (200mv/div), -415mv offset OUTPUT @Scope;":CHANnel1:RANGe 1.6;OFFSet -415e-3" !Initialize Trigger: Edge trigger, channel1 source at -415mv OUTPUT @Scope;":TRIGger:SOURce FPANel;SLOPe POSitive" OUTPUT @Scope;":TRIGger:LEVel-0.415" ! Initialize acquisition subsystem ! Real time acquisition, Averaging off, memory depth 4096 OUTPUT @Scope;":ACQuire:AVERage OFF;POINts 4096" Record_length=4096 SUBEND ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! Subprogram name: Acquire_data ! Parameters: none ! Return value: none ! Description: This routine acquires data according to the current instrument ! setting. It uses the root level :DIGitize command. This command ! is recommended for acquisition of new data because it will initialize ! the data buffers, acquire new data, and ensure that acquisition ! criteria are met before acquisition of data is stopped. The captured ! data is then available for measurements, storage, or transfer to a ! PC. Note that the display is automatically turned off by the :DIGitize ! command and must be turned on to view the captured data. ! ! SUB Acquire_data COM /Io/@Scope,@Path,Interface OUTPUT @Scope;":DIGitize CHANnel1" OUTPUT @Scope;":CHANnel1:DISPlay ON" SUBEND ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! Subprogram name: Auto_msmts ! Parameters: none ! Return value: none ! Description: This routine performs automatic measurements of volts peak-to-peak ! and frequency on the acquired data. It also demonstrates two methods ! of error detection when using automatic measurements. ! ! SUB Auto_msmts COM /Io/@Scope,@Path,Interface REAL Period,Vpp DIM Vpp_str$[64] DIM Period_str$[64] Bytes_read=0 ! ! Error checking on automatic measurements can be done using one of two methods. ! The first method requires that you turn on results in the Measurement subsystem ! using the command ":MEASure:SEND ON". When this is on, the scope will return the ! measurement and a result indicator. The result flag is zero if the measurement ! was successfully completed, otherwise a non-zero value is returned which indicates ! why the measurement failed. See the Programmer's Manual for descriptions of result ! indicators. The second method simply requires that you check the return value of ! the measurement. Any measurement not made successfully will return with the value ! +9.999e37. This could indicate that either the measurement was unable to be ! performed or that insufficient waveform data was available to make the measurement. ! ! METHOD ONE ! OUTPUT @Scope;":MEASure:SEND ON" !turn on results OUTPUT @Scope;":MEASure:VPP? CHANnel1" !Query volts peak-to-peak ENTER @Scope;Vpp_str$ Bytes_read=LEN(Vpp_str$) !Find length of string CLEAR SCREEN IF Vpp_str$[Bytes_read;1]="0" THEN !Check result value PRINT PRINT "VPP is ";VAL(Vpp_str$[1,Bytes_read-1]) PRINT ELSE PRINT PRINT "Automated vpp measurement error with result ";Vpp_str$[Bytes_read;1] Programmer’s Guide 79 2 1380 1390 1400 1410 1420 1430 1440 1450 1460 1470 1480 1490 1500 1510 1520 1530 1540 1550 1560 1570 1580 1590 1600 1610 1620 1630 1640 1650 1660 1670 1680 1690 1700 1710 1720 1730 1740 1750 1760 1770 1780 1790 1800 1810 1820 1830 1840 1850 1860 1870 1880 1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 2000 2010 2020 2030 2040 2050 2060 2070 2080 2090 2100 2110 2120 2130 2140 2150 80 Programming Examples PRINT END IF ! ! OUTPUT @Scope;":MEASure:PERiod? CHANnel1" !Query frequency ENTER @Scope;Period_str$ Bytes_read=LEN(Period_str$) !Find string length IF Period_str$[Bytes_read;1]="0" THEN !Determine result value PRINT PRINT "Period is ";VAL(Period_str$[1,Bytes_read-1]) PRINT ELSE PRINT PRINT "Automated period measurement error with result ";Period_str$[Bytes_read;1] PRINT END IF ! ! ! ! METHOD TWO OUTPUT @Scope;":MEASure:SEND OFF" !turn off results OUTPUT @Scope;":MEASure:VPP? CHANnel1" !Query volts peak-to-peak ENTER @Scope;Vpp IF Vpp<9.99E+37 THEN PRINT PRINT "VPP is ";Vpp PRINT ELSE PRINT PRINT "Automated vpp measurement error ";Vpp PRINT END IF OUTPUT @Scope;":MEASure:PERiod? CHANnel1" ENTER @Scope;Period IF Freq<9.99E+37 THEN PRINT PRINT "Period is ";Period PRINT ELSE PRINT PRINT "Automated period measurement error";Period PRINT END IF SUBEND ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! Subprogram name: Transfer_data ! Parameters: none ! Return value: none ! Description: This routine transfers the waveform data and conversion factors to ! to PC. ! ! SUB Transfer_data COM /Io/@Scope,@Path,Interface COM /Raw_data/ INTEGER Data(4095) COM /Converted_data/ REAL Time(4095),Volts(4095) COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg COM /Variables/ INTEGER Record_length ! define waveform data source and format OUTPUT @Scope;":WAVeform:SOURce CHANnel1" OUTPUT @Scope;":WAVeform:FORMat WORD" ! request values needed to convert raw data to real OUTPUT @Scope;":WAVeform:XINCrement?" ENTER @Scope;Xinc OUTPUT @Scope;":WAVeform:XORigin?" ENTER @Scope;Xorg OUTPUT @Scope;":WAVeform:XREFerence?" ENTER @Scope;Xref OUTPUT @Scope;":WAVeform:YINCrement?" ENTER @Scope;Yinc OUTPUT @Scope;":WAVeform:YORigin?" ENTER @Scope;Yorg OUTPUT @Scope;":WAVeform:YREFerence?" ENTER @Scope;Yref Programmer’s Guide 2 Programming Examples 2160 ! 2170 ! request data 2180 OUTPUT @Scope;":WAVeform:DATA?" 2190 ENTER @Scope USING "#,1A";First_chr$ !ignore leading # 2200 ENTER @Scope USING "#,1D";Header_length !input number of bytes in header value 2210 ENTER @Scope USING "#,"&VAL$(Header_length)&"D";Record_length !Record length in bytes 2220 Record_length=Record_length/2 !Record length in words 2230 ENTER @Scope USING "#,W";Data(*) 2240 ENTER @Scope USING "#,A";Term$ !Enter terminating character 2250 ! 2260 SUBEND 2270 ! 2280 ! 2290 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2300 ! 2310 ! 2320 ! Subprogram name: Convert_data 2330 ! Parameters: none 2340 ! Return value: none 2350 ! Description: This routine converts the waveform data to time/voltage information 2360 ! using the values Xinc, Xref, Xorg, Yinc, Yref, and Yorg used to describe 2370 ! the raw waveform data. 2380 ! 2390 ! 2400 SUB Convert_data 2410 COM /Io/@Scope,@Path,Interface 2420 COM /Raw_data/ INTEGER Data(4095) 2430 COM /Converted_data/ REAL Time(4095),Volts(4095) 2440 COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg 2450 COM /Variables/ INTEGER Record_length 2460 ! 2470 FOR I=0 TO Record_length-1 2480 Time(I)=(((I)-Xref)*Xinc)+Xorg 2490 Volts(I)=((Data(I)-Yref)*Yinc)+Yorg 2500 NEXT I 2510 SUBEND 2520 ! 2530 ! 2540 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2550 ! 2560 ! 2570 ! Subprogram name: Store_csv 2580 ! Parameters: none 2590 ! Return value: none 2600 ! Description: This routine stores the time and voltage information about the waveform 2610 ! as time/voltage pairs in a comma-separated variable file format. 2620 ! 2630 ! 2640 SUB Store_csv 2650 COM /Io/@Scope,@Path,Interface 2660 COM /Converted_data/ REAL Time(4095),Volts(4095) 2670 COM /Variables/ REAL Xinc,Xref,Xorg,Yinc,Yref,Yorg 2680 COM /Variables/ INTEGER Record_length 2690 !Create a file to store pairs in 2700 ON ERROR GOTO Cont 2710 PURGE "Pairs.csv" 2720 Cont: OFF ERROR 2730 CREATE "Pairs.csv",Max_length 2740 ASSIGN @Path TO "Pairs.csv";FORMAT ON 2750 !Output data to file 2760 FOR I=0 TO Record_length-1 2770 OUTPUT @Path;Time(I),Volts(I) 2780 NEXT I 2790 SUBEND 2800 ! 2810 ! 2820 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2830 ! 2840 ! 2850 ! Subprogram name: Close 2860 ! Parameters: none 2870 ! Return value: none 2880 ! Description: This routine closes the IO paths. 2890 ! 2900 ! 2910 SUB Close 2920 COM /Io/@Scope,@Path,Interface 2930 ! Programmer’s Guide 81 2 2940 2950 2960 82 Programming Examples RESET Interface ASSIGN @Path TO * SUBEND Programmer’s Guide Programming Examples 2 Service Request Example File: srq.bas 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 !File: srq.bas ! ! This program demonstrates how to set up and check Service Requests from ! the scope. It assumes an interface select code of 7 with a scope at ! address 7. It also assumes a signal is connected to the scope. ! ! COM /Io/@Scope,Interface COM /Variables/Temp CALL Initialize CALL Setup_srq ON INTR Interface CALL Srq_handler !Set up routine to handle interrupt ENABLE INTR Interface;2 !Enable SRQ Interrupt for Interface CALL Create_srq CALL Close END ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! BEGIN SUBPROGRAMS ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! Subprogram name: Initialize ! Parameters: none ! Return value: none ! Description: This routine initializes the interface and the scope. ! The instrument is reset to a known state and the interface is ! cleared. System headers are turned off to allow faster throughput ! and immediate access to the data values requested by the queries. ! ! SUB Initialize COM /Io/@Scope,Interface ASSIGN @Scope TO 707 Interface=7 RESET Interface CLEAR @Scope OUTPUT @Scope;"*RST" OUTPUT @Scope;"*CLS" OUTPUT @Scope;":SYSTem:HEADer OFF" OUTPUT @Scope;":AUToscale" SUBEND ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Subprogram name: Setup_srq ! Parameters: none ! Return value: none ! Description: This routine sets up the scope to generate Service Requests. ! It sets the Service Request Enable Register Event Status Bit ! and the Standard Event Status Enable REgister to allow SRQs on ! Command or Query errors. ! ! SUB Setup_srq COM /Io/@Scope,Interface OUTPUT @Scope;"*SRE 32" !Enable Service Request Enable Registers - Event Status bit ! ! Enable Standard Event Status Enable Register: ! enable bit 4 - Command Error - value 32 ! bit 1 - Query Error - value 4 OUTPUT @Scope;"*ESE 36" SUBEND ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Programmer’s Guide 83 2 740 750 760 770 780 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000 1010 1020 1030 1040 1050 1060 1070 1080 1090 1100 1110 1120 1130 1140 1150 1160 1170 1180 1190 1200 1210 1220 1230 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 1340 1350 1360 1370 1380 1390 1400 1410 1420 1430 1440 1450 1460 1470 1480 1490 1500 1510 84 Programming Examples ! Subprogram name: Create_srq ! Parameters: none ! Return value: none ! Description: This routine will send an illegal command to the scope to ! show how to detect and handle an SRQ. A query is sent to ! the scope which is then followed by another command causing ! a query interrupt error. An illegal command header is then ! sent to demonstrate how to handle multiple errors in the error queue. ! ! ! SUB Create_srq COM /Io/@Scope,Interface DIM Buf$[256] OUTPUT @Scope;":CHANnel2:DISPlay?" OUTPUT @Scope;":CHANnel2:DISPlay OFF" !send query interrupt OUTPUT @Scope;":CHANnel:DISPlay OFF" !send illegal header ! Do some stuff to allow time for SRQ to be recognized ! OUTPUT @Scope;"*IDN?" !Request IDN to verify communication ENTER @Scope;Buf$ !NOTE: There is a leading zero to this query response PRINT !which represents the response to the interrupted query above PRINT Buf$ PRINT SUBEND ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! Subprogram name: Srq_handler ! Parameters: none ! Return value: none ! Description: This routine verifies the status of the SRQ line. It then checks ! the status byte of the scope to determine if the scope caused the ! SRQ. Note that using a SPOLL to read the status byte of the scope ! clears the SRQ and allows another to be generated. The error queue ! is read until all errors have been cleared. All event registers and ! queues, except the output queue, are cleared before control is returned ! to the main program. ! ! ! SUB Srq_handler COM /Io/@Scope,Interface DIM Error_str$[64] INTEGER Srq_asserted,More_errors Status_byte=SPOLL(@Scope) IF BIT(Status_byte,6) THEN More_errors=1 WHILE More_errors OUTPUT @Scope;":SYSTem:ERROR? STRING" ENTER @Scope;Error_str$ PRINT PRINT Error_str$ IF Error_str$[1,1]="0" THEN OUTPUT @Scope;"*CLS" More_errors=0 END IF END WHILE ELSE PRINT PRINT "Scope did not cause SRQ" PRINT END IF ENABLE INTR Interface;2 !re-enable SRQ SUBEND ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Subprogram name: Close ! Parameters: none ! Return value: none ! Description: This routine resets the interface. ! ! Programmer’s Guide Programming Examples 1520 1530 1540 1550 1560 1570 1580 1590 1600 2 ! SUB Close COM /Io/@Scope,Interface RESET Interface SUBEND ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Programmer’s Guide 85 2 Programming Examples Learn String Example File: lrn_str.bas 10 !FILE: lrn_str.bas 20 ! 30 !THIS PROGRAM WILL INITIALIZE THE SCOPE, AUTOSCALE, AND DIGITIZE THE WAVEFORM 40 !INFORMATION. IT WILL THEN QUERY THE INSTRUMENT FOR THE LEARNSTRING AND WILL 50 !SAVE THE INFORMATION TO A FILE. THE PROGRAM WILL THEN PROMPT YOU TO CHANGE 60 !THE SETUP THEN RESTORE THE ORIGINAL LEARNSTRING CONFIGURATION. IT ASSUMES 70 !AN Agilent 86100 at ADDRESS 7, GPIB INTERFACE at 7, AND THE CAL SIGNAL ATTACHED TO 80 !CHANNEL 1. 90 ! 100 ! 110 COM /Io/@Scope,@Path,Interface 120 COM /Variables/Max_length 130 CALL Initialize 140 CALL Store_lrnstr 150 CALL Change_setup 160 CALL Get_lrnstr 170 CALL Close 180 END 1200 ! 210 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 220 ! 230 ! BEGIN SUBROUTINES 240 ! 250 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 260 ! Subprogram name: Initialize 270 ! Parameters: none 280 ! Return value: none 290 ! Description: This routine initializes the path descriptions and resets the 300 ! interface and the scope. It performs an autoscale on the signal, 310 ! acquires the data on channel 1, and turns on the display. 320 ! NOTE: This routine also turns on system headers. This allows the 330 ! string ":SYSTEM:SETUP " to be returned with the learnstring so the 340 ! return string is in the proper format. 350 ! 360 SUB Initialize 370 COM /Io/@Scope,@Path,Interface 380 COM /Variables/Max_length 390 Max_length=14000 400 ASSIGN @Scope TO 707 410 Interface=7 420 RESET Interface 430 CLEAR @Scope 440 OUTPUT @Scope;"*RST" 450 OUTPUT @Scope;"*CLS" 460 OUTPUT @Scope;":SYSTem:HEADer ON" 470 OUTPUT @Scope;":AUToscale" 480 SUBEND 500 ! 510 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 530 ! 540 ! Subprogram name: Store_lrnstr 550 ! Parameters: none 560 ! Return value: none 570 ! Description: This routine creates a file in which to store the learnstring 580 ! configuration (Filename:Lrn_strg). It requests the learnstring 590 ! and inputs the configuration to the PC. Finally, it stores the 600 ! configuration to the file. 610 ! 620 SUB Store_lrnstr 630 COM /Io/@Scope,@Path,Interface 640 COM /Variables/Max_length 650 ON ERROR GOTO Cont 660 PURGE "Lrn_strg" 670 Cont: OFF ERROR 680 CREATE BDAT "Lrn_strg",1,14000 690 DIM Setup$[14000] 700 ASSIGN @Path TO "Lrn_strg" 710 OUTPUT @Scope;":SYSTem:SETup?" 720 ENTER @Scope USING "-K";Setup$ 730 OUTPUT @Path,1;Setup$ 740 CLEAR SCREEN 750 PRINT "Learn string stored in file: Lrn_strg" 760 SUBEND 86 Programmer’s Guide Programming Examples 770 790 800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 970 980 990 1000 1010 1020 1030 1050 1060 1070 1080 1090 1100 1110 1120 1130 1150 1160 1180 1190 1200 1210 1220 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 2 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Subprogram name: Change_setup ! Parameters: none ! Return value: none ! Description: This subprogram requests that the user change the ! scope setup, then press a key to continue. ! ! SUB Change_setup COM /Io/@Scope,@Path,Interface PRINT PRINT "Please adjust setup and press Continue to resume." PAUSE SUBEND ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Subprogram name: Get_lrnstr ! Parameters: none ! Return value: none ! Description: This subprogram loads a learnstring from the ! file "Lrn_strg" to the scope. ! SUB Get_lrnstr COM /Io/@Scope,@Path,Interface COM /Variables/Max_length DIM Setup$[14000] ENTER @Path,1;Setup$ OUTPUT @Scope USING "#,-K";Setup$ OUTPUT @Scope;":RUN" SUBEND ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Subprogram name: Close ! Parameters: none ! Return value: none ! Description: This routine resets the interface, and closes all I/O paths. ! ! SUB Close COM /Io/@Scope,@Path,Interface RESET Interface ASSIGN @Path TO * SUBEND ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Programmer’s Guide 87 2 88 Programming Examples Programmer’s Guide Keysight 86100A/B/C/D Wide-Bandwidth Oscilloscope Programmer’s Guide 3 Common Commands Introduction 90 *CLS (Clear Status) 91 *ESE (Event Status Enable) 91 *ESR? (Event Status Register) 92 *IDN? (Identification Number) 93 *LRN? (Learn) 93 *OPC (Operation Complete) 94 *OPT? (Option) 94 *RCL (Recall) 95 *RST (Reset) 95 *SAV (Save) 99 *SRE (Service Request Enable) 99 *STB? (Status Byte) 100 *TRG (Trigger) 101 *TST? (Test) 101 *WAI (Wait-to-Continue) 101 Common commands are defined by the IEEE 488.2 standard. They control generic device functions that are common to many different types of instruments. Common commands can be received and processed by the analyzer, whether they are sent over the GPIB as separate program messages or within other program messages. 89 3 Common Commands Introduction Receiving Common Commands Common commands can be received and processed by the analyzer, whether they are sent over the GPIB as separate program messages or within other program messages. If a subsystem is currently selected and a common command is received by the analyzer, the analyzer remains in the selected subsystem. For example, if the program message "ACQUIRE:AVERAGE ON;*CLS;COUNT 1024" is received by the analyzer, the analyzer enables averaging, clears the status information, then sets the number of averages without leaving the selected subsystem. Status Registers The following two status registers used by common commands have an enable (mask) register. By setting bits in the enable register, the status information can be selected for use. Refer to “Status Reporting" on page 26 for a complete discussion of status. Table 14 Status Registers Status Register Enable Register Event Status Register Event Status Enable Register Status Byte Register Service Request Enable Register Command Synchronization Three commands are available for the synchronization between remote command scripts and the instrument: *OPC (command and query) and *WAI. The *OPC command sets a bit in the Standard Event Status Register when all pending device operations have finished. It is useful to verify the completion of commands that could take a variable amount of time or commands executed in parallel with other commands, such as PRINt, and the limit test commands (ACQuire:RUNtil, MTEST:RUNtil, and LTEST). It does not stop the execution of the remote script. The *OPC query allows synchronization between the computer and the instrument by using the message available (MAV) bit in the Status Byte, or by reading the output queue. Unlike the *OPC command, the *OPC query does not affect the OPC event bit in the Standard Event Status Register. The execution of the remote script is halted and therefore the *OPC query should be used judiciously. For example, the command “:MTEST:RUNtil FSAMPLES,100’; *OPC?” will lock the remote interface until 100 failed samples are detected, which could take a very long time. Under these circumstances, the user must send a device clear or power down to re-start the instrument. The *WAI command is similar to the *OPC query as it will also block the execution of the remote script until all pending operations are finished. It is particularly useful if the host computer is connected to two or more instruments. This command will not block the GPIB bus, allowing the computer to continue issuing commands to the instrument not executing the *WAI command. 90 Programmer’s Guide 3 Common Commands Commands *CLS (Clear Status) Command *CLS Clears all status and error registers. Refer to “Error Messages" on page 41 for a complete discussion of status. Example 10 OUTPUT 707;"*CLS" *ESE (Event Status Enable) Command *ESE Sets the Standard Event Status Enable Register bits. is an integer, 0 to 255, representing a mask value for the bits to be enabled in the Standard Event Status Register as shown in Table 15 on page 92. Example This example enables the User Request (URQ) bit of the Standard Event Status Enable Register. When this bit is enabled and a front-panel key is pressed, the Event Summary bit (ESB) in the Status Byte Register is also set. 10 OUTPUT 707;"*ESE 64" Query *ESE? Returns the current contents of the Standard Event Status Enable Register. Returned Format is an integer, +0 to +255 (the plus sign is also returned), representing a mask value for the bits enabled in the Standard Event Status Register as shown in Table 15 on page 92. Example This example places the current contents of the Standard Event Status Enable Register in the numeric variable, Event. 10 OUTPUT 707;"*ESE?" 20 ENTER 707;Event The Standard Event Status Enable Register contains a mask value for the bits to be enabled in the Standard Event Status Register. A "1" in the Standard Event Status Enable Register enables the corresponding bit in the Standard Event Status Register. A "0" in the enable register disables the corresponding bit. Programmer’s Guide 91 3 Common Commands Table 15 Standard Event Status Enable Register Bits Bit Weight Enables Definition 7 128 PON - Power On Indicates power is turned on. 6 64 URQ - User Request Not used. Permanently set to zero. 5 32 CME - Command Error Indicates whether the parser detected an error. 4 16 EXE - Execution Error Indicates whether a parameter was out-of-range, or was inconsistent with the current settings. 3 8 DDE - Device Dependent Error Indicates whether the device was unable to complete an operation for device-dependent reasons. 2 4 QYE - Query Error Indicates if the protocol for queries has been violated. 1 2 RQC - Request Control Indicates whether the device is requesting control. 0 1 OPC - Operation Complete Indicates whether the device has completed all pending operations. See Also Refer to “Status Reporting" on page 26 for a complete discussion of status. *ESR? (Event Status Register) Query *ESR? Returns the contents of the Standard Event Status Register. Reading this register clears the Standard Event Status Register, as does *CLS. Returned Format is an integer, 0 to 255, representing the total bit weights of all bits that are high at the time you read the register. Example 10 OUTPUT 707;"*ESR?" 20 ENTER 707;Event Table 16 lists each bit in the Event Status Register and the corresponding bit weights. Standard Event Status Register Bits Table 16 Bit Bit Weight Bit Name Cond ition 7 128 PON 1 = OFF to ON transition has occurred. 6 64 5 32 CME 0 = no command errors. 1 = a command error has been detected. 4 16 EXE 0 = no execution error. 1 = an execution error has been detected. 3 8 DDE 0 = no device-dependent errors. 1 = a device-dependent error has been detected. 2 4 QYE 0 = no query errors. 1 = a query error has been detected. 1 2 RQC 0 = request control - NOT used - always 0. 92 Not Used. Permanently set to zero. Programmer’s Guide 3 Common Commands Table 16 0 Standard Event Status Register Bits (continued) 1 OPC 0 = False = Low 0 = operation is not complete. 1 = operation is complete. 1 = True = High *IDN? (Identification Number) Query *IDN? Returns the company name, model number, serial number, and software version by returning the following string. Notice that AGILENT is returned instead of KEYSIGHT. AGILENT TECHNOLOGIES,86100C, , Specifies the serial number, , of the analyzer. The first two letters and digits of the serial prefix are the country of manufacture for the analyzer. The last five digits are the serial suffix, which is assigned sequentially, and is different for each analyzer. specifies the software version of the analyzer, and is the revision number. Returned Format Example AGILENT TECHNOLOGIES,86100C,USXXXXXXXX,A.XX.XX This example places the analyzer's identification information in the string variable, Identify$. 10 DIM Identify$[50]!Dimension variable 20 OUTPUT 707;"*IDN?" 30 ENTER 707;Identify$ *LRN? (Learn) Query *LRN? Returns a string that contains the analyzer's current setup. The analyzer's setup can be stored and sent back to the analyzer at a later time. This setup string should be sent to the analyzer just as it is. It works because of its embedded :SYStem:SETup header. The *LRN query always returns :SYSTem:SETup as a prefix to the setup block. The SYSTem:HEADer command has no effect on this response. Returned Format :SYSTem:SETup This is a definite length arbitrary block response specifying the current analyzer setup. The block size is subject to change with different firmware revisions. Example This example sets the scope’s address and asks for the learn string, then determines the string length according to the IEEE 488.2 block specification. It then reads the string and the last EOF character. 10 ! Set up the scope’s address and 20 ! ask for the learn string... 30 ASSIGN @Scope TO 707 40 OUTPUT @Scope:"*LRN?" 50 ! 60 ! Search for the # sign. 70 ! 80 Find_pound_sign: ! 90 ENTER @Scope USING "#,A";Thischar$ 100 IF Thischar$<>"#" THEN Find_pound_sign 110 ! 120 ! Determine the string length according 130 ! to the IEEE 488.2 # block spec. 140 ! Read the string then the last EOF char. 150 ! 160 ENTER @Scope USING "#,D";Digit_count 170 ENTER @Scope USING "#,"&VAL$(Digit_count)&"D";Stringlength 180 ALLOCATE Learn_string$[Stringlength+1] 190 ENTER @Scope USING "-K";Learn_string$ 200 OUTPUT 707;":syst:err?" Programmer’s Guide 93 3 Common Commands 210 ENTER 707;Errornum 220 PRINT "Error Status=";Errornum See Also SYSTem:SETup command and query. When HEADers and LONGform are ON, the SYSTem:SETup command performs the same function as the *LRN query. Otherwise, *LRN and SETup are not interchangeable. *OPC (Operation Complete) Command *OPC Use either the command or the query to notify the calling program when an operation is complete thus allowing the program to perform other tasks while waiting until notified. Refer also to “*WAI (Wait-to-Continue)" on page 101. The *OPC command and *OPC? query work with any of the following commands. Use with other commands is unreliable or fails. • AUToscale 105 (In Jitter mode only.) • DIGitize • LTESt • PRECision • PRECision:RFRequency • PRECision:TREFerence • PRINt • PWAVeform:SAVE • RUNTil 126 • RUNTil 225 • SINGle 113 107 124 330 331 331 112 169 The *OPC command sets the Standard Event Status Register’s operation complete bit (OPC) when the operation is complete. The calling program must either poll periodically to see if the bit is set or setup an SRQ to be notified when the bit has been set. Refer to “*ESR? (Event Status Register)” on page 92 for more information. The *OPC? query holds the GPIB bus until the operations are complete at which time it returns a “1” in the output queue and calling code is then free to continue with other tasks. It causes the Status Byte Register’s message available (MAV) bit to be set. Refer to “*STB? (Status Byte)” on page 100. If instrument conditions have been set that can not be met and the *OPC command or query is sent out, the instrument halts remote execution and you must send a device clear or power down to restart the instrument. For more information, refer to “Status Reporting” on page 26. *OPC Example *OPC? Example 10 OUTPUT 707;":PRINT;*OPC" 10 OUTPUT 707;":SINGle;*OPC?" *OPT? (Option) Query *OPT? Returns a string with a list of installed hardware and software options. The query returns a 1 as the first character if option 86100C-001 or 86100D-ETR (enhanced trigger) is installed. If no options are installed, the string will have a 0 as the first character. The length of the returned string may increase as options become available in the future. Once implemented, an option name will be appended to the end of the returned string, delimited by a comma. 94 Programmer’s Guide Common Commands Restrictions Example 3 In software revisions A.05.00 and below, the query returns a list of any hardware options but does not include any software options. 10 OUTPUT 707;"*OPT?" *RCL (Recall) Command *RCL Restores the state of the analyzer to a setup previously stored in the specified save/recall register. An analyzer setup must have been stored previously in the specified register. Registers 0 through 9 are general-purpose registers and can be used by the *RCL command. is an integer, 0 through 9, specifying the save/recall register that contains the analyzer setup you want to recall. Example 10 OUTPUT 707;"*RCL 3" See Also SAVe. An error message appears on the analyzer display if nothing has been previously saved in the specified register. *RST (Reset) Command *RST Places the instrument in a known state. Table 17 lists the reset conditions as they relate to the analyzer commands. This is the same as using the front-panel default setup button. Example Table 17 10 OUTPUT 707;"*RST" Default Setup (Sheet 1 of 5) Acquisition Run/Stop 100 ms Grid on 30 Enabled 8 hours Default legend Off Off (until the first marker is placed on the screen) User selectable if more than one source is available. 28 ns 0V Points/Waveform (Record length) Automatic - 1350 points Averaging Off # of Averages 16 Trigger Source Front Panel Bandwidth 2.5 GHz Hysteresis Normal Slope Positive Programmer’s Guide 95 3 Common Commands Table 17 Default Setup (Sheet 2 of 5) Gated Trigger Off Level 0V Time Base Units Time Scale 1 ns/div Position 24 ns Reference Left Display Persistence Variable (oscilloscope mode) Gray Scale (Infinite) (Eye/Mask mode) Persistence Time 100 ms Graticule Grid on Intensity 30 Backlight Saver Enabled Turn off backlight after 8 hours Colors Default legend Labels Off Markers Mode Readout Off (until the first marker is placed on the screen) X1, Y1 source User selectable if more than one source is available X1 position 28 ns Y1 position 0V X2, Y2 source User selectable if more than one source is available X2 position 24 ns Y2 position 0V Measure Oscilloscope mode Eye/Mask mode QuickMeas, Meas.1 V p-p Extinction ratio QuickMeas, Meas. 2 Period Jitter QuickMeas, Meas. 3 Frequency Average power QuickMeas, Meas. 4 Rise time Crossing % Start mask test — Off 96 Programmer’s Guide Common Commands Table 17 3 Default Setup (Sheet 3 of 5) Define Measure Thresholds - percent 10%, 50%, 90% Thresholds - volts 0.0, 1.6, 5.0 Top-Base Definition Standard Statistics Off Top-Base volts 0.0, 5.0 Measurements Off Start Edge Rising, 1 level, middle Stop Edge Falling, 1 level, middle Eye Window 1 40% Eye Window 2 60% Duty cycle distortion format Time Extinction ratio format Decibel Eye width Time Jitter RMS Average power Watts Waveform Memory display Off Waveform source First available channel or memory 1 Memory type Waveform Math Function Function 1 Function state Off Operator Magnify Operand 1 First available channel or memory 1 Operand 2 First available channel or memory 1 Horizontal scaling Track source Vertical scaling Track source Channel Display On (lowest number installed channel; others are off) Scale 50 μW/div or 10 mV/div Offset 0.0 V or 0 W Units Volts (or watts) Programmer’s Guide 97 3 Common Commands Table 17 Default Setup (Sheet 4 of 5) Filter Dependent on module Wavelength Wavelength 1 Bandwidth Dependent on module Histogram Mode Off Axis Horizontal Window source First available channel Size Horizontal - 4.0 divisions Vertical - 5.0 divisions X1 position 25 ns Y1 position 1 division up from bottom, value depends on module X2 position 33 ns Y2 position 1 division down from top, value depends on module Utilities Cal Output 5.0 mv Calibration Details Off Self Test Scope Self Tests Service Extensions Off Remote Interface Unchanged Dialog Preferences Opaque Dialogs Allow Multiple Active Dialogs Off Sound enabled, volume 48 Limit Test Test Off Measurement None Fail when Outside Upper limit 10 Lower limit –10 Run until Forever Run until failures 1 failure Run until waveforms 1,000,000 waveforms Store summary Off Store screen Off 98 Programmer’s Guide 3 Common Commands Table 17 Default Setup (Sheet 5 of 5) Store waveforms Off Mask Test Test Off Scale source Displayed channel X1 position 2 divisions from left, 26 ns 1 level 2 divisions down 0 level 2 divisions up Mask margins Off Run until Forever Failed waveforms 1 failure Failed samples 1 sample Waveforms 1,000,000 Samples 1,000,000 Store waveforms Off Store summary Off Store screen Off *SAV (Save) Command *SAV Stores the current state of the analyzer in a save register. is an integer, 0 through 9, specifying which register to save the current analyzer setup. See also *RCL (Recall). Example 10 OUTPUT 707;"*SAV 3" *SRE (Service Request Enable) Command *SRE Sets the Service Request Enable Register bits. By setting the *SRE, when the event happens, you have enabled the analyzer’s interrupt capability. The scope will then do an SRQ (service request), which is an interrupt. is an integer, 0 to 255, representing a mask value for the bits to be enabled in the Service Request Enable Register as shown in Table 18 on page 100. Example This example enables a service request to be generated when a message is available in the output queue. When a message is available, the MAV bit is high. 10 OUTPUT 707;"*SRE 16" Query Returned Format Example *SRE? This example places the current contents of the Service Request Enable Register in the numeric variable, Value. 10 OUTPUT 707;"*SRE?" Programmer’s Guide 99 3 Common Commands The Service Request Enable Register contains a mask value for the bits to be enabled in the Status Byte Register. A “1” in the Service Request Enable Register enables the corresponding bit in the Status Byte Register. A “0” disables the bit. Table 18 Service Request Enable Register Bits Bit Weight Enables 7 128 OPER - Operation Status Register 6 64 Not Used 5 32 ESB - Event Status Bit 4 16 MAV - Message Available 3 8 Not Used 2 4 MSG - Message 1 2 USR - User Event Register 0 1 TRG - Trigger *STB? (Status Byte) Query *STB? Seturns the current contents of the Status Byte, including the Master Summary Status (MSS) bit. See Table 19 on page 100 for Status Byte Register bit definitions. Returned Format is an integer, from 0 to 255. Example This example reads the contents of the Status Byte into the numeric variable, Value. 10 OUTPUT 707;"*STB?" 20 ENTER 707;Value Table 19 In response to a serial poll (SPOLL), Request Service (RQS) is reported on bit 6 of the status byte. Otherwise, the Master Summary Status bit (MSS) is reported on bit 6. MSS is the inclusive OR of the bitwise combination, excluding bit 6, of the Status Byte Register and the Service Request Enable Register. The MSS message indicates that the scope is requesting service (SRQ). Status Byte Register Bits Bit Bit Weight Bit Name Cond ition 7 128 OPER 0 = no enabled operation status conditions have occurred 1 = an enabled operation status condition has occurred 6 64 RQS/MSS 0 = analyzer has no reason for service 1 = analyzer is requesting service 5 32 ESB 0 = no event status conditions have occurred 1 = an enabled event status condition occurred 4 16 MAV 0 = no output messages are ready 1 = an output message is ready 3 8 — 0 = not used 100 Programmer’s Guide 3 Common Commands Table 19 Status Byte Register Bits 2 4 MSG 0 = no message has been displayed 1 = message has been displayed 1 2 USR 0 = no enabled user event conditions have occurred 1 = an enabled user event condition has occurred 0 1 TRG 0 = no trigger has occurred 1 = a trigger occurred 0 = False = Low 1 = True = High *TRG (Trigger) Command *TRG The *TRG command has the same effect as the Group Execute Trigger message (GET) or RUN command. It acquires data for the active waveform display, if the trigger conditions are met, according to the current settings. Example 10 OUTPUT 707;"*TRG" *TST? (Test) Query *TST? Causes the analyzer to perform a self-test, and places a response in the output queue indicating whether or not the self-test completed without any detected errors. Use the :SYSTem:ERRor command to check for errors. A zero indicates that the test passed and a non-zero indicates the self-test failed. You must disconnect all front-panel inputs before sending the *TST? query. If a test fails, refer to the troubleshooting section of the service guide. The Self-Test takes approximately 3 minutes to complete. When using timeouts in your program, 200 seconds duration is recommended. Returned Format is 0 for pass; non-zero for fail. Example 10 OUTPUT 707;"*TST?" *WAI (Wait-to-Continue) Command *WAI Prevents the analyzer from executing any further commands or queries until all currently executing commands are completed. See *OPC for alternate methods for synchronization. Example Programmer’s Guide 10 OUTPUT 707;"SINGle;*WAI" 101 3 102 Common Commands Programmer’s Guide Keysight 86100A/B/C/D Wide-Bandwidth Oscilloscope Programmer’s Guide 4 Root Level Commands AEEN 104 ALER? 104 AUToscale 105 BLANk 106 CDISplay 106 COMMents 106 CREE 107 CRER? 107 DIGitize 107 JEE 108 JER? 109 LER? 109 LTEE 110 LTER? 110 MODel? 110 MTEE 111 MTER? 111 OPEE 111 OPER? 111 PTEE 112 PTER? 112 PRINt 112 RECall:SETup 113 RUN 113 SERial 113 SINGle 113 STOP 114 STORe:SETup 114 STORe:WAVeform 114 TER? 114 UEE 114 UER? 115 VIEW 115 103 4 Root Level Commands Root level commands control many of the basic operations of the analyzer that can be selected by pressing the labeled keys on the front panel. These commands are always recognized by the parser if they are prefixed with a colon, regardless of the current tree position. After executing a root level command, the parser is positioned at the root of the command tree. For any of the Standard Event Status Register bits to generate a summary bit, the bits must be enabled. These bits are enabled by using the *ESE common command to set the corresponding bit in the Standard Event Status Enable Register. URQ in the Event Status Register always returns 0. To generate a service request (SRQ) interrupt to an external computer, at least one bit in the Status Byte Register must be enabled. These bits are enabled by using the *SRE common command to set the corresponding bit in the Service Request Enable Register. These enabled bits can then set RQS and MSS (bit 6) in the Status Byte Register. In the SRE query, bit 6 always returns 0. Various root level commands documented in this chapter query and set various registers within the register set. AEEN Command :AEEN Sets a mask into the Acquisition Limits Event Enable register. A “1” in a bit position enables the corresponding bit in the Acquisition Limits Event Register to set bit 9 in the Operation Status Register. The argument is the decimal weight of the enabled bits. Only bits 0 through 4 of the Acquisition Limits Event Enable Register are used at this time. Table 20 shows the enabled bits for some useful example mask values. Bits that are not marked as enabled by the mask are blocked from affecting the operation status register. Query :AEEN? The query returns the current decimal value in the Acquisition Limits Event Enable register. Returned Format [:AEEN] Table 20 Mask Value Enabled Bits for Some Useful Example Mask Values Bit 4 CH4 Bit 3 CH3 Bit 2 CH2 Bit 1 CH1 Bit 0 COMP 0 1 • 2 • 3 • 4 • 5 • 6 • • 7 • • 8 16 • • • • • ALER? Query 104 :ALER? Programmer’s Guide Root Level Commands 4 Returns the current value of the Acquisition Limits Event Register as a decimal number and also clears this register. Bit 0 (COMP) of the Acquisition Limits Event Register is set when the acquisition completes. The acquisition completion criteria are set by the :ACQuire:RUNTil command. Acquistion Limit Tests on Individual Channels Returned Format When in independent acquisition mode and a channel finishes the corresponding bit of the acquisition limit event register (ALER) is set. For example, when channel 1 limit is reached bit 1 of the ALER is set; when channel 2 limit is reached bit 2 of the ALER is set. Bit 0 of the ALER is not set until all channels that acquisition limit tests are being performed on have finished. If the acquisition limit of a channel is set to off then the corresponding bit of the ALER for that channel is not set during the acquisition limit test. ALER? return the decimal weight of the enabled bits of the ALER. For example, if channels 1and 2 have reached their acquisition limit and no other channels have acquisition limits specified, then the value returned by the ALER? will be 7 (111 in binary). Bits 0, 1, & 2 of the ALER will then be set. [:ALER] AUToscale Command :AUToscale [] This command causes the instrument to evaluate the current input signal and find the optimum conditions for displaying the signal. It adjusts the vertical gain and offset for the channel, and sets the time base on the lowest numbered input channel that has a signal. If signals cannot be found on any vertical input, the analyzer is returned to its former state. Autoscale sets the following: • Channel Display, Scale, and Offset • Trigger and Level • Time Base Scale and Position Autoscale turns off the following: • Measurements on sources that are turned off • Functions • Windows • Memories No other controls are affected by Autoscale. For faster and more reliable execution of the autoscale function, enter the signal’s data rate using the optional argument. The instrument uses this argument as an aid in setting the horizontal scaling for a signal. The value is only valid for NRZ eye diagrams or clock signals. The argument sets the data rate in the same manner as the TRIGger:BRATe and TIMebase:BRATe commands. The limits for all three commands are identical. Normally, the valid range is 1 Mb/s to 160 Gb/s, however, in pattern lock, the range is 50 Mb/s to 160 Gb/s. When using the 86107A precision timebase, the data rate must be a multiple of the reference clock frequency. Refer to “PRECision:RFRequency” on page 331. Restrictions Example Software revision A.04.10 and above for argument. This example sets the data rate to 155.520 Mb/s and automatically scales the analyzer for the input signal. 10 OUTPUT 707;":AUTOSCALE 155.520E6" Query :AUToscale? Returns a string explaining the results of the last autoscale. The string is empty if the last autoscale completed successfully. The returned string stays the same until the next autoscale is executed. Programmer’s Guide 105 4 Root Level Commands The following are examples of strings returned by the AUToscale? query. No channels turned on Left module requires calibration for autoscale Right module requires calibration for autoscale Channel n signal is too small Channel n signal is too high Channel n signal exceeds the measurable range at the top Channel n offset exceeds the measurable range at the bottom No trigger or trigger too slow Trigger is in Free Run Unable to set horizontal scale/delay for channel n Returned Format [:AUToscale] BLANk Command :BLANk {CHANnel | FUNCtion | WMEMory | JDMemory | RESPonse | HISTogram | CGMemory} Turns off an active channel, function, waveform memory, jitter data memory, TDR response, histogram, or color grade memory. The VIEW command turns them on. is an integer, 1 through 4. Restrictions Example Software revision A.04.00 and above (86100C instruments) or 86100D instruments for jitter data memory argument. 10 OUTPUT 707;":BLANK CHANNEL1" CDISplay Command :CDISplay [CHANnel ] Clears the display and resets all associated measurements. If the analyzer is stopped, all currently displayed data is erased. If the analyzer is running, all of the data in active channels and functions is erased; however, new data is displayed on the next acquisition. Waveform memories are not erased. If a channel is specified as a parameter, only the displayed data from that channel is cleared. is an integer, 1 through 4. Restrictions Example In TDR mode (software revision A.06.00 and above), the optional channel argument is not allowed. 10 OUTPUT 707;":CDISPLAY" COMMents Command :COMMents {LMODule | RMODule}," " Sets the comments field for the module. This field is used to describe options included in the module, or for user comments about the module. A maximum of 35 characters is allowed. The argument represents the ASCII string enclosed in quotation marks. The maximum length of the string is 35 characters. Example Query 10 OUTPUT 707;”:COMMENTS LMODULE” :COMMents? {LMODule | RMODule} The query returns a string with the comments field associated with the module. Returned Format 106 [:COMMents] Programmer’s Guide Root Level Commands 4 CREE Command :CREE Sets a mask into the Clock Recovery Event Enable Register. A “1” in a bit position enables the corresponding bit in the Clock Recovery Event Register to set bit 7 in the Operation Status Register. is the decimal weight of the enabled bits. Table 21 on page 107 shows the enabled bits for some useful example mask values. Bits that are not marked as enabled for a mask are blocked from affecting the operation status register. Query Returned Format Table 21 :CREE? [:CREE] Enabled Bits for Some Useful Example Mask Values Mask Value Bit 6 FIN Bit 5 SPR2 Bit 4 NSPR2 Bit 3 SPR1 Bit 2 NSPR1 Bit 1 LOCK Bit 0 UNLK 0 1 • 2 • 4 • 8 • 16 • 32 • 64 • CRER? Query :CRER? Returns the current value of the Clock Recovery Event Register as a decimal number and also clears the register. Refer to “SPResent?” on page 162 for more detailed information on receiver one and receiver two. Refer to “Clock Recovery Event Register (CRER)” on page 34 for a definition of each bit in the register. Returned Format [:CRER] DIGitize Command :DIGitize [CHANnel | FUNCtion | RESPonse ] Invokes a special mode of data acquisition that is more efficient than using the RUN command when using averaging in the Oscilloscope mode. With the faster computations of the Agilent 86100B/C, the DIGitize command is no longer significantly faster than the RUN and RUNTil commands. In Jitter mode, the DIGitize command does not use any arguments, and the desired channel or function must be set up before this command is sent. See *OPC (Operation Complete) command on page 94 for synchronization of PRINT operations. is an integer, 1 through 4. The DIGitize command initializes the selected channels or functions, then it acquires them according to the current analyzer settings. When the signal is completely acquired (for example, when the specified number of averages have been taken), the analyzer is stopped. Programmer’s Guide 107 4 Root Level Commands In any instrument mode except Jitter mode, if you use the DIGitize command with channel, function, or response parameters, only the specified channels, functions, or responses are acquired. In Jitter mode, do not append any arguments to this command. To speed up acquisition, the waveforms are not displayed and their display state indicates “off.” Subsequent to the digitize operation, the display of the acquired waveforms may be turned on for viewing, if desired. Other sources are turned off and their data is invalidated. NOTE Even though digitized waveforms are not displayed, the full range of measurement and math operators may be performed on them. If you use the DIGitize command with no parameters, the digitize operation is performed on the channels or functions that were acquired with a previous digitize, run, or single operation. In this case, the display state of the acquired waveforms is not changed. Because the command executes more quickly without parameters, this form of the command is useful for repetitive measurement sequences. You can also use this mode if you want to view the digitize results because the display state of the digitized waveforms is not affected. Data acquired with the DIGitize command is placed in the normal channel, function, or response. NOTE The DIGitize command is not intended for use with limit tests. Use the RUN and RUNTil commands instead. The stop condition for the RUN command is specified by commands ACQuire:RUNTil on page 126, MTEST:RUNTil on page 225, or LTEST on page 205. NOTE Before executing the DIGitize command for a differential or common mode response, the type of response must be specified by turning on the response. This is done using the :TDR{2|4}:RESPonse command. Refer to “RESPonse” on page 321. See Chapter 2, “Programming Examples" for examples of how to use DIGitize and its related commands. Example This example acquires data on channel 1 and function 2. 10 OUTPUT 707;":DIGITIZE CHANNEL1,FUNCTION2" The ACQuire subsystem commands set up conditions such as TYPE and COUNT for the next DIGitize command. The WAVeform subsystem commands determine how the data is transferred out of the analyzer, and how to interpret the data. JEE Command :JEE Sets a mask into the Jitter Event Enable register. A “1” in a bit position enables the corresponding bit in the Jitter Event Register. This action sets bit 12 (JIT) in the Operation Status Register, which potentially can cause an SRQ to be generated. is the decimal value of the enabled bits. Only bits 0, 1, and 2 of the Jitter Event Enable Register are used at this time. The following table shows the enabled bits for each useful mask value. Bits that are not marked as enabled for a mask are blocked from affecting the operation status register. 108 Programmer’s Guide Root Level Commands Table 22 4 Enabled Bits for Mask Values Mask Value Bit 2 AREQD Bit 1 JLOSS Bit 0 EFAIL 0 1 Restrictions Query • 2 • 3 • 4 • 5 • 6 • • 7 • • • • • Jitter mode. Software revision A.04.00 and above (86100C instruments) or 86100D instruments with Option 100 or 200. :JEE? The query returns the current decimal value in the Jitter Event Enable Register. Returned Format [:JEE] JER? Query :JER? Returns the current value of the Jitter Event Register as a decimal number and also clears the register. Bit 0 of the register is set when characterizing edges in Jitter Mode fails. Bit 1 of the register is set when pattern synchronization is lost in Jitter Mode. Bit 2 of the register is set when a parameter change in Jitter Mode has made autoscale necessary. Bit 12 of the Operation Status Register (JIT) indicates that one of the enabled conditions in the Jitter Event Register has occurred. Restrictions Returned Format Jitter mode. Software revision A.04.00 and above (86100C instruments) or 86100D instruments with Option 100 or 200. [:JER] LER? Query :LER? Reads the Local (LCL) Event Register. A “1” is returned if a remote-to-local transition has taken place due to the front-panel Local key being pressed. A “0” is returned if a remote-to-local transition has not taken place. After the LCL Event Register is read, it is cleared. Once this bit is set, it can only be cleared by reading the Status Byte, reading the register with the LER? query, or sending a *CLS common command. Returned Format Example Programmer’s Guide [:LER] {1 | 0} 10 OUTPUT 707;":LER?" 109 4 Root Level Commands LTEE Command :LTEE Sets a mask into the Limit Test Event Enable register. A “1” in a bit position enables the corresponding bit in the Limit Event Register to set bit 8 in the Operation Status Register. is the decimal weight of the enabled bits. Only bits 0 and 1 of the Limit Test Event Register, are used at this time. The following table shows the enabled bits for each useful mask value. Bits that are not marked as enabled for a mask are blocked from affecting the operation status register. Table 23 Enabled Bits for Mask Values Mask Value Bit 1 FAIL Bit 0 COMP 0 1 Query Returned Format • 2 • 3 • • :LTEE? [:LTEE] LTER? Query :LTER? Returns the current value of the Limit Test Event Register as a decimal number and also clears this register. Bit 0 (COMP) of the Limit Test Event Register is set when the Limit Test completes. The Limit Test completion criteria are set by the LTESt:RUN command. Bit 1 (FAIL) of the Limit Test Event Register is set when the Limit Test fails. Failure criteria for the Limit Test are defined by the LTESt:FAIL command. Returned Format [:LTER] MODel? Query :MODel? {FRAMe | LMODule | RMODule} Returns the Agilentmodel number for the 86100C/D or module. The 86108A Precision Waveform Analyzer module only has one model number and either the LMODule and RMODule arguments can be used to return it. The query returns a string which is six-character alphanumeric model number in quotation marks. Output is determined by header and longform status as in Table 24. Returned Format [:MODel] Table 24 Model? Returned Format HEADER ON LONGFORM OFF ON • • 110 OFF • • • • Example Responses 86100C • • 86100C :MOD 86100C :MODEL 86100C Programmer’s Guide 4 Root Level Commands Example 10 OUTPUT 707;":Model? FRAME" MTEE Command :MTEE Sets a mask into the Mask Event Enable register. A “1” in a bit position enables the corresponding bit in the Mask Test Event Register to set bit 10 in the Operation Status Register. is the decimal weight of the enabled bits. Only bits 0 and 1 of the Mask Test Event Register are used at this time. The following table shows the enabled bits for each useful mask value. Bits that are not marked as enabled for a mask are blocked from affecting the operation status register. Table 25 Enabled Bits for Mask Values Mask Value Bit 1 FAIL Bit 0 COMP 0 1 Query Returned Format • 2 • 3 • • :MTEE? [:MTEE] MTER? Query :MTER? Returns the current value of the Mask Test Event Register as a decimal number and also clears this register. Bit 0 (COMP) of the Mask Test Event Register is set when the Mask Test completes. Bit 1 (FAIL) of the Mask Test Event Register is set when the Mask Test fails. This will occur whenever any sample is recorded within any region defined in the mask. Returned Format [:MTER] OPEE Command :OPEE Sets a mask in the Operation Status Enable register. Each bit that is set to a “1” enables that bit to set bit 7 in the Status Byte Register, and potentially causes an SRQ to be generated. Bit 5, Wait for Trig, is used. Other bits are reserved. The decimal weight of the enabled bits. Query :OPEE? The query returns the current value contained in the Operation Status Enable register as a decimal number. Returned Format [:OPEE] OPER? Query Programmer’s Guide :OPER? 111 4 Root Level Commands Returns the value contained in the Operation Status Register as a decimal number and also clears this register. This register is the summary of the CLCK bit (bit 7), LTEST bit (bit 8), ACQ bit (bit 9) and MTEST bit (bit 10). The CLCK bit is set by the Clock Recovery Event Register and indicates that a clock event has occurred. The LTEST bit is set by the Limit Test Event Register and indicates that a limit test has failed or completed. The ACQ bit is set by the Acquisition Event Register and indicates that an acquisition limit test has completed. The MTEST bit is set by the Mask Test Event Register and indicates that a mask limit test has failed or completed. Returned Format [:OPER] PTEE Command :PTEE Sets a mask into the Precision Timebase Event Enable register. A “1” in a bit position enables the corresponding bit in the Precision Timebase Event Register to set bit 11 in the Operation Status Register. is the decimal weight of the enabled bits. Only bit 0 of the Precision Timebase Event Register are used at this time. The useful mask values are shown in the following table. The following table shows the enabled bits for each useful mask value. Bits that are not marked as enabled for a mask are blocked from affecting the operation status register. Restrictions Software revision A.03.01 and above Table 26 Enabled Bits for Mask Values Mask Value Bit 0 LOSS 0 1 Query Returned Format • :PTEE? [:PTEE] PTER? Query PTER? Returns the current value of the Precision Timebase Event Register as a decimal number and also clears this register. Bit 0 (LOSS) of the Precision Timebase Event Register is set when loss of the time reference occurs. Time reference is lost when a change in the amplitude or frequency of the reference clock signal is detected. The Precision Timebase Event Register is read and cleared with the PTER? query. When the LOSS bit is set, it in turn sets the PTIME bit (bit 11) of the Operation Status Register. Results from the Precision Timebase Register can be masked by using the PTEE command to set the Precision Timebase Event Enable Register to the value 0. You enable the LOSS bit by setting the mask value to 1. Restrictions Returned Format Software revision A.03.01 and above [:MTER] PRINt Command 112 :PRINt Programmer’s Guide 4 Root Level Commands Outputs a copy of the screen to a printer or other device destination, such as a file, specified in the HARDcopy subsystem. You can specify the selection of the output and the printer using the HARDcopy subsystem commands. See *OPC (Operation Complete) command on page 94 for synchronization of PRINT operations. Example 10 OUTPUT 707;”:PRINT” RECall:SETup Command :RECall:SETup Recalls a setup that was saved in one of the analyzer’s setup memories. You can save setups using either the STORe:SETup command or the front panel. is the setup memory number, an integer, 0 through 9. Example 10 OUTPUT 707;":RECall:SETup 2" RUN Command :RUN [CHANnel ] Starts the instrument running where the instrument acquires waveform data according to its current settings. Acquisition runs repetitively until the analyzer receives a correspondent STOP command. is an integer, 1 through 4. The execution of the RUN command is subordinate to the status of ongoing limit tests. (see commands ACQuire:RUNTil on page 126, MTEST:RUNTil on page 225, and LTESt:RUNTil on page 205). The RUN command will not restart a full data acquisiton if the stop condition for a limit test has been met. Restrictions Example In TDR mode (software revision A.06.00 and above), the optional channel argument is not allowed. 10 OUTPUT 707;”:RUN” SERial Command :SERial {FRAMe | LMODule | RMODule}, Sets the serial number for the 86100C/D or module. Because the serial number is entered by Agilent Technologies, setting the serial number is not normally required unless the instrument is serialized for a different application. The argument is a ten-character alphanumeric serial number enclosed with quotation marks. The analyzer’s serial number is part of the string returned for the *IDN? query, described in Chapter 3, “Common Commands". The 86108A Precision Waveform Analyzer module only has one serial number and either the LMODule and RMODule arguments can be used to specify it. Example Query Returned Format Example 10 OUTPUT 707;":SERIAL FRAME,""1234A56789""" :SERial? {FRAMe | LMODule | RMODule} [:SERial] 10 OUTPUT 707;":SERIAL? FRAME" SINGle Command :SINGle Initiates a single acquisition when the next trigger event occurs. This command should be followed by *WAI, *OPC, or *OPC? in order to synchronize data acquisition with remote control. Programmer’s Guide 113 4 Root Level Commands Example 10 OUTPUT 707;":SINGLE" STOP Command :STOP [CHANnel ] Stops data acquisition for the active display. If no channel is specified, all active channels are affected. To restart the acquisition, use the RUN or SINGle command. is an integer, 1 through 4. Restrictions Example In TDR mode (software revision A.06.00 and above), the optional channel argument is not allowed. 10 OUTPUT 707;":STOP" STORe:SETup Command :STORe:SETup Saves the current instrument setup in one of the setup memories. is the setup memory number, an integer, 0 through 9. STORe:WAVeform Command :STORe:WAVeform {CHANnel | FUNCtion | WMEMory | RESPonse }, Copies a channel, function, stored waveform, or TDR response to a waveform memory or to color grade memory. The parameter preceding the comma specifies the source and can be any channel, function, response, color grade memory, or waveform memory. The parameter following the comma is the destination, and can be any waveform memory. is an integer, 1 through 4. Only channels or functions can be sources for color grade memory. is {WMEMory | CGMemory}. Restrictions Example This command operates on waveform and color grade gray scale data which is not compatible with Jitter Mode. Do not use this command in Jitter Mode. It generates a “Settings conflict” error. 10 OUTPUT 707;":STORE:WAVEFORM CHANNEL1,WMEMORY3" TER? Query :TER? Reads the Trigger Event Register. A “1” is returned if a trigger has occurred. A “0” is returned if a trigger has not occurred. Once this bit is set, you can clear it only by reading the register with the TER? query, or by sending a *CLS common command. After the Trigger Event Register is read, it is cleared. Returned Format Example [:TER] {1 | 0} 10 OUTPUT 707;":TER?" UEE Command :UEE Sets a mask into the User Event Enable register. A “1” in a bit position enables the corresponding bit in the User Event Register to set bit 1 in the Status Byte Register and, thereby, potentially cause an SRQ to be generated. Only bit 0 of the User Event Register is used at this time; all other bits are reserved. is the decimal weight of the enabled bits. Query 114 :UEE? Programmer’s Guide 4 Root Level Commands Returned Format [:UEE] UER? Query :UER? Returns the current value of the User Event Register as a decimal number and also clears this register. Bit 0 (LCL - Remote/Local change) is used. All other bits are reserved. Returned Format [:UER] VIEW Command :VIEW {CHANnel | FUNCtion | WMEMory | JDMemory | RESPonse | HISTogram | CGMemory} Turns on a channel, function, waveform memory, jitter data memory, TDR response, histogram, or color grade memory. is an integer, 1 through 4. NOTE Restrictions This command operates on waveform and color grade gray scale data which is not compatible with Jitter Mode. Do not use this command in Jitter Mode with an argument other than JDMemory. It generates a “Control is set to default” error for the HISTogram argument and “Illegal parameter value” error for other arguments. Software revision A.04.00 and above (86100C instruments) or 86100D instruments for jitter data memory argument. Example 10 OUTPUT 707;":VIEW CHANNEL1" See Also The BLANk command turns off a channel, function, waveform memory, TDR response, histogram, or color grade memory. Programmer’s Guide 115 4 116 Root Level Commands Programmer’s Guide Keysight 86100A/B/C/D Wide-Bandwidth Oscilloscope Programmer’s Guide 5 System Commands DATE 117 DSP 117 ERRor? 118 FCONfig 118 HEADer 119 LONGform 120 MODE 120 SETup 120 TIME 121 SYSTem subsystem commands control the way in which query responses are formatted, send and receive setup strings, and enable reading and writing to the advisory line of the analyzer. You can also set and read the date and time in the analyzer using the SYSTem subsystem commands. DATE Command :SYSTem:DATE , , Sets the date in the analyzer, and is not affected by the *RST common command. The argument specifies the day in the format <1. . . .31>. The argument specifies the month in the format <1, 2, . . . .12> | . The argument specifies the year in the format | . The values range from 1992 to 2035. Example The following example sets the date to July 1, 1997. 10 OUTPUT 707;":SYSTEM:DATE 7,1,97" Query :SYSTem:DATE? The query returns the current date in the analyzer. Returned Format Example [:SYSTem:DATE] > The following example queries the date. 10 DIM Date$ [50] 20 OUTPUT 707;":SYSTEM:DATE?" 30 ENTER 707; Date$ DSP Command :SYSTem:DSP Writes a quoted string, excluding quotation marks, to the advisory line of the instrument display. If you want to clear a message on the advisory line, send a null (empty) string. The argument is an alphanumeric character array up to 92 bytes long. 117 5 System Commands Example The following example writes the message, “Test 1” to the advisory line of the analyzer. 10 OUTPUT 707;":SYSTEM:DSP ""Test 1""" Query :SYSTem:DSP? Returns the last string written to the advisory line. This may be a string written with a SYSTem:DSP command, or an internally generated advisory. The string is actually read from the message queue. The message queue is cleared when it is read. Therefore, the displayed message can only be read once over the bus. Returned Format Example [:SYSTem:DSP] The following example places the last string written to the advisory line of the analyzer in the string variable, Advisory$. 10 DIM Advisory$[89]!Dimension variable 20 OUTPUT 707;":SYSTEM:DSP?" 30 ENTER 707;Advisory$ ERRor? Query :SYSTem:ERRor? [{NUMBer | STRing}] Returns the next error number in the error queue. Positive valued error numbers are instrument specific. Negative valued error numbers indicate a standard SCPI error. When either NUMBer or no parameter is specified in the query, only the numeric error code is output. When STRing is specified, the error number is output followed by a comma and a non-quoted string describing the error. Refer to Table 12 on page 42 for a list of error numbers, messages, and descriptions. Returned Format [:SYSTem:ERRor] [, ] The is anumeric error code. The describes the error. Example The following example reads the oldest error number and message in the error queue into the string variable, Condition$. 10 DIM Condition$[64]!Dimension variable 20 OUTPUT 707;":SYSTEM:ERROR? STRING" 30 ENTER 707;Condition$ The error queue is 30 errors deep and operates on a first-in, first-out (FIFO) basis. Successively sending the SYSTem:ERRor query returns the error numbers in the order that they occurred until the queue is empty. When the queue is empty, this query returns headers of 0, “No error.” Any further queries return zeros until another error occurs. Note that front-panel generated errors are also inserted in the error queue and the Event Status Register. NOTE See Also Send the *CLS common command to clear the error queue and Event Status Register before you send any other commands or queries. “Error Messages" on page 41 for more information on error messages and their possible causes. FCONfig Command :SYSTem:FCONfig {LEGacy | HYBRid | STANDard} Changes the configuration of the 86100D. In LEGacy configuration, the user interface controlling the instrument is the version that the instrument booted into in software revisions below A.12.00. The programming commands documented in this book apply to LEGacy configuration. 118 Programmer’s Guide 5 System Commands In HYBRid configuration, the instrument user interface is FlexDCA or FlexDCA N1010A on a PC controlling the legacy user interface. This configuration was available on software revisions A.10.01 through A.12.00. Use the programming commands documented in FlexDCA’s online help. With the instrument in HYBRid configuration, click Help > Contents to locate the programming commands. In STANDard configuration the FlexDCA user interface directly controls the instrument. By default, the instrument boots up in this configuraton, which supports one-slot mini modules. Use the programming commands documented in FlexDCA’s online help. With the instrument in STANDard configuration, click Help > Contents to locate the programming commands. The features available vary between the LEGacy, HYBRid, and STANDard configurations. Consult the HYBRid or STANDard help system to learn about the differences. NOTE Restrictions Example Query Returned Format Software revision A.12.00 and above. 10 OUTPUT 707;":SYSTEM:FONFIG HYBRID" :SYSTem:FCONFIG? [:SYSTem:FCONFIG] {LEGacy | HYBRid | STANDard} HEADer Command :SYSTem:HEADer {{ON | 1} | {OFF | 0}} Specifies whether the instrument will output a header for query responses. When SYSTem:HEADer is set to ON, the query responses include the command header. Turn headers off when returning values to numeric variables. Headers are always off for all common command queries because headers are not defined in the IEEE 488.2 standard. Example The following example sets up the analyzer to output command headers with query responses. 10 OUTPUT 707;":SYSTEM:HEADER ON" Query Returned Format Example :SYSTem:HEADer? [:SYSTem:HEADer] {1 | 0} This example examines the header to determine the size of the learn string. Memory is then allocated to hold the learn string before reading it. To output the learn string, the header is sent, then the learn string and the EOF. 10 DIM Header$[64] 20 OUTPUT 707;"syst:head on" 30 OUTPUT 707;":syst:set?" 40 More_chars: ! 50 ENTER 707 USING "#,A";This_char$ 60 Header$=Header$&This_char$ 70 IF This_char$<>"#" THEN More_chars 80 ! 90 ENTER 707 USING "#,D";Num_of_digits 100 ENTER 707 USING "#,"&VAL$(Num_of_digits)&"D";Set_size 110 Header$=Header$&"#"&VAL$(Num_of_digits)&VAL$(Set_size) 120! 130 ALLOCATE INTEGER Setup(1:Set_size) 140 ENTER 707 USING "#,B";Setup(*) 150 ENTER 707 USING "#,A";Eof$ 160 ! 170 OUTPUT 707 USING "#,-K";Header$ 180 OUTPUT 707 USING "#,B";Setup(*) 190 OUTPUT 707 USING "#,A";Eof$ 200 Programmer’s Guide 119 5 System Commands LONGform Command :SYSTem:LONGform {ON | 1 | OFF | 0} Specifies the format for query responses. If the LONGform is set to OFF, command headers and alpha arguments are sent from the instrument in the short form (abbreviated spelling). If LONGform is set to ON, the whole word is output. This command has no effect on input headers and arguments sent to the instrument. Headers and arguments may be sent to the instrument in either the long form or short form, regardless of the current state of the LONGform command. Example The following example sets the format for query response from the instrument to the short form (abbreviated spelling). 10 OUTPUT 707;":SYSTEM:LONGFORM OFF" Query :SYSTem:LONGform? The query returns the current state of the SYSTem:LONGform command. Returned Format Example [:SYSTem:LONGform] {0 | 1} 120 OUTPUT 707;":SYSTEM:LONGFORM?" MODE Command :SYSTem:MODE {EYE | OSCilloscope | TDR | JITTer} Sets the system mode. Specifying Eye/Mask mode, turns off all active channels except the lowest numbered channel. Changing to Eye/Mask mode turns off averaging for all modes unless Pattern Lock (:TRIGger:PLOCk) is turned on. If a TDR/TDT module is present, changing to TDR/TDT mode using this command turns on averaging for both TDR/TDT and Oscilloscope modes. Because some DCA features are unavailable in Jitter Mode, refer to “Commands Unavailable in Jitter Mode” on page 39. Restrictions Example Query Returned Format Example Software revision A.04.00 and above (86100C instruments) or 86100D instruments for Jitter mode argument. Jitter mode is only available on 86100C/D mainframes with Option 100 or 200. 10 OUTPUT 707;":SYSTEM:MODE EYE" :SYSTem:MODE? [:SYSTem:MODE] {EYE | OSC | TDR | JITT} 20 OUTPUT 707;":SYSTEM:MODE?" SETup Command :SYSTem:SETup Sets up the instrument as defined by the data in the setup string from the controller. is a string, consisting of bytes of setup data. The number of bytes is a dynamic number that is read and allocated by the analyzer’s software. Example The following example sets up the instrument as defined by the setup string stored in the variable, Set$. # is an BASIC image specifier that suppresses the automatic output of the EOI sequence following the last output item. K is an BASIC image specifier that outputs a number or string in standard form with no leading or trailing blanks. 10 OUTPUT 707 USING "#,-K";":SYSTEM:SETUP ";Set$ Query 120 :SYSTem:SETup? Programmer’s Guide 5 System Commands The query outputs the instrument's current setup to the controller in binary block data format as defined in the IEEE 488.2 standard. When headers and LONGform are on, the SYSTem:SETup query operates the same as the *LRN query in the common commands. Otherwise, *LRN and SETup are not interchangeable. Returned Format [:SYSTem:SETup] #NX...X The first character in the setup data string is a number added for disk operations. Example The following example stores the current instrument setup in the string variable, Set$. -K is an BASIC image specifier which places the block data in a string, including carriage returns and line feeds, until EOI is true, or when the dimensioned length of the string is reached. 10 20 30 40 50 DIM Set$[15000]!Dimension variable OUTPUT 707;":SYSTEM:HEADER OFF"!Response headers off OUTPUT 707;":SYSTEM:SETUP?" ENTER 707 USING "-K";Set$ END TIME Command :SYSTem:TIME , , Sets the time in the instrument, and is not affected by the *RST common command. is 0. . . .23. is 0. . . .59. is 0. . . .59. Example Query Returned Format Programmer’s Guide 10 OUTPUT 707;":SYSTEM:TIME 10,30,45" :SYSTem:TIME? [:SYSTem:TIME] , , 121 5 122 System Commands Programmer’s Guide Keysight 86100A/B/C/D Wide-Bandwidth Oscilloscope Programmer’s Guide 6 Acquire Commands AVERage 123 BEST 124 COUNt 124 EYELine 124 LTESt 124 POINts 125 REYE 125 REYE:ASKew 125 REYE:INTerval 126 RUNTil 126 SSCReen 127 SSCReen:AREA 128 SSCReen:IMAGe 128 SWAVeform 128 SWAVeform:RESet 129 The ACQuire subsystem commands set up conditions for acquiring waveform data, including the DIGitize root level command. The commands in this subsystem select the number of averages and the number of data points. This subsystem also includes commands to set limits on how much data is acquired, and specify actions to execute when acquisition limits are met. AVERage Command :ACQuire:AVERage {{ON | 1} | {OFF | 0}} Enables or disables averaging. When ON, the analyzer acquires multiple data values for each time bucket, and averages them. When OFF, averaging is disabled. To set the number of averages, use the :ACQuire:COUNt command described later in this chapter. Do not use this command in Jitter Mode. It generates a “Settings conflict” error. NOTE Query Returned Format Example :ACQuire:AVERage? [:ACQuire:AVERage] {1 | 0} 10 OUTPUT 707;":ACQUIRE:AVERAGE ON" 123 6 Acquire Commands BEST Command :ACQuire:BEST {THRuput | FLATness} When averaging is enabled with ACQuire:AVERage, the FLATness option improves the step flatness by using a signal processing algorithm within the instrument. You should use this option when performing TDR measurements or when step flatness is important. The THRuput option improves the instrument’s throughput and should be used whenever best flatness is not required. Do not use this command in Jitter Mode. It generates a “Settings conflict” error. NOTE Query Returned Format Example :ACQuire:BEST? [:ACQuire:BEST] {THRuput | FLATness} 10 OUTPUT 707;":ACQUIRE:BEST FLATNESS" COUNt Command :ACQuire:COUNt Sets the number of averages for the waveforms. In the AVERage mode, the ACQuire:COUNt command specifies the number of data values to be averaged for each time bucket before the acquisition is considered complete for that time bucket. is an integer, 1 to 4096, specifying the number of data values to be averaged. Query Returned Format Example :ACQuire:COUNt? [:ACQuire:COUNt] 10 OUTPUT 707;":ACQUIRE:COUNT 16" EYELine Command :ACQuire:EYELine {{ON | 1} | {OFF | 0}} Enables or disables eyeline mode. It is only available when pattern lock is turned on in Oscilloscope or Eye/Mask modes. When eyeline is turned on, the relative trigger bit is incremented after each acquisition. When combined with averaging, averaged eyes can be acquired. Pattern lock and eyeline are only available on an 86100C-001 or 86100D-ETR instruments. Restrictions Query Returned Format Example Software revision A.04.00 and above (86100C instruments) or 86100D instruments. :ACQuire:EYELine? [:ACQuire:EYELine] {1 | 0} 10 OUTPUT 707; ":ACQUIRE:EYELINE ON" LTESt Command :ACQuire:LTESt [ALL | INDividual] Sets the mode for acquisition limit tests. The default is ALL. When it is set to INDividual, the :ACQuire:RUNtil command can be used with the optional channel parameter to specify conditions for each channel individually. When it is set to ALL, acquisition limit tests are performed on all channels simultaneously. 124 Programmer’s Guide 6 Acquire Commands Restrictions Query Returned Format Example In TDR mode (software revision A.06.00 and above), the optional INDividual argument is not allowed. :ACQuire:LTESt? [:ACQuire:LTESt] {ALL | IND} 10 OUTPUT 707;":ACQUIRE:LTEST ALL" POINts Command :ACQuire:POINts {AUTO | } Sets the requested memory depth for an acquisition. Always query the points value with the WAVeform:POINts query or WAVeform:PREamble to determine the actual number of acquired points. You can set the points value to AUTO, which allows the analyzer to select the number of points based upon the sample rate and time base scale. is an integer representing the memory depth. The points value range is 16 to 16,384 points. See also :WAVeform:DATA. Restrictions Query Returned Format Example This command operates on waveform data which is not compatible with Jitter Mode. Do not use this command in Jitter Mode. It generates a “Settings conflict” error. :ACQuire:POINts? [:ACQuire:POINts] 10 OUTPUT 707;":ACQUIRE:POINTS 500" REYE Command :ACQuire:REYE {ON | OFF} In Eye/Mask mode, turns on and off Rapid Eye data acquisition, which significantly reduces the time required to acquire the waveform samples. Rapid Eye employs several techniques that improve measurement efficiency. Use the command “REYE:INTerval" on page 126 to select the number of UI (Unit Intervals) to acquire the data from. The database is expanded as required, while keeping the displayed eye (usually 1.6 UIs) unchanged. All acquired samples, even those residing in an incomplete UI area, are properly applied. For example, after an autoscale, 1.6 UIs are displayd and 40% of the samples occur before or after the UI area. With Rapid Eye on, these sample points will now be recorded and included in their proper position within the UI. Use the command “BRATe" on page 329 to enter the bit rate. When multiple eye diagrams are displayed, use the command “REYE:ASKew" on page 125 to enable an autoscale to align the eyes using software delay. When using this Rapid Eye with waveform acquisition limits, set the record length using “POINts" on page 125 to AUTo. Restrictions Query Returned Format Example Software revision A.10.60 and above. On 86100D instruments, Rapid Eye is enabled. 86100C instruments require software Option 500, “Productivity Package.” :ACQuire:REYE? [:ACQuire:REYE] {ON | OFF} 10 OUTPUT 707;":ACQUIRE:REYE ON" REYE:ASKew Command Programmer’s Guide :ACQuire:REYE:ASKew {ON | OFF} 125 6 Acquire Commands When using this Rapid EyeIf with multiple eye diagrams displayed, enables an autoscale to align the eyes when rapid eye is on. The eye diagrams are aligned using software delay. Restrictions Query Returned Format Example Software revision A.10.60 and above. On 86100D instruments, Rapid Eye is enabled. 86100C instruments require software Option 500, “Productivity Package.” :ACQuire:REYE:ASKew? [:ACQuire:REYE:ASKew] {ON | OFF} 10 OUTPUT 707;":ACQUIRE:REYE:ASKew ON" REYE:INTerval Command :ACQuire:REYE:INTerval } Enters an integer that specifies the number of UI (Unit Intervals) to acquire the data from for a Rapid Eye. The database is expanded as required for the number of UIs, while keeping the displayed eye (usually 1.6 UIs) unchanged. Use the command “REYE" on page 125 to turn on Rapid Eye measurements.. Restrictions Query Returned Format Example Software revision A.10.60 and above. On 86100D instruments, Rapid Eye is enabled. 86100C instruments require software Option 500, “Productivity Package.” :ACQuire:REYE:INTerval? [:ACQuire:POINts:INTerval] 10 OUTPUT 707;":ACQUIRE:REYE:INTerval 2" RUNTil Command :ACQuire:RUNTil {OFF | WAVeforms, | SAMPles, | PATTerns, }[,CHANnel ] Selects the acquisition run until mode. The RUNTil command does not initiate run mode, for which you need to send the root-level command “RUN" on page 113. For this reason, you will need to send RUNTil to set up the acquisition conditions followed by RUN to start continuous sweeps. The acquisition may be set to run until n waveforms, n patterns, or n samples have been acquired, or to run forever (OFF). If more than one run until criteria is set, then the instrument will act upon the completion of whichever run until criteria is achieved first. The PATTerns argument is valid only when the Eyeline feature is on or when the instrument is in Jitter Mode. The optional channel parameter can be set to specify RUNTil conditions on each channel individually when the :ACQuire:LTESt command is set to INDividual. If the acquisition limit test mode is set to INDividual and the :ACQuire:RUNTil OFF command is sent with no channel specified, all channels will be set to OFF. To turn off acquisition limit tests for an individual channel, you must specify the channel. is an integer, 1 through 231–1. is an integer, 1 through 231–1. is an integer, 1 through 231–1. is an integer, 1 through 4. Restrictions Query Software revision A.04.00 and above (86100C instruments) or 86100D instruments for the PATTerns argument. :ACQuire:RUNTil? [CHANnel ] Returns the currently selected run until state. If the channel parameter is specified, the run until state of the specified channel is returned. 126 Programmer’s Guide 6 Acquire Commands Returned Format Examples [:ACQuire:RUNTil] {OFF | WAVeform, | PATT, | SAMPles, } 10 OUTPUT 707;”:ACQuire:RUNTIL SAMPLES,200” 20 OUTPUT 707;”:RUN” The following example specifies that Channel 1 acquisition runs until 300 waveforms have been obtained. write_IO (“:ACQuire:LTESt IND”); write_IO (“:ACQuire:RUNTil WAVeforms, 300, CHANnel1”); write_IO (“:RUN”); SSCReen Command :ACQuire:SSCReen {OFF | DISK [,