Agilent 90000A, 90000X programmers reference

Infiniium
90000A/90000X Programmer’s Reference
Agilent Technologies
Publication Number 54913-97018 September 2010
This reference applies directly to software revision code 3.00 and later.
Copyright Agilent Technologies 2010 All Rights Reserved.
90000A/90000X Series Infiniium Oscilloscopes
In This Book
This book is your guide to programming the Infiniium 90000A and 90000X Series Oscilloscopes.
Chapters 1 through 5 give you an introduction to programming the oscilloscopes, along with necessary conceptual information. These chapters describe basic program communications, interface, syntax, data types, and status reporting.
Chapter 6 shows example BASIC and C programs, and describes chunks of one program to show you some typical applications. The BASIC and C example programs are also shipped on a disk with the oscilloscope.
The next chapters describe the commands used to program the oscilloscopes. Each chapter describes the set of commands that belong to an individual subsystem, and explains the function of each command.
The last chapter describes error messages.
ii
Contents
1 Introduction to Programming
Communicating with the Oscilloscope 1-3 Output Command 1-4 Device Address 1-4 Instructions 1-4 Instruction Header 1-4 White Space (Separator) 1-5 Braces 1-5 Ellipsis 1-5 Square Brackets 1-5 Command and Query Sources 1-5 Program Data 1-6 Header Types 1-7 Duplicate Mnemonics 1-9 Query Headers 1-10 Program Header Options 1-11 Character Program Data 1-11 Numeric Program Data 1-12 Embedded Strings 1-13 Program Message Terminator 1-13 Common Commands within a Subsystem 1-14 Selecting Multiple Subsystems 1-14 Programming Getting Started 1-14 Initialization 1-15 Example Program using HP Basic 1-16 Using the DIGITIZE Command 1-17 Receiving Information from the Oscilloscope 1-19 String Variable Example 1-20 Numeric Variable Example 1-20 Definite-Length Block Response Data 1-21 Multiple Queries 1-22 Oscilloscope Status 1-22
2 Connectivity
LAN Interface Connector 2-3 GPIB Interface Connector 2-3 Default Startup Conditions 2-4 Interface Capabilities 2-5 GPIB Command and Data Concepts 2-6 Communicating Over the GPIB Interface 2-7 Communicating Over the LAN Interface 2-8 Communicating via Telnet and Sockets 2-10 Bus Commands 2-12
3 Message Communication and System Functions
Contents-1
Contents
Protocols 3-3
4 Status Reporting
Status Reporting Data Structures 4-5 Status Byte Register 4-8 Service Request Enable Register 4-10 Message Event Register 4-10 Trigger Event Register 4-10 Standard Event Status Register 4-11 Standard Event Status Enable Register 4-12 Operation Status Register 4-13 Operation Status Enable Register 4-14 Mask Test Event Register 4-15 Mask Test Event Enable Register 4-16 Acquisition Done Event Register 4-17 Process Done Event Register 4-17 Trigger Armed Event Register 4-17 Auto Trigger Event Register 4-17 Error Queue 4-18 Output Queue 4-18 Message Queue 4-19 Clearing Registers and Queues 4-19
5 Remote Acquisition Synchronization
Introduction 5-2 Programming Flow 5-2 Setting Up the Oscilloscope 5-2 Acquiring a Waveform 5-2 Retrieving Results 5-3 Acquisition Synchronization 5-3 Single Shot Device Under Test (DUT) 5-5 Averaging Acquisition Synchronization 5-6
6 Programming Conventions
Truncation Rule 6-3 The Command Tree 6-4 Infinity Representation 6-12 Sequential and Overlapped Commands 6-12 Response Generation 6-12 EOI 6-12
7 Sample Programs
Sample Program Structure 7-3 Sample C Programs 7-4 Listings of the Sample Programs 7-14 gpibdecl.h Sample Header 7-15
Contents-2
learnstr.c Sample Program 7-17 sicl_IO.c Sample Program 7-21 natl_IO.c Sample Program 7-2 6 init.bas Sample Program 7-30 lrn_str.bas Sample Program 7-38
8 Acquire Commands
AVERage 8-3 AVERage:COUNt 8-4 COMPlete 8-5 COMPlete:STATe 8-7 BANDwidth 8-8 INTerpolate 8-9 MODE 8-10 POINts 8-12 POINts:AUTO 8-16 RESPonse 8-17 SEGMented:COUNt 8-18 SEGMented:INDex 8-19 SEGMented:TTAGs 8-20 SRATe (Sample RATe) 8-21 SRATe Sample Rate Tables 8 -23 SRATe:AUTO 8-24
Contents
9 Bus Commands
B1:TYPE 9-3
10 Calibration Commands
Oscilloscope Calibration 10-3 Probe Calibration 10-4
Calibration Commands 10-5
OUTPut 10-6 SKEW 10-7 STATus? 10-8
11 Channel Commands
BWLimit 11-4 COMMonmode 11-5 DIFFerential 11-6 DIFFerential:SKEW 11-7 DISPlay 11-8 DISPlay:AUTO 11-9 DISPlay:OFFSet 11-11 DISPlay:RANGe 11-12 DISPlay:SCALe 11-14
Contents-3
Contents
INPut 11-16 ISIM:APPLy 11-17 ISIM:BANDwidth 11-19 ISIM:BWLimit 11-21 ISIM:CONVolve 11-23 ISIM:DEConvolve 11-24 ISIM:DELay 11-25 ISIM:SPAN 11-27 ISIM:STATe 11-29 OFFSet 11-31 LABel 11-32 OFFSet 11-33 PROBe 11-34 PROBe:ATTenuation 11-36 PROBe:COUPling 11-37 PROBe:EADapter 11-38 PROBe:ECOupling 11-40 PROBe:EXTernal 11-42 PROBe:EXTernal:GAIN 11-43 PROBe:EXTernal:OFFSet 11-45 PROBe:EXTernal:UNITs 11-47 PROBe:HEAD:ADD 11-49 PROBe:HEAD:DELete ALL 11-50 PROBe:HEAD:SELect 11-51 PROBe:GAIN 11-52 PROBe:ID? 11-53 PROBe:SKEW 11-54 PROBe:STYPe 11-55 RANGe 11-56 SCALe 11-57 UNITs 11-58
12 Common Commands
*CLS (Clear Status) 12-4 *ESE (Event Status Enable) 12-5 *ESR? (Event Status Register) 12-7 *IDN? (Identification Number) 12-9 *LRN? (Learn) 12-10 *OPC (Operation Complete) 12-12 *OPT? (Option) 12-13 *PSC (Power-on Status Clear) 12-14 *RCL (Recall) 12-15 *RST (Reset) 12-16 *SAV (Save) 12-17 *SRE (Service Request Enable) 12-18
Contents-4
*STB? (Status Byte) 12-20 *TRG (Trigger) 12-22 *TST? (Test) 12-23 *WAI (Wait) 12-24
13 Disk Commands
CDIRectory 13-3 COPY 13-4 DELete 13-5 DIRectory? 13-6 LOAD 13-7 MDIRectory 13-8 PWD? 13-9 SAVE:IMAGe 13-10 SAVE:JITTer 13-11 SAVE:MEASurements 13 -12 SAVE:SETup 13-13 SAVE:WAVeform 13-14 HDF5 Example 13-16 CSV and TSV Header Format 13-17 BIN Header Format 13-20 SEGMented 13-36
Contents
14 Display Commands
CGRade 14-3 CGRade:LEVels? 14-5 COLumn 14-7 CONNect 14-8 DATA? 14-9 GRATicule 14-10 LABel 14-12 LINE 14-13 PERSistence 14-14 ROW 14-15 SCOLor 14-16 STRing 14-19 TAB 14-20 TEXT 14-21
15 Function Commands
FUNCtion<N>? 15-4 ABSolute 15-5 ADD 15-6 AVERage 15-7 COMMonmode 15-8 DIFF (Differentiate) 15-9
Contents-5
Contents
DISPlay 15-10 DIVide 15-11 FFT:FREQuency 15-12 FFT:REFerence 15-13 FFT:RESolution? 15-14 FFT:WINDow 15-15 FFTMagnitude 15-17 FFTPhase 15-18 HIGHpass 15-19 HORizontal 15-20 HORizontal:POSition 15-21 HORizontal:RANGe 15-22 INTegrate 15-23 INVert 15-24 LOWPass 15-25 MAGNify 15-2 6 MAXimum 15-27 MINimum 15-28 MULTiply 15-29 OFFSet 15-30 RANGe 15-31 SMOoth 15-32 SQRT 15-33 SQUare 15-34 SUBTract 15-35 VERSus 15-36 VERTical 15-37 VERTical:OFFSet 15-38 VERTical:RANGe 15-39
16 Hardcopy Commands
AREA 16-3 DPRinter 16-4 FACTors 16-6 IMAGe 16-7 PRINters? 16-8
17 Histogram Commands
AXIS 17-4 MODE 17-5 SCALe:SIZE 17-6 WINDow:DEFault 17-7 WINDow:SOURce 17-8 WINDow:LLIMit 17-9 WINDow:RLIMit 17-10 WINDow:BLIMit 17-11
Contents-6
WINDow:TLIMit 17-12
18 InfiniiScan (ISCan) Commands
DELay 18-3 MEASurement:FAIL 18-4 MEASurement:LLIMit 18-5 MEASurement 18-6 MEASurement:ULIMit 18-7 MODE 18-8 NONMonotonic:EDGE 18-9 NONMonotonic:HYSTeresis 18-10 NONMonotonic:SOURce 18-11 RUNT:HYSTeresis 18-12 RUNT:LLEVel 18-13 RUNT:SOURce 18-14 RUNT:ULEVel 18-15 SERial:PATTern 18-16 SERial:SOURce 18-17 ZONE<N>:MODE 18-18 ZONE<N>:PLACement 18-19 ZONE:SOURce 18-20 ZONE<N>:STATe 18-21
Contents
19 Limit Test Commands
FAIL 19-3 LLIMit 19-4 MEASurement 19-5 RESults? 19-6 TEST 19-7 ULIMit 19-8
20 Marker Commands
CURSor? 20-3 MODE 20-4 X1Position 20-5 X2Position 20-6 X1Y1source 20-7 X2Y2source 20-9 XDELta? 20-11 Y1Position 20-12 Y2Position 20-13 YDELta? 20-14
21 Mask Test Commands
ALIGn 21-4 AlignFIT 21-5
Contents-7
Contents
AMASk:CREate 21-7 AMASk:SOURce 21-8 AMASk:SAVE | STORe 21-9 AMASk:UNITs 21-10 AMASk:XDELta 21-11 AMASk:YDELta 21-13 AUTO 21-15 AVERage 21-16 AVERage:COUNt 21-17 COUNt:FAILures? 21-18 COUNt:FUI? 21-19 COUNt:FWAVeforms? 21-20 COUNt:UI? 21-21 COUNt:WAVeforms? 21-22 DELete 21-23 ENABle 21-24 FOLDing 21-25 FOLDing:BITS 21-26 HAMPlitude 21-27 IMPedance 21-28 INVert 21-30 LAMPlitude 21-31 LOAD 21-32 NREGions? 21-33 PROBe:IMPedance? 21-34 RUMode 21-35 RUMode:SOFailure 21-37 SCALe:BIND 21-38 SCALe:X1 21-39 SCALe:XDELta 21-40 SCALe:Y1 21-41 SCALe:Y2 21-42 SOURce 21-43 STARt | STOP 21-44 STIMe 21-45 TITLe? 21-46 TRIGger:SOURce 21-47
22 Measure Commands
AREA 22-9 BINTerval 22-10 BPERiod 22-11 BWIDth 22-12 CDRRATE 22-13 CGRade:CROSsing 22-15
Contents-8
CGRade:DCDistortion 22-16 CGRade:EHEight 22-17 CGRade:EWIDth 22-18 CGRade:EWINdow 22-19 CGRade:JITTer 22-21 CGRade:QFACtor 22-22 CLEar 22-23 CLOCk 22-24 CLOCk:METHod 22-25 CLOCk:VERTical 22-28 CLOCk:VERTical:OFFSet 22-29 CLOCk:VERTical:RANGe 22-30 CROSsing 22-31 CTCDutycycle 22 -32 CTCJitter 22-34 CTCNwidth 22-36 CTCPwidth 22-38 DATarate 22-40 DELTatime 22-43 DELTatime:DEFine 22-45 DUTYcycle 22-47 ETOedge 22-49 FALLtime 22-50 FFT:DFRequency 22-52 FFT:DMAGnitude 22-54 FFT:FREQuency 22-56 FFT:MAGNitude 22-58 FFT:PEAK1 22-60 FFT:PEAK2 22-61 FFT:THReshold 22-62 FREQuency 22-63 HISTogram:HITS 22-66 HISTogram:M1S 22-68 HISTogram:M2S 22-70 HISTogram:M3S 22-72 HISTogram:MAX? 22-74 HISTogram:MEAN? 22-75 HISTogram:MEDian? 22-7 6 HISTogram:MIN? 22-77 HISTogram:PEAK? 22-78 HISTogram:PP? 22-79 HISTogram:STDDev? 22-80 HOLDtime 22-81 JITTer:HISTogram 22-84 JITTer:MEASurement 22-85
Contents
Contents-9
Contents
JITTer:SPECtrum 22-86 JITTer:SPECtrum:HORizontal 22-87 JITTer:SPECtrum:HORizontal:POSition 22-88 JITTer:SPECtrum:HORizontal:RANGe 22-90 JITTer:SPECtrum:VERTical 22-91 JITTer:SPECtrum:VERTical:OFFSet 22-92 JITTer:SPECtrum:VERTical:RANGe 22-93 JITTer:SPECtrum:WINDow 22-94 JITTer:STATistics 22-95 JITTer:TRENd 22-96 JITTer:TRENd:SMOoth 22-97 JITTer:TRENd:SMOoth:POINts 22-98 JITTer:TRENd:VERTical 22-99 JITTer:TRENd:VERTical:OFFSet 22-100 JITTer:TRENd:VERTical:RANGe 22-101 NAME 22-102 NCJitter 22-103 NPERiod 22-105 NPULses 22-106 NUI 22-107 NWIDth 22-108 OVERshoot 22-110 PAMPlitude 22-112 PBASe 22-113 PERiod 22-114 PHASe 22-116 PPULses 22-118 PREShoot 22-119 PTOP 22-121 PWIDth 22-122 QUALifier<M>:CONDition 22-124 QUALifier<M>:SOURce 22-125 QUALifier<M>:STATe 22-1 26 RESults? 22-127 RISetime 22-130 RJDJ:ALL? 22-132 RJDJ:BANDwidth 22-134 RJDJ:BER 22-135 RJDJ:EDGE 22-137 RJDJ:INTerpolate 22-138 RJDJ:MODe 22-139 RJDJ:PLENgth 22-140 RJDJ:SOURce 22-142 RJDJ:STATe 22-144 RJDJ:TJRJDJ? 22-145
Contents-10
RJDJ:UNITs 22-146 SCRatch 22-147 SENDvalid 22-148 SETuptime 22-149 SLEWrate 22-152 SOURce 22-154 STATistics 22-156 TEDGe 22-157 THResholds:ABSolute 22-159 THResholds:HYSTeresis 22-161 THResholds:METHod 22-163 THResholds:PERCent 22-165 THResholds:TOPBase:METHod 22-167 THResholds:TOPBase:ABSolute 22-169 TIEClock2 22-171 TIEData 22-174 TIEFilter:STARt 22-176 TIEFilter:STATe 22-177 TIEFilter:STOP 22-178 TIEFilter:TYPE 22-179 TMAX 22-180 TMIN 22-182 TVOLt 22-184 UITouijitter 22-186 UNITinterval 22-187 VAMPlitude 22-189 VAVerage 22-191 VBASe 22-193 VLOWer 22-195 VMAX 22-197 VMIDdle 22-199 VMIN 22-201 VOVershoot 22-203 VPP 22-204 VPReshoot 22-206 VRMS 22-207 VTIMe 22-209 VTOP 22-211 VUPPer 22-213 WINdow 22-215
Contents
23 Root Level Commands
ADER? (Acquisition Done Event Register) 23-4 AER? (Arm Event Register) 23-5 ATER? (Auto Trigger Event Register) 23-6
Contents-11
Contents
AUToscale 23-7 AUToscale:CHANnels {ALL | DISPlayed} 2 3-8 AUToscale:PLACement {STACk | SEParate | OVERlay} 23-9 AUToscale:VERTical 23-10 BEEP 23-11 BLANk 23-12 CDISplay 23-13 DIGitize 23-14 MTEE 23-15 MTER? 23-16 MODel? 23-17 OPEE 23-18 OPER? 23-19 OVLRegister? 23-20 PDER? (Processing Done Event Register) 23-21 PRINt 23-22 RECall:SETup 23-23 RUN 23-24 SERial (Serial Number) 23-25 SINGle 23-26 STATus? 23-27 STOP 23-28 STORe:JITTer 23-29 STORe:SETup 23-30 STORe:WAVeform 23-31 TER? (Trigger Event Register) 23-32 VIEW 23-33
24 Self-Test Commands
CANCel 24-3 SCOPETEST 24-4
25 System Commands
DATE 25-3 DEBug 25-4 DSP 25-6 ERRor? 25-7 HEADer 25-8 LOCK 25-10 LONGform 25-11 PRESet 25-13 SETup 25-14 TIME 25-16
26 Time Base Commands
POSition 26-3
Contents-12
RANGe 26-4 REFClock 26-5 REFerence 26-6 SCALe 26-7 VIEW 26-8 WINDow:DELay 26-9 WINDow:POSition 26-11 WINDow:RANGe 26-12 WINDow:SCALe 26-13
27 Trigger Commands
Organization of Trigger Modes and Commands 27-4 Summary of Trigger Modes and Commands 27-5
AND:ENABle 27-6 AND:SOURce 27-7 COMM:BWIDth 27-8 COMM:ENCode 27-9 COMM:PATTern 27-10 COMM:POLarity 27-11 COMM:SOURce 27-12 DELay:ARM:SOURce 27-13 DELay:ARM:SLOPe 27-14 DELay:EDELay:COUNt 2 7-15 DELay:EDELay:SOURce 27-16 DELay:EDELay:SLOPe 27-17 DELay:MODE 27-18 DELay:TDELay:TIME 27-19 DELay:TRIGger:SOURce 27-20 DELay:TRIGger:SLOPe 27-21 EDGE:SLOPe 27-22 EDGE:SOURce 27-23 GLITch:POLarity 27-24 GLITch:SOURce 27-25 GLITch:WIDTh 27-26 HOLDoff 27-27 HOLDoff:MAX 27-28 HTHReshold 27-29 HYSTeresis 27-30 LEVel 27-31 LTHReshold 27-32 MODE 27-33 PATTern:CONDition 27-36 PATTern:LOGic 27-37
Contents
Contents-13
Contents
PWIDth:DIRection 27-38 PWIDth:POLarity 27-39 PWIDth:SOURce 27-40 PWIDth:TPOint 27-41 PWIDth:WIDTh 27-42 RUNT:POLarity 27-4 3 RUNT:QUALified 27-44 RUNT:SOURce 27-45 RUNT:TIME 27-46 SEQuence:TERM1 27-47 SEQuence:TERM2 27-47 SEQuence:RESet:ENABle 27-48 SEQuence:RESet:TYPE 27-49 SEQuence:RESet:EVENt 27-50 SEQuence:RESet:TIME 27-51 SEQuence:RESet:WAIT:ENABle 27-52 SEQuence:RESet:WAIT:TIME 27-53 SHOLd:CSOurce 27-54 SHOLd:CSOurce:EDGE 27-56 SHOLd:DSOurce 27-57 SHOLd:HoldTIMe (HTIMe) 27-58 SHOLd:MODE 27-59 SHOLd:SetupTIMe 27-60 STATe:CLOCk 27-61 STATe:LOGic 27-62 STATe:LTYPe 27-63 STATe:SLOPe 27-64 SWEep 27-65 TIMeout:CONDition 27-66 TIMeout:SOURce 27-67 TIMeout:TIME 27-68 TRANsition:DIRection 27-69 TRANsition:SOURce 27-70 TRANsition:TIME 27-71 TRANsition:TYPE 27 -72 TV:LINE 27-73 TV:MODE 27-74 TV:POLarity 27-75 TV:SOURce 27-76 TV:STANdard 27-77 TV:UDTV:ENUMber 27-78 TV:UDTV:HSYNc 27-79 TV:UDTV:HTIMe 27-80 TV:UDTV:PGTHan 27-81 TV:UDTV:POLarity 27-82
Contents-14
WINDow:CONDition 27-83 WINDow:SOURce 27-84 WINDow:TIME 27-85 WINDow:TPOint 27-86
28 Waveform Commands
BANDpass? 28-6 BYTeorder 28-7 COMPlete? 28-8 COUNt? 28-9 COUPling? 28-10 DATA? 28-11 FORMat 28-32 POINts? 28-35 PREamble 28-36 SEGMented:ALL 28-42 SEGMented:COUNt? 28-43 SEGMented:TTAG? 28-44 SEGMented:XLISt? 28-45 SOURce 28-46 STReaming 28-47 TYPE? 28-48 VIEW 28-49 XDISplay? 28-51 XINCrement? 28-52 XORigin? 28-53 XRANge? 28-54 XREFerence? 28-55 XUNits? 28-56 YDISplay? 28-57 YINCrement? 28-58 YORigin? 28-59 YRANge? 28-60 YREFerence? 28-61 YUNits? 28-62
Contents
29 Waveform Memory Commands
CLEar 29-3 DISPlay 29-4 LOAD 29-5 SAVE 29-6 XOFFset 29-7 XRANge 29-8 YOFFset 29-9 YRANge 29-10
Contents-15
Contents
30 Serial Data Equalization Commands
CTLequalizer:DISPlay 30-4 CTLequalizer:SOURce 30-5 CTLequalizer:DCGain 30-6 CTLequalizer:P1 30-7 CTLequalizer:P2 30-8 CTLequalizer:RATe 30-9 CTLequalizer:VERTical 30-10 CTLequalizer:VERTical:OFFSet 30-11 CTLequalizer:VERTical:RANGe 30-12 CTLequalizer:ZERo 30-13 FFEQualizer:DISPlay 30-14 FFEQualizer:SOURce 30-15 FFEQualizer:NPRecursor 30-16 FFEQualizer:NTAPs 30-17 FFEequalizer:RATe 30-18 FFEQualizer:TAP 30-19 FFEQualizer:TAP:PLENgth 30-20 FFEQualizer:TAP:WIDTh 30-21 FFEQualizer:TAP:DELay 30-22 FFEQualizer:TAP:AUTomatic 30-23 FFEQualizer:TAP :BANDwidth 30-24 FFEQualizer:TAP :BWMode 30-25 FFEQualizer:TAP :TDELay 30-26 FFEQualizer:TAP :TDMode 30-27 FFEQualizer:VERTical 30-28 FFEQualizer:VERTical:OFFSet 30-29 FFEQualizer:VERTical:RANGe 30-30 DFEQualizer:STATe 30-31 DFEQualizer:SOURce 30-32 DFEQualizer:NTAPs 30-33 DFEQualizer:TAP 30-34 DFEQualizer:TAP:WIDTh 30-35 DFEQualizer:TAP:DELay 30-36 DFEQualizer:TAP:MAX 30-37 DFEQualizer:TAP:MIN 30-38 DFEQualizer:TAP:GAIN 30-39 DFEQualizer:TAP:UTARget 30-40 DFEQualizer:TAP:LTARget 30-4 1 DFEQualizer:TAP:AUTomatic 30-42
31 Error Messages
Error Queue 31-3 Error Numbers 31-4 Command Error 31-5
Contents-16
Execution Error 31-6 Device- or Oscilloscope-Specific Error 31-7 Query Error 31-8 List of Error Messages 31-9
Contents
Contents-17
Contents
Contents-18
1

