HP E1340A User Manual

Contents
HP E1340A Arbitrary Function Generator User’s Manual
Warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
WARNINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Safety Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Declaration of Conformity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Reader Comment Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1. Getting Started with the HP E1340A . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Preparation for Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Downloading the AFG Device Driver . . . . . . . . . . . . . . . . . . . . . . . . 15
AFG Logical Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Addressing the AFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Instrument and Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . 19
SCPI Program mi ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
SCPI Command Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Command Coupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
How to Execute Coupled Commands . . . . . . . . . . . . . . . . . . . . . . . . 21
HP IBASIC Language Progra m s . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
C Language Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
QuickBASIC Language Progra ms . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Introductory Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
AFG Self-Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Resetting and Clearing the AFG . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Querying the P o wer-On/ Re set Configuration . . . . . . . . . . . . . . . . . . . . 37
Checking for Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Generating a Sine Wave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
HP E1340A Example Progra ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2. Generating Standard Waveforms with the HP E1340A . . . . . . . . . . . . . . 41
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Standard Waveforms Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Generating DC Voltages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 44
Generating Sine, Triangle, and Square Waves . . . . . . . . . . . . . . . . . . . . . . 45
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 46
Generating Ramp Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 49
Selecting the Amplitude Levels and Output Units . . . . . . . . . . . . . . . . . . . . 50
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 51
Program Commen t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Reference Oscillator Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Output Load Commen t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Contents HP E1340A Arbitrary Function Generator User’s Manual 1
Output Units Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Using MINimum a nd MAXimum Paramet er s . . . . . . . . . . . . . . . . . . . . 53
3. Generating Arbitrary Waveforms with the HP E1340A . . . . . . . . . . . . . . 55
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Arbitrary Waveforms Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
How the AFG Generates Arbitrary Waveforms . . . . . . . . . . . . . . . . . . . . . . 56
Generati ng a Si m ple Ar bi trary Waveform . . . . . . . . . . . . . . . . . . . . . . . . 59
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 62
Executing Several Waveform Segments . . . . . . . . . . . . . . . . . . . . . . . . . 65
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 68
Arbitrary Waveform Hopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 72
Generating Built-In Arbitrary Waveforms . . . . . . . . . . . . . . . . . . . . . . . . 73
C and QuickBASIC Program Versions . . . . . . . . . . . . . . . . . . . . . . . . 75
Sample Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Generating a Damped Sine Wave . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Generating a n Ex p onent ial Cha rge/Discharge Waveform . . . . . . . . . . . . . . 78
Generating a Sine Wave with Spikes . . . . . . . . . . . . . . . . . . . . . . . . . 79
Generating a Half- Rectifi ed Sine Wave . . . . . . . . . . . . . . . . . . . . . . . 80
Program Commen t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Amplitude Effects on Voltage List . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Reference Oscillator Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Waveforms in the EPRom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4. HP E1340A Sweeping and Frequency-Shift Keying . . . . . . . . . . . . . . . 83
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
The Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Programming Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Sweeping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Sweeping Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Sweeping Using Start and Stop Frequen cies . . . . . . . . . . . . . . . . . . . . . 85
C and QuickBASIC Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Sweeping Using Start and Span Frequenc i es . . . . . . . . . . . . . . . . . . . . . 88
C and QuickBASIC Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Sweep Point s Vs. Sweep Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
C and QuickBASIC Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Frequency-Shift Keying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Program Commen t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Reference Oscillator Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
AFG Frequency Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Frequency Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
2 HP E1340A Arbitrary Function Generator User’s Man ual Contents
5. HP E1340A Arming and Marker Outputs . . . . . . . . . . . . . . . . . . . . . 95
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
The ARM Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
The ARM States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Initiating Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Arming the AFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Arming Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Setting the
Arm Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Setting the Arm and Wa veform Cycle Count . . . . . . . . . . . . . . . . . . . . 99
Gating the Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Aborting Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Marker Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Marker Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Available Marker Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Generating Zero Crossing Marker Pulses . . . . . . . . . . . . . . . . . . . . . . 104
Program Commen t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Reference Oscillator Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
AFG Frequency Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
AFG Arming Sourc es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
AFG Arm Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Waveform Repetition Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Enabling the Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
6. HP E1340A High Speed Operation . . . . . . . . . . . . . . . . . . . . . . . . . 109
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Using DAC Dat a to Generate Waveforms . . . . . . . . . . . . . . . . . . . . . . . . 109
Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Using Definite Length Blocks to Transfer Data . . . . . . . . . . . . . . . . . . . . . . 113
Definite Length Block Data Format . . . . . . . . . . . . . . . . . . . . . . . . . 113
Data Byte Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Program Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Using the VXIbus Backplane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Using the VXIbus Backplane to Download Segment Data . . . . . . . . . . . . . 120
Downloading Segment Data into Memor y . . . . . . . . . . . . . . . . . . . . . . 120
Downloading Directly into the DAC . . . . . . . . . . . . . . . . . . . . . . . . . 120
Program that Downloa ds and Ex ecutes Wa ve form Segment s in Memory . . . . . . 120
Program to Download Directl y to the DAC . . . . . . . . . . . . . . . . . . . . . 126
Program Commen t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Amplitude Effects on DAC Codes . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Incorrect AFG Oper ation from Incorrect DAC Codes . . . . . . . . . . . . . . . . 129
Contents HP E1340A Arbitrary Function Generator User’s Manual 3
7. HP E1340A Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . 131
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Command Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Common Command Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
SCPI Command F orma t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Command Separa t or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Abbreviated Comm ands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Implied (Opt ional) Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
SCPI Command Pa ra m et er s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Parameter Types, Explanations, and Examples . . . . . . . . . . . . . . . . . . . 134
Optional Par am eters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Querying
Parameter
Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
SCPI Command Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Command Coupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Linking Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
SCPI Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
ABORt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
ARM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
[:STARt][:LAYer[1]] :COUNt . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
[:STARt]:LAYer2 :COUNt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
[:STARt]:LAYer2 :SLOPe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
[:STARt]:LAYer2 :SOURce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
CALibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
:AC:BEGin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
:AC:POINt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
:DATA:AC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
:DATA[:DC] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
[:DC]:BEGin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
[:DC]:POINt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
:STATe:AC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
INITiate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
[:IMMediate] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
OUTPut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
:IMPedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
:LOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
[SOURce:]ARBitrary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
:DAC:SOURce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
:DOWNload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
:DOWNload :COMPlet e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
[SOURce:]FREQuency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
:CENTer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
[:CW|:FIXed] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
:FSKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
:MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
:SPAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
:STARt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
4 HP E1340A Arbitrary Function Generator User’s Man ual Contents
:STOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
[SOURce:]FUNCtion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
[:SHAPe] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
:USER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
[SOURce:]LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
[:SEGMent] :CATalog? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
[:SEGMent]:DEFine? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
[:SEGMent]:SELect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
[:SEGMent]:VOLTage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
[:SEGMent]:V O LTage:DAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
[:SEGMent]:VO LTage:POI Nts? . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
:SSEQuence :CAT alog? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
:SSEQuence :DEFine? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
:SSEQuence:SELect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
:SSEQuence :SEQuence ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
:SSEQuence :SEQuence :SEGMents? . . . . . . . . . . . . . . . . . . . . . . . . 166
[SOURce:]MARKer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
:FEED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
:POLarit y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
[SOURce:]RAMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
:POLarit y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
[SOURce:]ROSCillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
:FREQuency :EXTer nal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
:GATE:ST ATe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
:SOURce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
[SOURce:]SWEep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
:COUNt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
:POINts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
:TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
[SOURce:]VOLTage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
[:LEVel][:IMMediate] [: AMPLitude] . . . . . . . . . . . . . . . . . . . . . . . . 177
[:LEVel][:IMM ediate] [: AMPLitude]:UNIT [:VOLTag e] . . . . . . . . . . . . . . 179
[:LEVel][:IMMediate]: OFFSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
STATus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
:OPERati on |Q UEStionable :CONDition? . . . . . . . . . . . . . . . . . . . . . . 182
:OPERati on | QUEStionable :E NABle . . . . . . . . . . . . . . . . . . . . . . . . 182
:OPERati on |Q UEStionable [:EVENt]? . . . . . . . . . . . . . . . . . . . . . . . 183
:OPERation |QUEStionable :NTRansition . . . . . . . . . . . . . . . . . . . . . . 183
:OPERation |QUEStionable :PTRansition . . . . . . . . . . . . . . . . . . . . . . 184
:PRESet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
SYSTem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
:ERRor? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
:VERSion? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
TRIGger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
[:STARt]:CO UNt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
[:STARt]:SOURce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
IEEE-488. 2 Common Command s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Contents HP E1340A Arbitrary Function Generator User’s Manual 5
*CLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
*DMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
*EMC and *EMC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
*ESE and *ESE? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
*ESR? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
*GMC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
*IDN? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
*LMC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
*LRN? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
*OPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
*OPC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
*PMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
*RCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
*RMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
*RST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
*SAV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
*SRE and *SRE? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
*STB? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
*TST? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
*WAI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
SCPI Conforma nce Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
8. HP E1340A AFG Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Status System Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
The Operation Status Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
The Standard Event Status Group . . . . . . . . . . . . . . . . . . . . . . . . . . 207
The Status Byte Status Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Using the Standard Event Status Group . . . . . . . . . . . . . . . . . . . . . . . 210
9. HP E1340A Block Diagram Description . . . . . . . . . . . . . . . . . . . . . . 211
Chapter Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
AFG Descripti on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
What is an Arbitrary Waveform? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Generating Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Output DAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Reference Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Frequency Generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Output Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Microprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Input/Output Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
A. HP E1340A Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Appendix Conten t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Instrument Sp ecifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
General and VXI Cha racteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
6 HP E1340A Arbitrary Function Generator User’s Man ual Contents
B. HP E1340A Useful Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Appendix Conten t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
C. HP E1340A Register-Based Programming . . . . . . . . . . . . . . . . . . . . 229
Appendix Conten t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Register Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
The Base Addres s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Computer Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Throughput Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Embedded Computer Programm in g (C-Size Systems) . . . . . . . . . . . . . . . . 232
IBASIC Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
External Computer Programming . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Programmi ng Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
The READ Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
The ID Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
The Device Type Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
The Status Re gister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
The Query Response Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
The WRITE Reg isters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
The Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
The Command and Parameter Registers . . . . . . . . . . . . . . . . . . . . . . . 238
The Input Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Command Descriptions and Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Setting the Output Fun ction an d Loading RAM . . . . . . . . . . . . . . . . . . . 243
Setting the Signal Fr equenc y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Setting the Output At ten ua t i on . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Setting the Amplitud e O ffset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Setting the S weep Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Setting the Burst C ount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
The AFG Output M ode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Starting the Waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Querying the A F G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
AFG Soft Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Aborting the Waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Program Timing and Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
AFG Reset Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Configuring the AFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Querying AFG Pa ra meters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Opcode/Parameter Quick Re feren ce . . . . . . . . . . . . . . . . . . . . . . . . . 256
Generating a
Sine Wave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Multiple Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Internally Triggering a Burst of Cycles . . . . . . . . . . . . . . . . . . . . . . . . 260
Extern al ly Triggering a Burst of Cycles . . . . . . . . . . . . . . . . . . . . . . . 261
Frequency-Shift Keying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Contents HP E1340A Arbitrary Function Generator User’s Manual 7
Notes
Waveform Hopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Sweeping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Gating the Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Downloading an Arbitrary Waveform . . . . . . . . . . . . . . . . . . . . . . . . 266
Fast Frequency Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Sending Data Directly to the DAC . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Example Program Subprograms . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Querying AFG Pa ra meters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
8 HP E1340A Arbitrary Function Generator User’s Man ual Contents
Certification
Hewlett-Pac kard Compa ny certif ies that this product m et its published sp ecifi cation s at the time of shipment from the factory. H ewlett­Packard further certifies that its calibration measurements are traceable to the United Stat es Nation al Instit ute of Stand ard s and Tech­nology (for m erl y Nat ional Bur ea u of Standar ds ), to the ex tent allo wed by that orga ni zati on’ s cal ib rat ion f ac ili t y, and t o th e calibration facilities of ot her International Standards Organization members.
Warranty
This Hewlet t-Pa ck ar d product is warr ante d agai nst de fect s in mate rials and w orkmansh ip for a period of three years from date of ship­ment. Duration and conditions of warranty for this product may be superseded when the product i s i nt egrated into (be com es a part of) other HP product s. Du ring the warrant y period, Hewlett-Packard Company will, at its opt ion, either repair or repl ace pr oducts which prove to be defective.
For warranty se r vice or repair, this product mu st be r et ur ned to a service facility designated by Hewl et t -P ackard (HP). Buyer sha l l pr e­pay shipping cha rges to HP and HP shall pay shipping charges to re tu rn the product to Buyer. However, Buyer shall pay all shipping charges, duties, and taxe s for products returned to HP from anot her count r y.
HP warrants that its softwar e and firmwar e designa ted b y HP for use with a product will execute its programmin g instru cti ons wh en properly installe d on that product. HP does not warrant that the operat ion of the product, or software , or firmware will be uninterrupted or er ro r f r ee.
Limitation Of Warrant y
The foreg oin g warra nt y sh al l not apply t o defects resulting from impr oper or inadequate m ai nt enance by Buyer, Buyer-supplied prod­ucts or interfacing, unauthori ze d m odificati on or misus e, operation outside of the environmenta l specificat i ons for the product, or im­proper site prep arat i on or maint ena nce.
The design and imp le mentation of an y circuit on thi s pr oduct is the sole responsibility of the Buyer. HP does not warrant th e Buyer’s circuitr y or malfunctions of HP products that result from the Bu yer’s circuitry. In addition, HP d oes not warrant a n y damage that oc­curs as a result of the B uyer’s circuit or any defects that re sult from Buyer-supplied product s.
NO OTHER WARRANTY IS EXPRESSED OR IMPLIED. HP SPECIFICALLY DISCLAIMS THE IMPLIED WARR ANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Exclusive Remedie s
THE REMED IES PROVIDED HEREIN ARE BUYER’S SOLE AND EXCLUSIVE REMEDIES. HP SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER BASED ON CON­TRACT, TORT, OR ANY OTHER LEGAL THEORY.
Notice
The information contained in this document is subject to change without notice. HEWLETT-PACKARD (HP) MAKES NO WAR­RANTY OF ANY KIND W ITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR­RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. HP shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance or use of this material. This docu­ment c ontains proprietary information whi ch is protected by copyright. All rights are reserved. No part of this document may be photo­copied, reproduced, or translate d to another lan guage wit h out the prior written consent of Hewlett -Packar d C ompany. HP assumes no responsibility for the use or reliability of its software on equipment that is not furnished by HP.
Restricted Rights Legen d
Use, dupli ca tion or discl osu re by the U. S. Go vernme nt is subje ct to rest rict i ons as set fort h in subparagraph (c)(1)(i i) of the Right s in Technical Data and Comp uter Softwa re clause in D F ARS 252.227-701 3.
Hewlett-Packar d Company 3000 Hanover Street Palo Alto, Cal if ornia 943 04 U.S. A.
Rights for non-DOD U.S. Government Departments and Agen ci es are as set f orth in F AR 52.227 -19 (c) (1,2).
HP E1340A Arbitrar y Function Gene rat or Modu le Use r’s Manu al
Copyright © 1995 He wle tt-Pa cka rd Company. All Right s Reser ve d.
Edition 3
HP E1340A Arbitrary Function Generator Module User’s Manual 9
Documentatio n History
All Editions and Updates of this manual and their creation date are listed below. The first Edition of the manual is Edition 1. The Edi­tion number increment s by 1 whenever the manua l is revised . Updates , which are issued betw een Edi ti ons, c ontain repla ce ment pa ges to correct or add additional information to the current Edition of the manual. Whenever a new Edition is created, it wil l contain all of the Update inf ormat ion for the pre viou s Editi on. Each new Ed iti on or Update also incl ude s a revis ed c op y of this documentation his­tory page.
Edition 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jan uar y, 1992
Update 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . August, 1992
Edition 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . March, 1993
Edition 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . April, 1995
Safety Symbols
Instruction manual symbol affixed to prod­uct. Indicat es that the user must refer to t he manual for specific WARNING or CAU­TION information to avoid personal injury or damage to the product.
Indicates the field wiring terminal that must be connected to earth ground before operat­ing the equipment—protects against electri­cal shock in case of fault.
Frame or chassis ground termi nal — t ypi-
or
cally connects to the equipment’s metal frame.
WARNING
CAUTION
Alternating current (AC).
Direct curren t (DC).
Indicate s ha za rdous voltages.
Calls at te nt i on t o a pr ocedure, practi ce, or condition that could cause bodily injury or death.
Calls at te nt i on t o a pr ocedure, practi ce, or con­dition that could possibly cause damage to equipme nt or perma nen t los s of data.
WARNINGS
The following ge ner al safet y prec aut ions mus t be observed du ring al l phas es of oper ation , ser vice , and repai r of this pr oduct. Failure to comply with these precautions or with specific warnings elsewhere in this manual violates safety standards of design, manufacture, and inten ded use of the product. Hewlett-Packard Company assumes no liability for the cust o mer’s failu re to comply with these requirements.
Ground the equipment: For Safety Cl as s 1 equipmen t (equ ipment ha vin g a protective ea rth ter mi nal) , an unint erru ptib le sa fety earth
ground must be provide d from the ma in s power sour ce to the produ ct input wi rin g termi nals or suppli ed power cable .
DO NOT operate the produc t in an explosive at mospher e or in the presen ce of flammable gases or fume s.
For continued protect ion a gainst fire, repl ace the line fuse (s) only with fuse(s) of the same voltage and current rating a nd type . DO NOT use repaired fuses or short-circui ted fuse holders.
Keep away from live circuits: Operatin g personnel must not remove equipment covers or shields. Procedures involving the removal of covers or shields are for use by service-trained personnel onl y. Under certain conditions , dangerous voltages may exist even with the equipment switched off. To avoid dangerous ele ctrical shock , DO NOT perf orm procedures involving cover or shield removal unless you are qualified to do so.
DO NOT operate damaged equipment: Whene ver it i s p ossibl e tha t the sa fe ty protection features buil t int o t his pr oduct have been im­paired, eithe r t hr ough physical dam a ge, exces si ve moisture, or any ot her re as on, REMOVE POWER and do not use the product until safe operation can be verified by service-trained personnel. If necessary, return the product to a Hewlet t-P ackar d Sales and Se rvice O f­fice for service and repair to ensure that safety features are maintaine d.
DO NOT service or adjust alon e: Do not attempt internal service or adjustment unless another person, capable of rendering first aid and resuscitation, is present.
DO NOT substitute parts or modify equipment: Because of the danger of introducing additional hazar ds, do not install substitut e parts or perform any unauthorized modifica tion to the product. Retur n the product to a Hewlet t-P ackar d Sales and Ser vice O ffice for service and repair to ensure that safety features a re ma i nt ai ned.
10 HP E1340A Arbitrary Function Generator Module User’s Manual
Declaration of Conformity
according to ISO/IEC Guide 22 and EN 45014
Manufacturer’s Name: Hewlett-Pa ckar d C ompany
Loveland Manufacturing Center
Manufact urer’s Addre s s: 815 14th Street S.W.
Loveland, Colorado 80537
declares, that the product:
Product Name: Arbitrary Function Generator
Model Number : E1340A
Produc t Opt ion s: All
conforms to the following Pr od uct Spe cifi cati ons :
Safety: IEC 1010-1 (1990) Incl . Amend 1 (1992) /E N610 10-1 (1993)
CSA C22.2 #1010.1 (1 992) UL 1244
EMC: CISPR 11:1990/EN55011 (1991): Group1 Class A
IEC 801-2:1991/ E N5008 2-1 (1 992) : 4kVCD, 8k VA D IEC 801-3:1984/ E N5008 2-1 (1 992) : 3 V/m IEC 801-4:1988/ E N5008 2-1 (1 992) : 1kV P ower Lin e .5kV Signal Lines
Supplementary Information: The product her ewi th c ompl ies wit h th e requirements of the Low Voltage Directive 73/23/EEC and the EMC Directive 89/336/ EEC and carri es the CE-mark ing acc ordingly.
Tested in a typical configuration in an HP B-Size VXI mainframe.
April, 1995 Jim White , QA ManagerApril, 1995 Jim White, QA Manager
European conta ct: Your loca l He wlett-Pa cka rd Sales a nd Servi ce O ffic e or Hewlett- Packa rd GmbH, Departm ent HQ-TRE, Herr en ber ger Straße 130, D- 71034 Böblingen, Germ a ny (FAX + 49-7031-14-3143 ).
HP E1340A Arbitrary Function Generator Module User’s Manual 11
Notes
12 HP E1340A Arbitrary Function Generator Module User’s Manual
Please fold and tape for mailing
Reader Comment Sheet
HP E1340A Arbitrary Function Generator Modul e User’s Manual
Editio n 3
You can help us improve our manual s b y sharing your commen ts and sug gesti ons. In apprec iat ion of your time, we will enter yo u in a quarterly drawing for a Hewlett -Pac kar d Palmt op Personal Computer (U.S. government employees
cannot participate in the drawing).
Your Name
C ompany N ame
Job Title
Address
City, State/Province
Country
Zip/Postal C ode
Telephone Number with Area Code
Please list the syste m contr ol ler , oper ati ng syste m, pr ogr a m ming la ng uage, and pl ug-in mo dules you are using.
fold here
BUSINESS REPLY MAIL
FIRST CLASS PERMIT NO. 37 LOVELAND,CO
HEWLETT-PACKARD COMPANY
cut along this line
Measurement Systems Division
Learning Products Department P.O. Box 301 Loveland, CO 80539-9984
NO POSTAGE
NECESSARY
IF MAILED
IN THE
UNITED STATES
Please penci l-in one circl e for each statement below: Disagree Agree
The documentation is well organized. OOOOO
Instructions are easy to understand. OOOOO
The documentation is clearly written. OOOOO
Examples are clea r a nd useful. OOOOO
Illustrati ons are clear and help ful. OOOOO
The documentation meets my overall expectations. OOOOO
Please write any c omments or suggestions be l ow--be specific.
fold here
14 HP E1340A Arbitrary Function Generat or Module User’s Manual
Getting Started with the HP E1340A
Chapter Contents
Chapter 1
This chapter shows you ho w to configure, install, and b egi n using the HP E1340A Arbitrary Function Generator (AFG). The main sections of this chapter include:
Preparation for Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 15
Installing the AFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 15
Downloadi ng the A F G Device Driver. . . . . . . . . . . . . . . . Page 15
AF G Lo gical Add ress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pag e 17
Addressing the AFG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 18
Instrument and Programming Languages . . . . . . . . . . . . . . . Page 19
HP IBASIC La nguage Pro grams . . . . . . . . . . . . . . . . . . . . Page 22
C Language Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 25
QuickBASIC Language Programs. . . . . . . . . . . . . . . . . . . Page 31
Introductory Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 36
AF G Self-Te s t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 36
Resetting and Clearing the AFG . . . . . . . . . . . . . . . . . . . . Pag e 37
Queryi ng the Power-On/ Res et Con figu rat i on . . . . . . . . . . Pag e 37
Checking for Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page 38
Generating a Sine Wave. . . . . . . . . . . . . . . . . . . . . . . . . . . Page 40
HP E1340A Example Programs . . . . . . . . . . . . . . . . . . . . . . Page 40
Preparation for Use
This section shows how to prepare the AFG for use. Included are instructions to install the AFG, to download the AFG Device Driver, and to addre ss t he AFG.
Installing the AFG The AFG can be installed in any mainfra me slot, except slot 0. For
installation instructions in a B-Size VXIbus System, refer to the B-size Installation an d Getting Start ed Guide. For install ation instructio ns in C-Size VXIbus Systems, refer to the C-size Installat ion an d Getting Start ed Guide.
Downloading the
AFG Devic e D ri v e r
The HP E1340A AFG driver allows the AFG to operate in an HP E1300/E1301 Ma inframe or HP E1405/E1 406 Co mma nd Mo dule using the Standard Commands for Programmable Instruments (i.e., SCPI) instrument command language. The driver is supplied on the AFG’s example program disks (see “Instrument and Programming Languages” on page 19 f or more i nf ormat ion on the disks).
15 Gettin g Started with the HP E1340A Chapter 1
The procedure for downloading the driver is contained in the HP Installation N ote Do wnloadin g Device Drivers. The E1300/E1301
Mainframe Manual, H P E1405 Command Module Manu al, and E1406 Command Module Manual also contain the installation procedure.
Mainframe/Command
Module Requirements
Recommended
Systems to Download
the Drivers
To download a driver, the ROM version number of the HP E1300/E1301 Mainframe or HP E1405 Command M odu le must be A.06.00 or above. To determine the version number, send t he IEEE 488.2 common command
*IDN?. A typical returned value (for the HP E1300A Mainframe) is:
HEWLETT-PACKARD,E1300A,0,A.06.01
where "A.06.01" is the version nu mber.
The AFG instrument driver can be downloaded with the following systems.
HP BASIC with an External HP- IB Controller
This system downloads the driver o ver th e Hewlett-P ac kard Interface Bus (HP-IB*) with an HP BASIC controller, like the HP Series 200/300 computer. Be sure to connect the computer to the Mainframe’s / Command Module’s HP-IB port. The program to download the driver is named “VXIDLD_GET”, and is in GET/ S AVE f ormat. The pr o gra m is located on the HP IBASIC example program disk (HP part number E1340-10035). This disk is f orm at ted in the LIF format.
HP IBASIC in an HP E1300/E1301 Mainframe or HP E1405/E1406 Command Module
This system downloads the drivers using the HP IBASIC (i.e., HP Instrument BASIC) pr ogra m la nguage. The language comes with options to the HP E1300/E1301 M ainframe and the HP E1405/ E1406 Command Modules. IBASIC reads dis ks formatted in either the LIF or M S-DOS® format and can use either example program disk (depend ent on your disk drive). To download the driver from the LIF disk or t he DOS disk, use “AUTOST”.
Externally Connected MS-DOS® Computer
This system downloads the driver us ing an MS-DOS computer over the RS-232 serial int erface. Connect the computer to th e Mai nframe’s / Command Module’s RS-232 port. The program to download the driver is named “VXIDLD.EXE” and is located on the DOS example program disk (HP part number E1340-10036). Th is disk is formatted for MS-DOS.
* HP-IB is Hewlett-Packard’s implement at ion of IEEE Std 488. 1-1 978
Chapter 1 Getting Started with the HP E1340A 16
AFG Logical
Address
The AFG is shipped from the factory with a logical addre ss setting of 80, as shown in Figure 1-1.
The E1340A AFG logical address is us ed:
to place the AFG in the servant area of a commander
(e.g. HP E1405/E1406 C omm and M o dule).
to address the AFG (see “Addressing the AFG” later in this chapter).
Figure 1-1. Setting the Logical Address
17 Gettin g Started with the HP E1340A Chapter 1
Assigning the AFG to a
Commander
In VXIbus systems, each device must be in the servant area of a commander. Note th e following wh en assigning the E1340 A AFG:
In a B-size system, the system instrument is the commander. Any
AFG logical address (1 - 255) places the AFG in the commander servant ar ea. The AFG logical addre ss should remain at 80, or if necessary, set to some other multiple of 8 (s ee “Addressing the AFG”).
The E1340A AFG is a register-based device. If the AFG’s driver is
downloaded in t he HP E1405/E1406 Command Module, then the AFG must be in th e serva n t a r ea o f the Command Module to prog ram with SCP I commands.
Addr essing t he AF G The following information explains how the AFG is addressed using
dif feren t com p u ter ( contr o ller) configur ations.
IB ASIC To program the AFG in a B-size or C-size system using IBASIC, the AFG
must have a unique address. The addr ess is a combinat i on of the IBASIC interface select code, the Mainframe’s/Command Module’s primary HP-IB address, and the AFG’s s ec ondary HP-IB address. An addr ess in this form in an HP IBASIC sta tement appears as:
External Controller
and PC
OUTPUT 80910;"SOUR: RO SC:SOUR INT"
Interface Select Code (8): The IBASIC interface select code is 8. This select code is used to access all devices installed in B-size and C-size systems under IBASIC control.
Primary HP-IB Address (09): This is the address of the HP-IB port on the Mainframe or C ommand Modu le . Valid add r esses are 0 to 30. The mainframe/command module has a factory set address of 9.
Secondary HP-IB Address (10): This address is derived from the logical address of the de vice (AFG) by dividing t he logical address by 8. F or t he E1340A AFG factory set logical address of 80, the secondary address is 10.
When programming the AFG from an external computer such as a HP Series 300 or PC, the addressing convention used is the same as IBASIC exc ept for th e interface select code. An exam p le is sho wn b elow:
OUTPUT 70910;"SOUR: RO SC:SOUR INT"
Interface Select Code (7): Determined by the address of the HP-IB interface card in the computer. In most Hewlett-Packard computers, this card has a factory set address of 7, including the HP 82335 HP-IB Interface Card (this card was used with an HP Vectra personal computer to create the C and QuickBASIC example programs).
Chapter 1 Getting Started with the HP E1340A 18
The Pri mary HP-IB Address and Secondary HP-IB Address are the same as described previously for IBASIC programming.
Instrument and Programming Languages
The purpose of this manual is to teach you how to use the E1340A AFG. To do this, the manual uses block diagrams, flowcharts, and example programs. The programs s hown in the manual are SCPI pr ogr a ms wr itten in HP IBASIC. These programs, and Quic kBASIC and C language v ersions of the programs are on the following disks whic h ship with the manual:
HP E1340A Instrument Driver and HP IBASIC Example Progra ms -
3.5" 720 kbyte disk (E1340-10035)
HP E1340A Instrument Driver and QuickBASIC and C Language
Example programs - 3.5" 1.44 M byte disk (E1340-10036)
SCPI Programming SCPI (Standar d Comm a nds for Programm ab le Instru ments) is an
ASCII-based instrument command language des igned for test and measurement instruments. The HP E1300/E1301 Main frame or HP E1405/E1406 Comm a nd Mo dule with the AFG drive r installed interprets the ASCII command strings and sets the AFG accordingly. The Mainframe/Command Module does this by writing to the AFG registers.
SCPI Command
Structure
The AFG SCPI command set is found in Chapter 7. SCPI commands are based on a hierarchical structure, also known as a tree system. In this system, ass ociated commands are grouped together under a common node or root, t hus, for ming subtree s o r subsystem s. An example i s the AF G’s ’ARM’ subsystem shown below.
ARM
[:STARt|SEQuence[1]]
[:LAYer[1]]
:COUNt <
:LAYer2
:COUNt < :SLOPe < :SOURce <
is the root keyword of the command, :STARt|SEQuence1 is the
ARM
second level keyword, so on. A colon (:) always s eparates a command keyword from a lower level keyword as shown below:
ARM:LAY2:SOUR EXT
number> number>
edge >
source>
:LAYer1 and :LAYer2 are th ird leve l ke ywords, a n d
19 Gettin g Started with the HP E1340A Chapter 1
A semicolon (;) is us ed to s epara te two commands within the same subsystem, and can also save typing. For e xa mple, sending th is c omma nd messa ge:
ARM:LAY2:SOUR EXT ;SLO P POS; COUN 10
Is the same as sending these three commands:
ARM:LAY2:SOUR EXT ARM:LAY2:SLO P POS ARM:LAY2:COUN 10
Manual Format The typical format of commands listed in the command reference and
throughout t his manual is:
[SOURce:]FREQuency:MODE <mode>
Command headers enclosed in brackets are optional. UPPER CASE letters in the header are required, lower case letters can be omitted. To aid in
learni ng the AFG command set, all headers are incl uded in the example programs; however, the headers are abbreviated. In an example
program, the previous statement with a mode parameter of appear as:
FIX would
SOUR:FREQ:MODE FIX
Command Coupling Many of the AFG SCPI commands are value coupled. This means that the
value set by one command may affect the valid limits for the values of other commands. This can resu lt in "Settings Conf lict" errors when t h e program executes. To prevent these errors, the AFG commands must be executed in a "Coupling Group".
The AFG uses one coupling group. Commands not in the coupling group must precede or follow commands in the coupling group. Executing uncoupled commands in the coupling group breaks the coupling and can cause a "Settings Conflict" error.
The coupling group and associated commands can be found in Appendix B, Table B-2.
Chapter 1 Getting Started with the HP E1340A 20
How to Execute
Coupled Commands
Command coupling determines the AFG programming sequence. Coupled comma nd s must be contiguou s and execut ed in the same program statement . This is done by placing the co mmands in the same program line, or by suppressing the end-of-line terminator until the last (coupled) command has been sent (HP IBASIC progra ms on ly).
To send multiple commands in a single line or in a single statement, the commands ar e linked with a semi colon (;) and a colo n (:). This is illustrated in the foll owing l ines :
SOUR:ROSC:SO UR INT;:SOUR:F UNC: SHAP SIN
or
SOUR:ROSC:SOUR INT; :SOUR:FUNC:SHAP SIN
Both techniques are used in the programs found throughout this manual.
Note that the semicolon (;) and colon (:) link commands with in different subsystems. Only a semicolon (;) is required t o link commands within the same s ubs ystem (s ee “SCPI C o m mand Structure” earlier in this chapt er).
Note See “HP IBASIC Language Programs” later in this chapter for information
on suppressing the end-of-l ine te rmin ato r.
21 Gettin g Started with the HP E1340A Chapter 1
HP IBASIC
Language Programs
The following information identifies the system on which the HP IBASIC programs were written and shows how the programs are structured.
System Configuration Except where noted, the example programs in HP IBASIC were developed
(and tested) on the following system:
Mainframe: HP E1301A Mainframe
(IBASIC Opt io n)
HP E1340A Logical Address: 80
Instrument Language: SCPI
Program Structure The structure of an example program in HP IBASIC is s hown below:
1 !RE-SAVE“ARB_GEN” 2 !This program generates a 4096 point, 0 to 5V ramp waveform. 3 !The data is transferred to the AFG as voltages. 4! 10 !Assign I/O path between IBASIC and the E1340A. 20 ASSIGN @Afg TO 80910 30 COM @Afg, Waveform(1:4096) 40 ! 50 !Set up error checking 60 ON INTR 8 CALL Errmsg 70 ENABLE INTR 8;2 80 OUTPUT @Afg;“*CLS” 90 OUTPUT @Afg; “*SRE 32” 100 OUTPUT @Afg; “*ESE 60” 110 ! 120 !Call the subprogram which resets the AFG. 130 CALL Rst 140 !Set AFG parameters 150 OUTPUT @A fg;“SOUR:ROSC:SO UR INT;”; !re fe re nc e osci llato r 160 OUTPUT @A fg; “:SOUR:F REQ:FIX 1E3;”; !frequency 170 OUTPUT @Afg; “:SOUR:FUNC:S HAP USER; ”; !func ti on 180 OUTPUT @Afg; “:SOUR:VO LT :LEV:IMM:AMPL 5.1V ”!scale
amplitude
190 ! 200 !Call subprogram which defi ne s waveform segment . 210 CALL Ramp_wave 220 ! 230 !Select output sequence and initiate waveform 240 OUTPUT @Afg;“SOUR:FUNC:USER A” 250 OUTPUT @A fg;“INIT:IMM” !wait-for-arm stat e
Chapter 1 Getting Started with the H P E1340A 22
Contin ued on next page
260 ! 270 WAI T .1 !allow interrupt to be serviced 280 OFF INTR 8 290 END 300 ! 310 SUB Ramp_wave 320 Ramp_wave: !Subprogram which defines a ramp waveform 330 COM @Afg,Waveform(*) 340 FOR I=1 TO 4096 350 Waveform(I)=I*.00122 360 NEXT I 370 ! 380 OUT PUT @A fg; “SOUR:LIST:SEGM:SEL A”!Selec t segme nt name 390 OUT PUT @Afg;“ SOUR:LIST : SEG M:VOLT”;Wavef orm(*)!loa d
waveform point s
400 SUBEND 410 ! 420 SUB Rst 430 Rst: !Subprogram which resets the E1340. 440 COM @Afg,Waveform(*) 450 OUTPUT @A fg;“*RST;*OPC?” !reset the AFG 460 ENTER @Afg;Complete 470 SUBEND 480 ! 490 SUB Errmsg 500 Errmsg: !Subprogram which displays E1340 program ming error s 510 COM @Afg,Waveform(*) 520 DIM Message$[256] 530 !Read AFG status byte register and clear service request bit 540 B=SPOLL(@Afg) 550 !End of statem ent if error occur s among coupl ed com mands 560 OUTPUT @A fg;“” 570 OUT PUT @Afg;“ABORT” !abort output waveform 580 REPEAT 590 OUTPUT @Afg;“SYST:ERR?” !read AFG error queue 600 ENTER @Afg;Code,Message$ 610 PRINT Code,Message$
23 Gettin g Started with the HP E1340A Chapter 1
620 UNTIL Code=0 630 STOP 640 SUBEND
Turning Off (Suppressing) the End-Of-Line Terminator
As mentioned, coupled commands must be contiguous and executed in the same program statement. By su ppre ssing the end-of-line (EOL) terminator (Line Feed) on a command line, c oupled commands can be sent on separate lines, yet as a single program statement.
In HP IBASIC programs, the EOL terminator is suppressed by placing a semico lon ( ; ) following the q u otation mark ( “ ) which closes the command string. In the program above, the commands in lines 150 - 180 are in the coupling group. The semicolons following the command strings in lines 150 throu gh 170 suppre ss t h e EOL terminator; t heref ore lines 15 0 ­180 are sent as a single statement.
Getting Programs
The HP IBASIC programs are stored on the disk as ASCII files. The program name is shown in the program titl e and in line 1 of the pr ogram
1 !RE-SAVE"ARB_GEN"). To get a program, type:
(e.g.,
GET “file name” (e.g., GET “ARB_GEN”)
Declaring IBASIC Variables in COM (common) Memory
When writing or modifying IBASIC programs , array variables can b e declared in COM (common) memory. Variables not in COM memory resid e in the IBASIC stack. The ’stack’ is a 32 kB yte (d efault) s egmen t of memo ry which contai ns components su ch as pointers and lo cal variab les f or subprograms and de clarations. When too many variables (or too large a n array) are in the stack, Error 2 - Memory Overflow will occur. If a memory overflow occurs, the stack size can be changed with the command
PROGram:MALLocate < nbytes> (see the Instr ument BASIC User’s Man ual
for more information).
Chapter 1 Getting Started with the HP E1340A 24
C La nguage
Programs
All of the C Language example programs in this manual are written for the HP 82335 HP-IB Inter fa ce Car d using the HP-IB Command Library for C. Unless otherwise noted, the library functions used in the programs are com patible with the ANSI C standard.
The following identifies the system on which the programs are written, shows how to compile the programs, and gives a typical example program.
System Configuration The C programs were developed on the following syst em:
Controller: HP Vectra 386/25 personal computer
(386 processor operated at 25 MHz)
HP-IB Interface Card: HP 82335 HP-IB Interface with
Command Library
Mainframe: HP 75000 Series B/C
Slot0/Resource Manager: HP E1301A Mainframe/E14 05/E1 406
Command Module
HP E1340A Logical Address:80
Instrument Language: SCPI
C Compiler Used Unless otherwise noted, all C Language programs were co mpiled (and
tested) using the following compilers:
Microsoft
Microsoft
Bo rland Turbo C
Borland Turbo C++
®
C Version 5.10
®
QuickC© Version 2.0
©
Version 2.0
©
Version 1.0
Running a Program To run a program, first comp ile and link the program to make an executable
file. To compile a program:
Link the approp riate HP-IB C libra r y (located on t he HP-IB
Command Library disk that came with the HP-IB Interface Card). Use the following libraries :
Microsoft
®
C and QuickC©: clhpib.lib
25 Gettin g Started with the HP E1340A Chapter 1
Turbo C
©
and C++©: tchhpib.lib
If NOT compiling i n the Large/Huge memory mode l, inc lu d e the
“cfunc.h” header file in the program (located on the HP-IB Command Library disk that came with the HP-IB Interface Card).
Be sure the necessary paths have been added to the
AUTOEXEC.BAT file for the co mpilers to find the library and header files (s ee the app ropr ia t e C Language manual to set the proper pat hs).
To compile t he progra ms fr om the DOS command line using the Large memory model, execute the following:
Microsoft
cl /AL <path \pro gram na m e> path \clhpib.lib
Microsoft
qcl /AL <pat h \pro gram na m e> path \clhpib.lib
Turbo C
tcc -ml <path \program name> path \tchhpib.lib
Change the “
®
C:
®
QuickC©:
©
and Turbo C++©:
/AL” and “-ml” parameters to t he appropriate types when
compiling in the smal ler mem or y models (see t he appropriate C Lang u age manual for the parameter type).
C Program Example Following is an example program written in C using the HP 82335 HP- IB
Interface Card. The program:
sends commands to the AFG to generate an arb itrary wa veform
receives data from t he AFG
shows how to send coupled commands
performs error checking of the AFG
Chapter 1 Getting Started with the HP E1340A 26
/* ARB_GEN.C - This program generates a 4096 points ramp. The data to */ /* generate the ramp is transferred to the AFG as voltages */
/* Include the following header files */ #include <stdio.h> #include <string.h> #include <malloc.h> /* Use “alloc.h” for Turbo C(c) or C++(c) */ #include <cfunc.h> /* This file is f r om the HP-IB Command Library Disk */
#define ISC 7L /* Assigns the HP-IB select code */ #define ADDR 70910L /*
Assign an I/O path between the computer and the AFG */
/* Functions */ void gen_seg(void); void cmd_exe(char *commands[], int length); void run_query(void); void rst_clr(void); void send_data(char *commands, float *Wave_seg, int num_size); void check_error(char *func_tion);
/*********************************************************************************/ void main(void) /* Run the program */ { rst_clr( ); /* Reset the AFG */ gen_seg(); /* Generate segment list and output sequence */ run_query(); /* Query wav eform segment memory */ } /*********************************************************************************/ void gen_seg(void) { char static *set_com m ands[] =/* Use “set_commands” to setup the AFG */ { “SOUR:ROSC:SOUR INT; ” /* Select the Ref. Oscillator */ “:SOUR:FREQ:FIX 1e3;” /* Set waveform frequency */ “:SOUR:FUNC:SHAP USER;” /*
Command to select the user function */
“:SOUR:VOLT:LEV: IMM: AMP L 5.1V”, /* Set the amplit ude */
“SOUR:LIST:SEGM :SE L a” /* Select the segm ent nam e */ },
27 Gettin g Started with the HP E1340A Chapter 1
Contin ued on next page
*seg_commands = /* Use “seg_commands” to store segm ents */
“SOUR:LIST:SEGM:VOLT ”, /* Command to send volts data */
*out_commands[] = / *
Use th e “out_com mands” array to generate outpu t */
{ “SOUR:FUNC:USER a”, /* Select the user name */ “INIT:IMM” /* Start waveform generation */ };
float *Wave_seg; int loop,
seg_size = 4096; /* Set the segment size to 4096 point s */
/*
Allocate sufficient memory for storing the segments into computer memory */
Wave_seg = (float*) malloc (seg_size * sizeof (float));
/* Setup the AFG */
cmd_exe (set_commands, sizeof(set_commands) / sizeof(char*));
/* Call routine to check for AFG errors */
check_error(“gen_seg (set_com mands)”);
/* Calculate the segments */
for (loop = 0; loop < seg_size; loop ++)
Wave_seg[loop] = (loop * .00122);
/* Call function to execut e the fi nal comm and with segment data */
send_data(seg_commands, Wav e_ seg, seg_size);
/* Call routine to check for AFG errors */
check_error(“gen_seg (seg_commands)”);
/* Setup the AFG for output */
cmd_exe(out _comm ands, sizeof(out_commands) / sizeof( char*));
/* Call routine to check for AFG errors */
check_error(“gen_seg (out_commands)”);
Contin ued on next page
Chapter 1 Getting Started with the HP E1340A 28
/* Free the allocated memory */ free (Wave_seg); } /*********************************************************************************/ void cmd_exe(char *commands[] , int length) { int loop;
/* Execute each command group using a loop */ for (loop = 0; loop < length; loop++)
IOOUTPUTS(ADDR, commands[loop], strlen(commands[loop])); }
/*********************************************************************************/ void send_data(char *commands, float *Wave _ seg, int num_ size) { char static state[2] = {13, 10};
/*
First disable EOI and EOL to send continuous data to the AFG; send last
command
*/ IOEOI (ISC, 0);IOEOL (ISC, “ ”, 0); IOOUTPUTS (ADDR, commands, strlen(commands));
/*
Re-enable EOL and EO I for normal HP-IB operat i on; th en send the data */
IOEOI (ISC, 1);IOEOL (ISC, state, 2); IOOUTPUTA (ADDR, Wave_seg, num_size); } /*********************************************************************************/ void run_query(void) { char name[6]; int length = 5;
/* Query segment memory */ IOOUTPUTS(ADDR, “SOUR:LIST:SEGM:SEL?”, 19); IOENTERS(ADDR, name, &length);
29 Gettin g Started with the HP E1340A Chapter 1
printf(“\nWavef orm Segm ent curr entl y sel ect ed: % s”, name); }
Contin ued on next page
/*********************************************************************************/ void rst_clr(void) { flo at in to ;
/*
Executes the commands that resets th e AFG and clears its error register */
IOOUTPUTS(ADDR, “*RST;*OPC?”, 10); IOENTER(ADDR, &int o); IOOUTPUTS(ADDR, “*CLS;*OPC?”, 10); IOENTER(ADDR, &int o); } /*********************************************************************************/ void check_error(char *func_tion) { char into[161]; int length = 160;
IOOUTPUT S(ADDR, “SYST:ERR?”, 9); /* Query error register */ IOENTERS(ADDR, into, &length) ; /* Enter error message */
if (atoi(into) != 0) /* Determine if error is present */
/* If errors present, print and exit */
{
while (atoi(into) != 0)
{
printf(“Error %s in function %s\n\n”, into, func_ti on); IOOUTPUTS(ADDR, “SYST:ERR?”, 9); IOENTERS(ADDR, into, &length);
}
exit(1); } }
Chapter 1 Getting Started with the HP E1340A 30
Loading...
+ 265 hidden pages