Introduction to Programming

Introduction to Programming
This chapter introduces the basics for remote programming of an oscilloscope. The programming commands in this manual conform to the IEEE 488.2 Standard Digital Interface for Programmable Instrumentation. The programming commands provide the means of remote control.
Basic operations that you can do with a computer and an oscilloscope include:
• Set up the oscilloscope.
• Make measurements.
• Get data (waveform, measurements, and configuration) from the oscilloscope.
• Send information, such as waveforms and configurations, to the oscilloscope.
You can accomplish other tasks by combining these functions.
Example Programs are Written in HP BASIC and C The programming examples for individual commands in this manual are
written in HP BASIC and C.
1-2
Introduction to Programming

Communicating with the Oscilloscope

Communicating with the Oscilloscope
Computers communicate with the oscilloscope by sending and receiving messages over a remote interface, such as a GPIB card or a Local Area Network (LAN) card. Commands for programming normally appear as ASCII character strings embedded inside the output statements of a “host” language available on your computer. The input commands of the host language are used to read responses from the oscilloscope.
For example, HP BASIC uses the OUTPUT statement for sending commands and queries. After a query is sent, the response is usually read using the HP BASIC ENTER statement. The ENTER statement passes the value across the bus to the computer and places it in the designated variable.
For the GPIB interface, messages are placed on the bus using an output command and passing the device address, program message, and a terminator. Passing the device address ensures that the program message is sent to the correct GPIB interface and GPIB device.
The following HP BASIC OUTPUT statement sends a command that sets the channel 1 scale value to 500 mV:
OUTPUT <device address> ;":CHANNEL1:SCALE 500E­3"<terminator>
The device address represents the address of the device being programmed. Each of the other parts of the above statement are explained on the following pages.
Use the Suffix Multiplier Instead 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 as described in chapter 3, "Message Communication and System Functions."
1-3
Introduction to Programming Output Command

Output Command

The output command depends entirely on the programming language. Throughout this book, HP 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 HP BASIC commands like OUTPUT, ENTER, and CLEAR, to convert the examples.

Device Address

The location where the device address must be specified depends on the programming language you are using. In some languages, it may be specified outside the OUTPUT command. In HP BASIC, it is always specified after the keyword, OUTPUT. The examples in this manual assume that the oscilloscope and interface card are at GPIB device address 707. When writing programs, the device address varies according to how the bus is configured.

Instructions

Instructions, both commands and queries, normally appear as strings embedded in a statement of your host language, such as BASIC, Pascal, or C. The only time a parameter is not meant to be expressed as a string is when the instruction's syntax definition specifies <block data>, such as HP BASIC’s "learnstring" command. There are only a few instructions that use block data.
Instructions are composed of two main parts:
• The header, which specifies the command or query to be sent.
• The program data, which provides additional informatio n to clarify the meaning of the instruction.

Instruction Header

The instruction header is one or more command mnemonics separated by colons (:). They represent the operation to be performed by the oscilloscope. See the “Programming Conventions” chapter for more information.
Queries are formed by adding a question mark (?) to the end of the header. Many instructions can be used as either commands or queries, depending on whether or not you include the question mark. The command and query forms of an instruction usually have different program data. Many queries do not use any program data.
1-4
Introduction to Programming

White Space (Separator)

White Space (Separator)
White space is used to separate the instruction header from the program data. If the instruction does not require any program data parameters, you do not need to include any white space. In this manual, white space is defined as one or more spaces. ASCII defines a space to be character 32 in decimal.

Braces

When several items are enclosed by braces, { }, only one of these elements may be selected. Vertical line ( | ) indicates "or". For example, {ON | OFF} indicates that only ON or OFF may be selected, not both.

Ellipsis

... An ellipsis (trailing dots) indicates that the preceding element may be repeated one or more times.

Square Brackets

Items enclosed in square brackets, [ ], are optional.

Command and Query Sources

Many commands and queries require that a source be specified. Depending on the command or query and the model number of Infiniium oscilloscope being used, some of the sources are not available. The following is a list of sources:
CHANnel1 FUNCtion1 WMEMory1 CHANnel2 FUNCtion2 WMEMory2 CHANnel3 FUNCtion3 WMEMory3 CHANnel4 FUNCtion4 WMEMory4 CLOCk MTRend MSPectrum HISTogram
1-5
Introduction to Programming Program Data

Program Data

Program data is used to clarify the meaning of the command or query. It provides necessary information, such as whether a function should be on or off, or which waveform is to be displayed. Each instruction's syntax definition shows the program data and the values they accept.
When there is more than one data parameter, they are s eparated by commas (,). You can add spaces around the commas to improve readability.
1-6
Introduction to Programming

Header Types

Header Types
There are three types of headers:
• Simple Command headers
• Compound Command headers
• Common Command headers
Simple Command Header
Simple command headers contain a single mnemonic. AUTOSCALE and DIGITIZE are examples of simple command headers typically used in this oscilloscope. The syntax is:
<program mnemonic><terminator>
or
OUTPUT 707;”:AUTOSCALE”
When program data must be included with the simple command header (for example, :DIGITIZE CHAN1), white space is added to separate the data from the header. The syntax is:
<program mnemonic><separator><program data><terminator>
or
OUTPUT 707;”:DIGITIZE CHANNEL1,FUNCTION2”
Compound Command Header
Compound command headers are a combination of two program mnemonics. The first mnemonic selects the subsystem, and the second mnemonic selects the function within that subsystem. The mnemonics within the compound message are separated by colons. For example:
To execute a single function within a subsystem:
:<subsystem>:<function><separator><program data><terminator>
For example:
OUTPUT 707;”:CHANNEL1:BWLIMIT ON”
1-7
Introduction to Programming Header Types
Combining Commands in the Same Subsystem
T o execute more than one command within th e same subsystem, use a semi -colon (;) to separate the commands:
:<subsystem>:<command><separator><data>;<command><separator> <data><terminator>
For example:
:CHANNEL1:INPUT DC;BWLIMIT ON
Common Command Header
Common command headers, such as clear status, control the IEEE 488.2 functions within the oscilloscope. The syntax is:
*<command header><terminator>
No space or separator is allowed between the asterisk (*) and the command header. *CLS is an example of a common command header.
1-8
Loading...
+ 962 hidden pages