Measurement Guide and Programming Examples PSA and ESA Series Spectrum Analyzers This manual provides documentation for the following instruments: Agilent Technologies PSA Series E4443A (3 Hz - 6.7 GHz) E4445A (3 Hz - 13.2 GHz) E4440A (3 Hz - 26.5 GHz) E4446A (3 Hz - 44 GHz) E4448A (3 Hz - 50 GHz) Agilent Technologies ESA-E Series E4401B (9 kHz - 1.5 GHz) E4402B (9 kHz - 3.0 GHz) E4404B (9 kHz - 6.7 GHz) E4405B (9 kHz - 13.2 GHz) E4407B (9 kHz - 26.5 GHz) Agilent Technologies ESA-L Series E4411B (9 kHz - 1.
Notice The information contained in this document is subject to change without notice. Agilent Technologies makes no warranty of any kind with regard to this material, including but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Agilent Technologies 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.
WARNING This is a Safety Class 1 Product (provided with a protective earth ground incorporated in the power cord). The mains plug shall be inserted only in a socket outlet provided with a protected earth contact. Any interruption of the protective conductor inside or outside of the product is likely to make the product dangerous. Intentional interruption is prohibited. WARNING No operator serviceable parts inside. Refer servicing to qualified personnel. To prevent electrical shock do not remove covers.
Contents Table of Contents 1. Recommended Test Equipment 2. Measuring Multiple Signals Comparing Signals on the Same Screen Using Marker Delta . . . . . . . . . . . . . . . . . . . . . . . 12 Comparing Signals on the Same Screen Using Marker Delta Pair . . . . . . . . . . . . . . . . . . . . 14 Comparing Signals not on the Same Screen Using Marker Delta . . . . . . . . . . . . . . . . . . . . 15 Resolving Signals of Equal Amplitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Contents 9. Measuring Digital Communications Signals Making Burst Power Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 Making Statistical Power Measurements (CCDF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 Making Adjacent Channel Power (ACP) Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . .74 Making Multi-Carrier Power (MCP) Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents 16.ESA/PSA Programming Examples Examples Included in this Chapter: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Finding Additional Examples and More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Programming Examples Information and Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 166 Programming in C Using the VTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents Contents Using C Over Socket LAN (Windows NT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .323 Using Java Programming Over Socket LAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .326 Using the VXI Plug-N-Play Driver in LabVIEW® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .335 Using LabVIEW® 6 to Make an EDGE GSM Measurement . . . . . . . . . . . . . . . . . . . . . . .336 Using Visual Basic® .
Recommended Test Equipment 1 Recommended Test Equipment 9
Recommended Test Equipment NOTE To find descriptions of specific analyzer functions, for the ESA, refer to the Agilent Technologies ESA Series Spectrum Analyzers User’s/Programmer’s Reference Guide and for the PSA, refer to the Agilent Technologies PSA Series Spectrum Analyzers User’s and Programmer’s Reference Guide. Recommended Test Equipment Test Equipment Specifications Recommended Model 0.25 MHz to 4.
Measuring Multiple Signals 2 Measuring Multiple Signals 11
Measuring Multiple Signals Comparing Signals on the Same Screen Using Marker Delta Comparing Signals on the Same Screen Using Marker Delta Using the analyzer, you can easily compare frequency and amplitude differences between signals, such as radio or television signal spectra. The analyzer delta marker function lets you compare two signals when both appear on the screen at one time.
Measuring Multiple Signals Comparing Signals on the Same Screen Using Marker Delta Step 4. Place a marker at the highest peak on the display (10 MHz): Press Peak Search. The Next Pk Right and Next Pk Left softkeys are available to move the marker from peak to peak. The marker should be on the 10 MHz reference signal: Step 5. Anchor the first marker and activate a second marker: Press Marker, Delta. The label on the first marker now reads 1R, indicating that it is the reference point. Step 6.
Measuring Multiple Signals Comparing Signals on the Same Screen Using Marker Delta Pair Comparing Signals on the Same Screen Using Marker Delta Pair In this procedure, the analyzer 10 MHz signal is used to measure frequency and amplitude differences between two signals on the same screen using the delta pair marker function. Step 1. Refer to the previous procedure “Comparing Signals on the Same Screen Using Marker Delta” on page 12 and follow steps 1, 2 and 3. Step 2.
Measuring Multiple Signals Comparing Signals not on the Same Screen Using Marker Delta Comparing Signals not on the Same Screen Using Marker Delta Measure the frequency and amplitude difference between two signals that do not appear on the screen at one time. (This technique is useful for harmonic distortion tests when narrow span and narrow bandwidth are necessary to measure the low level harmonics.
Measuring Multiple Signals Comparing Signals not on the Same Screen Using Marker Delta Step 3. Set the center frequency, span and reference level to view only the 10 MHz signal: Press FREQUENCY Channel, Center Freq, 10, MHz. Press SPAN X Scale, Span, 5, MHz. Press AMPLITUDE Y Scale, Ref Level, 10, dBm. Step 4. Place a marker on the 10 MHz peak and then set the center frequency step size equal to the marker frequency (10 MHz): Press Peak Search. Press Marker →, Mkr → CF Step. Step 5.
Measuring Multiple Signals Resolving Signals of Equal Amplitude Resolving Signals of Equal Amplitude In this procedure a decrease in resolution bandwidth is used in combination with a decrease in video bandwidth to resolve two signals of equal amplitude with a frequency separation of 100 kHz. Notice that the final RBW selection to resolve the signals is the same width as the signal separation while the VBW is slightly narrower than the RBW. Step 1.
Measuring Multiple Signals Resolving Signals of Equal Amplitude Figure 2-7 Unresolved Signals of Equal Amplitude (ESA) Step 4. Change the resolution bandwidth (RBW) to 100 kHz so that the RBW setting is less than or equal to the frequency separation of the two signals: Press BW/Avg, Res BW, 100, kHz. Notice that the peak of the signal has become flattened indicating that two signals may be present. Measuring Multiple Signals Step 5. Decrease the video bandwidth to 10 kHz: Press Video BW, 10, kHz.
Measuring Multiple Signals Resolving Signals of Equal Amplitude As the resolution bandwidth is decreased, resolution of the individual signals is improved and the sweep time is increased. For fastest measurement times, use the widest possible resolution bandwidth. Under factory preset conditions, the resolution bandwidth is “coupled” (or linked) to the span.
Measuring Multiple Signals Resolving Small Signals Hidden by Large Signals Resolving Small Signals Hidden by Large Signals This procedure uses narrow resolution bandwidths to resolve two input signals with a frequency separation of 155 kHz and an amplitude difference of 60 dB. Step 1. Connect two sources to the analyzer input as shown in Figure 2-6. Step 2. Set one source to 300 MHz at −10 dBm. Set the second source to 300.05 MHz, so that the signal is 50 kHz higher than the first signal.
Measuring Multiple Signals Resolving Small Signals Hidden by Large Signals Figure 2-9 Signal Resolution with a 30 kHz RBW (ESA left, PSA right) Step 5. Reduce the resolution bandwidth filter to view the smaller hidden signal. Place a delta marker on the smaller signal: Press BW/Avg, 1, kHz. Press Peak Search, Marker, 50, kHz. The ESA 1 kHz filter shape factor of 15:1 (PSA is 4.1:1) has a bandwidth of 15 kHz at the 60 dB point (PSA has a BW of 4.1 kHz). The half-bandwidth (7.5 kHz for ESA and 2.
Measuring Multiple Signals Decreasing the Frequency Span Around the Signal Decreasing the Frequency Span Around the Signal Using the analyzer signal track function, you can quickly decrease the span while keeping the signal at center frequency. This is a fast way to take a closer look at the area around the signal to identify signals that would otherwise not be resolved. This procedure uses signal tracking and span zoom to view the analyzer 50 MHz reference signal in a 200 kHz span. Step 1.
Measuring Multiple Signals Decreasing the Frequency Span Around the Signal Step 6. Reduce span and resolution bandwidth to zoom in on the marked signal: Press SPAN X Scale, Span, 200, kHz. If the span change is large enough, the span decreases in steps as automatic zoom is completed. See Figure 2-11 on the right side. You can also use the front-panel knob or step keys to decrease the span and resolution bandwidth values. NOTE Step 7. Turn off signal tracking: Press FREQUENCY Channel, Signal Track (Off).
Measuring Multiple Signals Measuring Multiple Signals Decreasing the Frequency Span Around the Signal 24 Chapter 2
Measuring a Low−Level Signal Measuring a Low−Level Signal 3 25
Measuring a Low−Level Signal Reducing Input Attenuation Reducing Input Attenuation The ability to measure a low-level signal is limited by internally generated noise in the spectrum analyzer. The measurement setup can be changed in several ways to improve the analyzer sensitivity. The input attenuator affects the level of a signal passing through the instrument. If a signal is very close to the noise floor, reducing input attenuation can bring the signal out of the noise.
Measuring a Low−Level Signal Reducing Input Attenuation Step 6. Set the attenuation to 20 dB: Press AMPLITUDE Y Scale, Attenuation, 20, dB. Note that increasing the attenuation moves the noise floor closer to the signal level. A “#” mark appears next to the Atten annotation at the top of the display, indicating that the attenuation is no longer coupled to other analyzer settings. Step 7. To see the signal more clearly, set the attenuation to 0 dB: Press AMPLITUDE, Attenuation, 0, dB.
Measuring a Low−Level Signal Decreasing the Resolution Bandwidth Decreasing the Resolution Bandwidth Resolution bandwidth settings affect the level of internal noise without affecting the level of continuous wave (CW) signals. Decreasing the RBW by a decade reduces the noise floor by 10 dB. Step 1. Refer to the first procedure “Reducing Input Attenuation” on page 26 of this chapter and follow steps 1, 2 and 3. Step 2. Decrease the resolution bandwidth: Press BW/Avg, ↓.
Measuring a Low−Level Signal Using the Average Detector and Increased Sweep Time Using the Average Detector and Increased Sweep Time When the analyzer’s noise masks low-level signals, changing to the average detector and increasing the sweep time smooths the noise and improves the signal’s visibility. Slower sweeps are required to average more noise variations. Step 1. Refer to the first procedure “Reducing Input Attenuation” on page 26 of this chapter and follow steps 1, 2 and 3. Step 2.
Measuring a Low−Level Signal Trace Averaging Trace Averaging Averaging is a digital process in which each trace point is averaged with the previous average for the same trace point. Selecting averaging, when the analyzer is autocoupled, changes the detection mode (from peak in ESA and normal in PSA) to sample, smoothing the displayed noise level.
Improving Frequency Resolution and Accuracy 4 Improving Frequency Resolution and Accuracy 31
Improving Frequency Resolution and Accuracy Improving Frequency Resolution and Accuracy Using a Frequency Counter to Improve Frequency Resolution and Accuracy Using a Frequency Counter to Improve Frequency Resolution and Accuracy This procedure uses the spectrum analyzer internal frequency counter to increase the resolution and accuracy of the frequency readout. Step 1. Preset the analyzer: Press Preset, Factory Preset (if present). Step 2.
Figure 4-1 Using Marker Counter (ESA Display) Step 6. Change counter resolution: ESA frequency-counter resolution can be set from 1 Hz to 100 kHz by pressing Freq Count, Resolution. PSA frequency-counter resolution is fixed at 0.001 Hz for 2 ms and longer gate times. Longer gate times allow for greater averaging of signals whose frequency is "noisy", at the expense of throughput.
Improving Frequency Resolution and Accuracy Improving Frequency Resolution and Accuracy Using a Frequency Counter to Improve Frequency Resolution and Accuracy 34 Chapter 4
Tracking Drifting Signals 5 Tracking Drifting Signals 35
Tracking Drifting Signals Measuring a Source’s Frequency Drift Measuring a Source’s Frequency Drift The analyzer can measure the short- and long-term stability of a source. The maximum amplitude level and the frequency drift of an input signal trace can be displayed and held by using the maximum-hold function. You can also use the maximum hold function if you want to determine how much of the frequency spectrum a signal occupies.
Tracking Drifting Signals Measuring a Source’s Frequency Drift Step 7. Activate trace 2 (trace 2 should be underlined) and change the mode to continuous sweeping: (ESA) Press View/Trace, Trace (2). (PSA) Press Trace/View, Trace (2). Press Clear Write. Trace 1 remains in maximum hold mode to show any drift in the signal. Step 8. Slowly change the frequency of the signal generator ± 50 kHz in 1 kHz increments. Your analyzer display should look similar to Figure 5-1.
Tracking Drifting Signals Tracking a Signal Tracking a Signal Tracking Drifting Signals The signal track function is useful for tracking drifting signals that drift relatively slowly by keeping the signal centered on the display as the signal drifts. This procedure tracks a drifting signal. Note that the primary function of the signal track function is to track unstable signals, not to track a signal as the center frequency of the analyzer is changed.
Making Distortion Measurements 6 Making Distortion Measurements 39
Making Distortion Measurements Identifying Analyzer Generated Distortion Identifying Analyzer Generated Distortion High level input signals may cause analyzer distortion products that could mask the real distortion measured on the input signal. Using trace 2 and the RF attenuator, you can determine which signals, if any, are internally generated distortion products. Using a signal from a signal generator, determine whether the harmonic distortion products are generated by the analyzer. Step 1.
Making Distortion Measurements Identifying Analyzer Generated Distortion Step 7. To determine whether the harmonic distortion products are generated by the analyzer, first save the trace data in trace 2 as follows: (ESA) Press View/Trace, Trace (2), Clear Write. (PSA) Press Trace/View, Trace (2), Clear Write. Step 8. Allow trace 2 to update (minimum two sweeps), then store the data from trace 2 and place a delta marker on the harmonic of trace 2: Press View. Press Peak Search, Marker, Delta.
Making Distortion Measurements Third-Order Intermodulation Distortion Third-Order Intermodulation Distortion Two-tone, third-order intermodulation distortion is a common test in communication systems. When two signals are present in a non-linear system, they can interact and create third-order intermodulation distortion products that are located close to the original signals. These distortion products are generated by system components such as amplifiers and mixers.
Making Distortion Measurements Third-Order Intermodulation Distortion Step 3. Set the analyzer center frequency and span: Press Preset, Factory Preset (if present). Press FREQUENCY Channel, Center Freq, 300.5, MHz. Press SPAN X Scale, Span, 5, MHz. Step 4. Reduce the RBW until the distortion products are visible: Press BW/Avg, Res BW, ↓. Step 5. Set the mixer level to improve dynamic range: (ESA) Press AMPLITUDE Y Scale, More, Max Mixer Lvl, –30, dBm.
Making Distortion Measurements Measuring TOI Distortion with a One-Button Measurement Measuring TOI Distortion with a One-Button Measurement One-button power measurements are a part of the Power Suite measurement utility and are standard on all ESA and PSA models. Power Suite uses preset analyzer states to measure some of the more common RF power tests. You can modify the preset states in the Power Suite measurements, giving you the flexibility to modify analyzer settings.
Making Distortion Measurements Measuring Harmonics and Harmonic Distortion with a One-Button Measurement Measuring Harmonics and Harmonic Distortion with a One-Button Measurement This procedure measures the harmonics of the 10 MHz reference output signal. The harmonics and total harmonic distortion are measured using the one-button automated harmonic measurement. Step 1. Preset the analyzer: Press Preset, Factory Preset (if present). Step 2.
Making Distortion Measurements Measuring Harmonics and Harmonic Distortion with a One-Button Measurement Figure 6-6 Measuring the Harmonic Distortion The amplitudes of the harmonics are listed relative to the fundamental frequency. Making Distortion Measurements NOTE An asterisk (*) appearing next to the total harmonic distortion value indicates that the ideal resolution bandwidths for one or more harmonics could not be set.
7 Measuring Noise Measuring Noise 47
Measuring Noise Measuring Signal-to-Noise Measuring Signal-to-Noise Signal-to-noise is a ratio used in many communication systems as an indication of noise in a system. Typically the more signals added to a system adds to the noise level, reducing the signal-to-noise ratio making it more difficult for modulated signals to be demodulated. This measurement is also referred to as carrier-to-noise in some communication systems.
Measuring Noise Measuring Signal-to-Noise measurement results: (ESA) Press Marker, More, Function, Marker Noise. (PSA) Press Marker Fctn, Marker Noise. Figure 7-1 Measuring the Signal-to-Noise Read the signal-to-noise in dB/Hz, that is with the noise value determined for a 1 Hz noise bandwidth. If you wish the noise value for a different bandwidth, decrease the ratio by 10 × log ( BW ) .
Measuring Noise Measuring Noise Using the Noise Marker Measuring Noise Using the Noise Marker This procedure uses the marker function, Marker Noise, to measure noise in a 1 Hz bandwidth. In this example the noise marker measurement is made near the 50 MHz reference signal to illustrate the use of Marker Noise. Step 1. Enable the internal 50 MHz reference signal of the analyzer: (PSA) Press Input/Output, Input Port, Amptd Ref. (ESA E4401B and E4411B) Press Input/Output, Amptd Ref (On).
Measuring Noise Measuring Noise Using the Noise Marker Increasing the sweep time when the average detector is enabled allows the trace to average over a longer time interval, thus reducing the variations in the results (increases measurement repeatability). Step 5. Move the marker to 50 MHz (left display Figure 7-2): Press Marker. Rotate the front-panel knob until the noise marker reads 50 MHz. The noise marker value is based on the mean of 5% of the total number of sweep points centered at the marker.
Measuring Noise Measuring Noise-Like Signals Using Marker Pairs Measuring Noise-Like Signals Using Marker Pairs Marker pairs let you measure power over a frequency span. The markers allow you to easily and conveniently select any arbitrary portion of the displayed signal. However, while the analyzer, when autocoupled, makes sure the analysis is power-responding (rms voltage-responding), you must set all of the other parameters. Step 1. Preset the analyzer: Press Preset, Factory Preset (if present).
Measuring Noise Measuring Noise-Like Signals Using Marker Pairs Figure 7-3 Band Power Marker Power Measurement (ESA left, PSA right) Step 7. Set the marker span pair to Center to move the markers (set at 40 kHz span) around without changing the span. Use the front-panel knob to move the band power markers and note the change in the power reading: Press Marker, Span Pair (Center), then rotate front-panel knob. NOTE You can also use Delta Pair to set the measurement start and stop points independently.
Measuring Noise Measuring Noise-Like Signals Using the Channel Power Measurement Measuring Noise-Like Signals Using the Channel Power Measurement You may want to measure the total power of a noise-like signal that occupies some bandwidth. Typically, channel power measurements are used to measure the total (channel) power in a selected bandwidth for a modulated (noise-like) signal.
Measuring Noise Measuring Noise-Like Signals Using the Channel Power Measurement Step 7. Optimize the analyzer reference level setting: Press Meas Setup, Optimize Ref Level. Your display should be similar to Figure 7-4. Figure 7-4 Measuring Channel Power (ESA left, PSA right) The power reading is essentially that of the tone; that is, the total noise power is far enough below that of the tone that the noise power contributes very little to the total.
Measuring Noise Measuring Noise Measuring Noise-Like Signals Using the Channel Power Measurement 56 Chapter 7
Making Time-Gated Measurements 8 Making Time-Gated Measurements 57
Making Time-Gated Measurements Making Time-Gated Measurements Generating a Pulsed-RF FM Signal Generating a Pulsed-RF FM Signal Traditional frequency-domain spectrum analysis provides only limited information for certain signals.
Table 8-2 ESG #2 Internal Function Generator (LF OUT) Settings LF Out Source FuncGen LF Out Waveform Pulse LF Out Period 5 ms LF Out Width (pulse width) 4 ms LF Out Amplitude 2.5 Vp LF Out On RF On/Off Off Mod On/Off On Step 2. Set up ESG #1 to transmit a pulsed-RF signal with frequency modulation. Set the FM deviation to 1 kHz and the FM rate to 50 kHz: ESG #1 generates the pulsed FM signal by frequency modulating the carrier signal and then pulse modulating the FM signal.
Making Time-Gated Measurements Making Time-Gated Measurements Generating a Pulsed-RF FM Signal Step 3. Set up the oscilloscope to view the trigger, gate and RF signals (see Figure 8-1 for an example of the oscilloscope display): Table 8-4 Agilent Infiniium Oscilloscope with 3 or more input channels: Instrument Connections Timebase 1 ms/div Channel 1 ON, 2 V/div, OFFSET = 2 V, DC coupled, 1 M Ω input, connect to the pulse signal (ESG LF OUTPUT or pulse generator OUTPUT).
Connecting the Instruments to Make Time-Gated Measurements Figure 8-2 shows a block diagram of the test setup. ESG #1 produces a pulsed FM signal by using an external pulse signal. The external pulse signal is connected to the front of the ESG #1 to the EXT 2 INPUT to control the pulsing. The pulse signal is also used as the trigger signal. The oscilloscope is useful for illustrating timing interactions between the trigger signal and the gate. PSA Gate View could be used in place of the oscilloscope.
Making Time-Gated Measurements Making Time-Gated Measurements Gated LO Measurement (PSA) Gated LO Measurement (PSA) This procedure utilizes gated LO to gate the FM signal. For concept and theory information about gated LO see “How Time Gating Works” on page 135. Step 1. Set the PSA center frequency, span and reference level: Press FREQUENCY Channel, Center Freq, 40, MHz. Press SPAN X Scale, Span, 500, kHz. Press AMPLITUDE Y Scale, Ref Level, −15, dBm.
In Figure 8-3 the vertical green parallel bars represent the gate settings. The first (left) bar is set at the delay time while the second (right) bar is set at the gate length, measured from the first bar. The trace of the signal in this time-domain view is the RF envelope. The gate signal is triggered off of the positive edge of the trigger signal. When positioning the gate, a good starting point is to have it extend from 20% to 80% of the way through the pulse (for the PSA with linear-phase RBW filters).
Making Time-Gated Measurements Making Time-Gated Measurements Gated Video Measurement (ESA) Gated Video Measurement (ESA) This procedure utilizes gated video to gate the FM signal. For concept and theory information about gated video see “How Time Gating Works” on page 135. Step 1. Set the ESA center frequency, span and reference level: Press FREQUENCY Channel, Center Freq, 40, MHz. Press SPAN X Scale, Span, 500, kHz. Press AMPLITUDE Y Scale, Ref Level, 0, dBm. Step 2.
Step 3. Set the gate delay to 2 ms and the gate length to 1 ms. Check that the gate control is set to edge with a positive trigger: Press Sweep, Gate, Gate Control (Edge). Press Edge Gate, Slope (Pos). Press Gate Delay, 2, ms. Press Gate Length, 1, ms. Step 4. Turn the gate on: Press Sweep, Gate, Gate (On). Figure 8-6 Viewing the FM Signal of a Pulsed RF Signal using Gated Video Step 5. Notice that the gated spectrum is much cleaner than the ungated spectrum (as seen in Figure 8-5).
Making Time-Gated Measurements Making Time-Gated Measurements Gated FFT Measurement (PSA) Gated FFT Measurement (PSA) This procedure utilizes gated FFT to gate the FM signal. For concept and theory information about gated FFT see “How Time Gating Works” on page 135. Step 1. Set the PSA center frequency, span and reference level: Press FREQUENCY Channel, Center Freq, 40, MHz. Press SPAN X Scale, Span, 500, kHz. Press AMPLITUDE Y Scale, Ref Level, −15, dBm. Step 2.
Measuring Digital Communications Signals 9 Measuring Digital Communications Signals 67
Measuring Digital Communications Signals Making Burst Power Measurements Making Burst Power Measurements Measuring Digital Communications Signals PSA and ESA spectrum analyzers make power measurements on digital communication signals fast and repeatable by providing a comprehensive suite of power-based one-button automated measurements with pre-set standards-based format setups.
Measuring Digital Communications Signals Making Burst Power Measurements Full Screen Display of Burst Power Measurement Results NOTE Press the Return key to exit the full screen display without changing any parameter values. Step 6. Select one of the following three trigger methods to capture the bursted signal (RF burst is recommended, if available): Press Trig, RF Burst. For more information on trigger selections see “Trigger Concepts” on page 153.
Measuring Digital Communications Signals Measuring Digital Communications Signals Making Burst Power Measurements NOTE If you set the burst width manually to be wider than the screen’s display, the vertical white lines move off the edges of the screen. This could give misleading results as only the data on the screen can be measured. NOTE The Bluetooth standard states that power measurements should be taken over at least 20% to 80% of the duration of the burst. Step 9.
Measuring Digital Communications Signals Making Statistical Power Measurements (CCDF) Making Statistical Power Measurements (CCDF) NOTE CCDF can be measured with ESA-E series analyzers with option AYX or B7D and with all PSA series analyzers. All CDMA signals, and W-CDMA signals in particular, are characterized by high power peaks that occur infrequently. It is important that these peaks are preserved otherwise separate data channels can not be received properly.
Measuring Digital Communications Signals Making Statistical Power Measurements (CCDF) Measuring Digital Communications Signals Figure 9-3 Power Stat CCDF Measurement on a W-CDMA Signal Step 5. Store your current measurement trace for future reference: Press Display, Store Ref Trace. When the power stat CCDF measurement is first made, the graphical display should show a signal typical of pure noise. This is labelled Gaussian, and is shown in aqua. Your CCDF measurement is displayed as a yellow plot.
Measuring Digital Communications Signals Making Statistical Power Measurements (CCDF) Step 7. Change the measurement bandwidth to 1 MHz: Press Meas Setup, Meas BW, 1, MHz. Reducing the measurement bandwidth to 1 MHz NOTE If you choose a measurement bandwidth setting that the analyzer cannot display, it automatically sets itself to the closest available bandwidth setting. Measuring Digital Communications Signals Figure 9-5 Step 8.
Measuring Digital Communications Signals Making Adjacent Channel Power (ACP) Measurements Making Adjacent Channel Power (ACP) Measurements The adjacent channel power (ACP) measurement is also referred to as the adjacent channel power ratio (ACPR) and adjacent channel leakage ratio (ACLR). We use the term ACP to refer to this measurement. Measuring Digital Communications Signals ACP measures the total power (rms voltage) in the specified channel and up to six pairs of offset frequencies.
Measuring Digital Communications Signals Making Adjacent Channel Power (ACP) Measurements Figure 9-6 ACP Measurement on a Base Station W-CDMA Signal Measuring Digital Communications Signals The frequency offsets, channel integration bandwidths, and span settings can all be modified from the default settings selected by the radio standard. Two vertical white lines indicate the bandwidth limits of the central channel being measured.
Measuring Digital Communications Signals Making Adjacent Channel Power (ACP) Measurements Measuring Digital Communications Signals Figure 9-7 Measuring a Third Adjacent Channel Step 8. Set pass/fail limits for each offset: Press Meas Setup, Offset/Limits, Offset (A), Neg Offset Limit, −55, dB, Pos Offset Limit, −55, dB, Offset (B), Neg Offset Limit, −65, dB, Pos Offset Limit, −65, dB, Offset (C), Neg Offset Limit, −65, dB, Pos Offset Limit, −65, dB. Step 9.
Measuring Digital Communications Signals Making Multi-Carrier Power (MCP) Measurements Making Multi-Carrier Power (MCP) Measurements The following example shows how to make an MCP measurement on a W-CDMA base station broadcasting with 8 carriers on and with two carriers off. The transmitting carriers are spaced at 5 MHz intervals at the following frequencies: 977.5 MHz, 982.5 MHz, 987.5 MHz, 992.5 MHz, 1.0075 GHz, 1.0125 GHz, 1.0175 GHz and 1.0225 GHz.
Measuring Digital Communications Signals Making Multi-Carrier Power (MCP) Measurements Press Meas Setup, Carrier Setup, Carriers, 10, Enter. Step 6. Configure carrier 5 to have no power present: Press Meas Setup, Carrier Setup, Configure Carriers, Carrier, 5, Enter, Carrier Pwr Present (No). Step 7. Repeat step 6, configuring carrier 6 to have no power present. Measuring Digital Communications Signals Step 8. Display the results in full screen view (see Figure 9-9): Press Display, Full Screen.
Measuring Digital Communications Signals Making Multi-Carrier Power (MCP) Measurements Figure 9-10 Combined Spectrum and Bar Graph View Press File, Save, Type, More, Measurement Results, Save Now. The results are stored in a comma separated values format to be viewed by any personal computer spreadsheet application. All data shown on the display is included in this file. Chapter 9 79 Measuring Digital Communications Signals Step 11. Save the results file to a disk.
Measuring Digital Communications Signals Measuring Digital Communications Signals Making Multi-Carrier Power (MCP) Measurements 80 Chapter 9
Using External Millimeter Mixers (Option AYZ) 10 Using External Millimeter Mixers (Option AYZ) 81
Using External Millimeter Mixers (Option AYZ) Making Measurements With Agilent 11970 Series Harmonic Mixers Making Measurements With Agilent 11970 Series Harmonic Mixers External harmonic mixers can be used to extend the frequency range of the E4407B, E4440A, E4446A and E4448A spectrum analyzers. Agilent Technologies manufactures external mixers that do not require biasing and cover frequency ranges from 18 GHz to 110 GHz.
Using External Millimeter Mixers (Option AYZ) Making Measurements With Agilent 11970 Series Harmonic Mixers Step 2. Perform a factory preset: Press Preset, Factory Preset (if present). Step 3. Set up a high frequency signal on a microwave signal generator (no modulation required). Set the frequency to 35 GHz and the amplitude to 0 dBm. Step 4. Select external mixing, and then select band A (from 26.5 to 40 GHz): Press Input/Output, Input Mixer, Input Mixer (Ext). Press Ext Mix Band, 26.5−40 GHz (A).
Using External Millimeter Mixers (Option AYZ) Setting Harmonic Mixer Bias Current Setting Harmonic Mixer Bias Current The Agilent 11970 Series harmonic mixers do not require an external bias current. Harmonic mixers that require bias can also be used. The conversion loss calibration data for mixers requiring an external bias current are most accurate when the correct bias conditions are applied. Step 1.
Using External Millimeter Mixers (Option AYZ) Entering Conversion-Loss Correction Data for Harmonic Mixers Entering Conversion-Loss Correction Data for Harmonic Mixers You may want to correct your measurement for the conversion-loss of the external harmonic mixer that you are using. The amplitude correction feature can be used for this. Step 1. Access the correction factor tables for editing: Press AMPLITUDE Y Scale, More, Corrections, Other.
Using External Millimeter Mixers (Option AYZ) Making Measurements with Agilent 11974 Series Preselected Harmonic Mixers Making Measurements with Agilent 11974 Series Preselected Harmonic Mixers Preselected mixers apply a tracking filter to the input signal before sending it to the mixer.
Using External Millimeter Mixers (Option AYZ) Making Measurements with Agilent 11974 Series Preselected Harmonic Mixers of the display. The conversion-loss versus frequency data is on the calibration label on the bottom of the Agilent 11974, or on the supplied calibration sheet. Use the procedure “Entering Conversion-Loss Correction Data for Harmonic Mixers” on page 85. Step 7. To complete the amplitude calibration process, the preselector must be adjusted at each frequency of interest.
Using External Millimeter Mixers (Option AYZ) Frequency Tracking Calibration with Agilent 11974 Series Preselected Harmonic Mixers Frequency Tracking Calibration with Agilent 11974 Series Preselected Harmonic Mixers This procedure is used to align the frequency of the preselector filter of the Agilent 11974 to the tuned frequency of the analyzer. This procedure should be followed any time that the Agilent 11974 is connected to a different analyzer. The calibration should be periodically checked. Step 1.
Using External Millimeter Mixers (Option AYZ) Frequency Tracking Calibration with Agilent 11974 Series Preselected Harmonic Mixers Table 10-1 Start Frequency Preselector Adjustment (Continued) Mixer Agilent P/N Analyzer Center Frequency Potentiometer 11974V 50.0 GHz “50.0 GHz Adjust” Step 8. Change the analyzer center frequency to the value indicated in Table 10-2 and again adjust the corresponding potentiometer on the rear panel of the Agilent 11974 until one or both of the green LEDs are lit.
Using External Millimeter Mixers (Option AYZ) Using External Millimeter Mixers (Option AYZ) Frequency Tracking Calibration with Agilent 11974 Series Preselected Harmonic Mixers 90 Chapter 10
Demodulating AM and FM Signals 11 Demodulating AM and FM Signals 91
Demodulating AM and FM Signals Measuring the Modulation Rate of an AM Signal Measuring the Modulation Rate of an AM Signal This section demonstrates how to determine parameters of an AM signal, such as modulation rate and modulation index (depth) by using frequency and time domain measurements (see the concepts chapter “AM and FM Demodulation Concepts” on page 157 for more information).
Demodulating AM and FM Signals Measuring the Modulation Rate of an AM Signal If the trigger level is set too high or too low when video trigger mode is activated, the sweep stops. You need to adjust the trigger level up or down with the front-panel knob until the sweep begins again. NOTE Step 8. Measure the AM rate using delta markers: Press Peak Search, Marker, Delta, Peak Search, Next Pk Right or Next Pk Left. Use markers and delta markers to measure the AM rate.
Demodulating AM and FM Signals Measuring the Modulation Index of an AM Signal Measuring the Modulation Index of an AM Signal This procedure demonstrates how to use the spectrum analyzer as a fixed-tuned (time-domain) receiver to measure the modulation index as a percent AM value of an AM signal. Using the ESA built-in AM demodulator, you can also tune-in and listen to an AM signal (“Demodulating an AM Signal Using the ESA Series” on page 96). Step 1.
Demodulating AM and FM Signals Measuring the Modulation Index of an AM Signal Figure 11-2 AM Signal Measured in the Time Domain LEFT: 100% AM Signal (Modulation Index = 1) RIGHT: 80% AM Signal (Modulation Index = 0.
Demodulating AM and FM Signals Demodulating an AM Signal Using the ESA Series Demodulating an AM Signal Using the ESA Series The demodulation functions listed in the menu under Det/Demod allow you to demodulate and hear signal information displayed on the analyzer. Simply place a marker on a signal of interest, set the analyzer in zero span, activate AM demodulation, turn the speaker on, and then listen. AM demodulation is not available on the PSA Series spectrum analyzers. NOTE Step 1.
Demodulating AM and FM Signals Demodulating an AM Signal Using the ESA Series multiple times, keeping the signal of interest in the center of the display until the span is 1 MHz: Press SPAN X Scale, Span, (↓), Mkr→CF. Step 7. Set the analyzer into time-domain with zero span: Press SPAN X Scale, Zero Span. Step 8. Change the resolution bandwidth to 100 kHz: Press BW/Avg, Res BW, 100, kHz. Step 9.
Demodulating AM and FM Signals Demodulating an FM Signal Using the ESA-E Series (Requires Option BAA) Demodulating an FM Signal Using the ESA-E Series (Requires Option BAA) This section demonstrates how to demodulate and listen to an FM signal using the ESA built-in FM demodulator with option BAA. Using the ESA’s built in FM demodulator you can tune to an FM signal and view the results of the detector output as displayed in the time domain.
Demodulating AM and FM Signals Demodulating an FM Signal Using the ESA-E Series (Requires Option BAA) Press BW/Avg, Res BW, 30, kHz. Step 7. Turn on the FM demodulator: Press Det/Demod, Demod, FM. Step 8. Change the vertical scaling: Press AMPLITUDE Y Scale, Scale/Div, 5, kHz. Figure 11-4 FM Demodulation (ESG FM Signal with 10 kHz Deviation) Step 9.
Demodulating AM and FM Signals Demodulating an FM Signal Using the ESA-E Series (Requires Option BAA) Figure 11-5 Calculating Frequency Deviation Step 10. Take a single sweep of the demodulated signal and then calculate the FM rate using delta markers on adjacent peaks. Change the marker readout value to inverse time for a frequency calculation of the FM rate: Press Marker, Off. Press View/Trace, Clear Write. Press Single, Peak Search, Marker, Delta, Peak Search, Next Pk Right (or Next Pk Left).
Using Segmented Sweep (ESA-E Series Spectrum Analyzers) 12 Using Segmented Sweep (ESA-E Series Spectrum Analyzers) 101
Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Measuring Harmonics Using Standard Sweep Measuring Harmonics Using Standard Sweep This procedure measures the fundamental 50 MHz signal plus the second and third harmonics. Compare the measurement times with this procedure, sweeping from 20 MHz to 170 MHz versus the next procedure “Measuring Harmonics Using Segmented Sweep” on page 104. Step 1.
Figure 12-1 Measuring Harmonics with Standard Sweep Chapter 12 103 Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Measuring Harmonics Using Standard Sweep
Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Measuring Harmonics Using Segmented Sweep Measuring Harmonics Using Segmented Sweep Segmented sweep allows you to define many bands of interest and display them as a single trace. Although the following examples only involve a maximum of 3 segments, you can set up the trace to display 32 segments simultaneously.
Press Center Freq, 150, MHz. Press Span, 100, kHz. Press Video BW, 30, Hz. Notice that the total sweep time for the 3 segments is only 8.13 seconds (plus a minimal time for transitions between segments). This is considerably shorter than the 193.3 seconds required to view the same signals without segmented sweep.
Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep With Limit Lines Using Segmented Sweep With Limit Lines Segmented sweep can also use other standard spectrum analyzer functionality, such as limit lines. In this procedure three segments are used. In the first segment, the limit lines are used to verify that the signal phase noise is acceptable.
Step 10. Enter points 2 through 11 from Table 12-1: Table 12-1 Limit Line Data Point Frequency Amplitude Connected 1 9.75 MHz − 80 dBm Yes 2 9.8 MHz − 75 dBm Yes 3 9.9 MHz − 70 dBm Yes 4 9.95 MHz 6 dBm Yes 5 10.05 MHz 6 dBm Yes 6 10.1 MHz − 70 dBm Yes 7 10.2 MHz − 75 dBm Yes 8 10.25 MHz − 80 dBm Yes 9 19.95 MHz − 30 dBm Yes 10 29.95 MHz − 15 dBm Yes 11 30.05 MHz − 15 dBm Yes Step 11. Turn the limits on: Press Return, Limit (On). Step 12.
Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep to Monitor the Cellular Activity of a cdmaOne Band Using Segmented Sweep to Monitor the Cellular Activity of a cdmaOne Band In this example set up two segments to monitor the forward and reverse links of a U.S. IS-95A cellular band. The third segment is used to zoom in on an area of interest.
Step 7. Locate the frequency of the cdmaOne signal with a marker: Press Marker, then rotate front-panel knob. Notice that in this example, there are two cdmaOne carriers located at 882.23 MHz, as shown in Figure 12-4. Step 8. Set the center frequency of segment 3 to 882.23 MHz: Press Sweep, Segmented, Modify, Edit, Segment, 3, Enter. Press Center Freq, 882.23, MHz. Step 9. Set the span to greater than twice the cdmaOne bandwidth (2 times 1.
Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep (ESA-E Series Spectrum Analyzers) Using Segmented Sweep to Monitor the Cellular Activity of a cdmaOne Band 110 Chapter 12
Stimulus Response Measurements (ESA Options 1DN and 1DQ) 13 Stimulus Response Measurements (ESA Options 1DN and 1DQ) 111
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Making a Stimulus Response Transmission Measurement Stimulus Response Measurements (ESA Options 1DN and 1DQ) Making a Stimulus Response Transmission Measurement The procedure below describes how to use a built-in tracking generator to measure the rejection of a band pass filter, a type of transmission measurement.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Making a Stimulus Response Transmission Measurement Step 5. Put the sweep time into stimulus response auto coupled mode: Press Sweep, Swp Coupling (SR). Step 6. Increase measurement sensitivity and smooth the noise: Press BW/Avg, Res BW, 30, kHz. Press BW/Avg, Video BW, 300, Hz. A decrease in displayed amplitude is caused by tracking error. Press Source, Tracking Peak.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Calculating the N dB Bandwidth Using Stimulus Response Calculating the N dB Bandwidth Using Stimulus Response Stimulus Response Measurements (ESA Options 1DN and 1DQ) This procedure uses the tracking generator for transmission stimulus response measurements to calculate the 3 dB bandwidth of a 200 MHz bandpass filter. See the concepts section “Measuring Device Bandwidth” on page 160 for more information on this measurement. Step 1.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Calculating the N dB Bandwidth Using Stimulus Response Step 5. Put the sweep time of the analyzer into stimulus response auto coupled mode: Press Sweep, Swp Coupling (SR). Auto coupled sweep times are usually much faster for stimulus response measurements than they are for spectrum analyzer (SA) measurements. If necessary, adjust the reference level to place the signal on screen. Stimulus Response Measurements (ESA Options 1DN and 1DQ) Step 6.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Measuring Stop Band Attenuation Using Log Sweep (ESA-E Series) Measuring Stop Band Attenuation Using Log Sweep (ESA-E Series) Stimulus Response Measurements (ESA Options 1DN and 1DQ) When measuring filter characteristics, it is useful to look at the stimulus response over a wide frequency range. Setting the analyzer x-axis (frequency) to display logarithmically provides this function.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Measuring Stop Band Attenuation Using Log Sweep (ESA-E Series) Step 7. Put the sweep time into stimulus response auto coupled mode: Press Sweep, Swp Coupling (SR). Adjust the reference level if necessary to place the signal on screen. Step 8. Connect the cable (but not the DUT) from the tracking generator output to the analyzer input.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Making a Reflection Calibration Measurement Making a Reflection Calibration Measurement Stimulus Response Measurements (ESA Options 1DN and 1DQ) The following procedure makes a reflection measurement using a coupler or directional bridge to measure the return loss of a filter. This example uses a 200 MHz bandpass filter as the DUT.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Making a Reflection Calibration Measurement Step 5. Turn on the tracking generator and set the output power to –10 dBm: Press Source, Amplitude (On), –10, dBm. Excessive signal input may damage the DUT. Do not exceed the maximum power that the device under test can tolerate. CAUTION Step 6. Set the center frequency, span and resolution bandwidth: Step 7. Replace the DUT with a short circuit. Step 8.
Stimulus Response Measurements (ESA Options 1DN and 1DQ) Measuring Return Loss using the Reflection Calibration Routine Stimulus Response Measurements (ESA Options 1DN and 1DQ) Measuring Return Loss using the Reflection Calibration Routine This procedure uses the reflection calibration routine in the proceeding procedure “Making a Reflection Calibration Measurement” on page 118 to calculate the return loss of the 200 MHz bandpass filter.
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) 14 Demodulating and Viewing Television Signals (ESA-E Series Option B7B) 121
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Demodulating and Viewing Television Signals Demodulating and Viewing Television Signals ESA-E Series with option B7B (TV trigger and picture on screen) allows you to trigger the sweep of the analyzer on a specific television line of a demodulated TV waveform. Option B7B also allows you to view the television picture represented by the TV waveform on the color LCD display of the analyzer.
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Demodulating and Viewing Television Signals When viewing the spectrum, for analog TV channels, there should be a strong, “noise-like” video carrier at the center frequency, a weaker, “noise-like” chrominance sub-carrier located 3.58 MHz (NTSC standard) or 4.3 to 4.4 MHz (PAL or SECAM standards) above the video carrier, and a tightly-grouped sound carrier located 4.5 to 6.5 MHz above the video carrier.
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Demodulating and Viewing Television Signals A time domain display of the demodulated TV waveform will now be visible. The signals used for Figure 14-1 were produced by a Phillips PM 5518-TX Color TV Pattern Generator.
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Demodulating and Viewing Television Signals Figure 14-2 TV Picture Display NOTE When using the knob to vary the value of the active function, be aware that the instrument settings will not be updated until you stop turning the knob. Make small movements of the knob with frequent pauses.
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Measuring Depth of Modulation Measuring Depth of Modulation The depth of modulation provides a measure of the percentage of amplitude modulation (AM) on the visual carrier. With Option B7B, the analyzer can be used to measure the horizontal synchronization pulse level and vertical interval test signal (VITS) white level on an individual TV line from which a calculation of percent AM can be made.
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Measuring Depth of Modulation Step 6. Enable a delta marker and using the front-panel knob move the delta marker within the white level (NTSC or PAL waveforms) or the sync tip (SECAM waveforms) at the bottom of the waveform: Press Marker, Delta, then rotate front-panel knob (or press Peak Search, Min Search).
Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Demodulating and Viewing Television Signals (ESA-E Series Option B7B) Measuring Depth of Modulation 128 Chapter 14
15 Concepts Concepts 129
Concepts Resolving Closely Spaced Signals Resolving Closely Spaced Signals Resolving Signals of Equal Amplitude Two equal-amplitude input signals that are close in frequency can appear as a single signal trace on the analyzer display. Responding to a single-frequency signal, a swept-tuned analyzer traces out the shape of the selected internal IF (intermediate frequency) filter (typically referred to as the resolution bandwidth or RBW filter).
Concepts Resolving Closely Spaced Signals For best sweep times and keeping the analyzer calibrated set the sweep time (Sweep, Sweep Time) to Auto, and the auto sweep time (Sweep, Auto Sweep Time) to Norm. Use the widest resolution bandwidth that still permits resolution of all desired signals. NOTE For ESA-E Series Spectrum Analyzers: Option 1DR adds narrower resolution bandwidths, from 10 Hz to 300 Hz, in a 1-3-10 sequence and 200 Hz CISPR bandwidth.
Concepts Harmonic Distortion Calculations Harmonic Distortion Calculations The analyzer provides a one-button automated measurement for harmonic measurements (from the second to the tenth harmonic) and provides a calculation of the total harmonic distortion for continuous wave signals or complex digitally modulated carriers. When the harmonic distortion measurement is activated, the analyzer searches for the fundamental and determines the frequencies of the harmonics.
Concepts Time Gating Concepts Time Gating Concepts Introduction: Using Time Gating on a Simplified Digital Radio Signal This section shows you the concepts of using time gating on a simplified digital radio signal. “Making Time-Gated Measurements” on page 57 demonstrates time gating examples using the ESA and PSA. Figure 15-2 shows a signal with two radios, radio 1 and radio 2, that are time-sharing a single frequency channel. Radio 1 transmits for 1 ms then radio 2 transmits for 1 ms.
Concepts Time Gating Concepts Figure 15-3 Frequency Spectra of the Combined Radio Signals Concepts Time gating allows you to see the separate spectrum of radio 1 or radio 2 to determine the source of the spurious signal, as shown in Figure 15-4. Figure 15-4 Time-Gated Spectrum of Radio 1 Figure 15-5 Time-Gated Spectrum of Radio 2 Time gating lets you define a time window (or time gate) of when a measurement is performed.
Concepts Time Gating Concepts How Time Gating Works Time gating is achieved by the spectrum analyzer selectively interrupting the path of the detected signal, with a gate, as shown in Figure 15-7 and Figure 15-8. The gate determines the times at which it captures measurement data (when the gate is turned “on,” under the Gate menu, the signal is being passed, otherwise when the gate is “off,” the signal is being blocked).
Concepts Time Gating Concepts Gated LO Concepts (PSA Spectrum Analyzers) Gated LO is a very sophisticated type of time gating that sweeps the LO only while the gate is “on” and the gate is passing a signal. See Figure 15-7 for a simplified block diagram of gated LO operation. Notice that the gate control signal controls when the scan generator is sweeping and when the gate passes or blocks a signal. This allows the analyzer to sweep only during the periods when the gate passes a signal.
Concepts Time Gating Concepts With video gating the analyzer is continually sweeping, independent of the position and length of the gate. The analyzer must be swept at a minimum sweep time (see the sweep time calculations later in this chapter) to capture the signal when the gate is passing a signal. Because of this, video gating is typically slower than gated LO and gated FFT.
Concepts Time Gating Concepts Figure 15-9 Gated FFT Timing Diagram Time Gating Basics (Gated LO and Gated Video) The gate passes or blocks a signal with the following conditions: • Trigger condition - Usually an external transistor-transistor logic (TTL) periodic signal for edge triggering and a high/low TTL signal for level triggering. • Gate delay - The time after the trigger condition is met when the gate will pass a signal (for edge triggering).
Concepts Time Gating Concepts • The gate trigger signal (a periodic TTL level signal). • The gate signal. This TTL signal is low when the gate is "off" (blocking) and high when the gate is "on" (passing). The timing interactions between the three signals are best understood if you observe them in the time domain (see Figure 15-10). The main goal is to measure the spectrum of signal 1 and determine if it has any low-level modulation or spurious signals.
Concepts Time Gating Concepts Figure 15-11 Signal within pulse #1 (time-domain view) Figure 15-12 Using Time Gating to View Signal 1 (spectrum view) Moving the gate so that it is positioned over the middle of signal 2 produces a result as shown in Figure 15-14. Here, you see only the spectrum within the pulses of signal 2; signal 1 is excluded.
Concepts Time Gating Concepts Measuring a Complex/Unknown Signal NOTE The steps below help to determine the spectrum analyzer settings when using time gating. The steps apply to the time gating approaches using gated LO on the PSA and gated video on the ESA. This example shows you how to use time gating to measure a very specific signal. Most signals requiring time gating are fairly complex and in some cases extra steps may be required to perform a measurement. Step 1.
Concepts Time Gating Concepts Figure 15-15 Time-domain Parameters In Figure 15-15, the parameters are: • Pulse repetition interval (PRI) is 5 ms. • Pulse width (τ) is 3 ms. • Signal delay (SD) is 1 ms for positive edge trigger (0.8 ms for negative edge trigger). • Gate delay (D) is 2.5 ms. • Setup time (SUT) is 1.5 ms. Step 2. Set the spectrum analyzer sweep time: PSA: Sweep time does not affect the results of gated LO unless the sweep time is set too fast.
Concepts Time Gating Concepts View/Trace (ESA) or Trace/View (PSA) menu) to determine the frequency of peak energy. To optimize measurement speed, set the span narrow enough so that the display will still show the signal characteristics you want to measure. For example, if you wanted to look for spurious signals within a 200 kHz frequency range, you might set the frequency span to just over 200 kHz. Step 4. Determine the setup time and signal delay to set up the gate signal.
Concepts Time Gating Concepts Figure 15-17 Best Position for Gate As a general rule, you will obtain the best measurement results if you position the gate relatively late within the signal of interest, but without extending the gate over the trailing pulse edge or signal transition. Doing so maximizes setup time and provides the resolution bandwidth filters of the spectrum analyzer the most time to settle before a gated measurement is made.
Concepts Time Gating Concepts Step 5. The resolution bandwidth will need to be adjusted for gated LO and gated video. The video bandwidth will only need to be adjusted for gated video. Resolution Bandwidth: The resolution bandwidth you can choose is determined by the gate position, so you can trade off longer setup times for narrower resolution bandwidths. This trade-off is due to the time required for the resolution-bandwidth filters to fully charge before the gate comes on.
Concepts Time Gating Concepts Reducing the video-bandwidth filter too fast causes the signal to appear to drop in amplitude on the screen. If you are in doubt about the proper video bandwidth to choose, set it to its maximum and reduce it gradually until the detected signal level drops slightly. Then reset it to the value it was at just before the signal dropped. Leave both RBW and VBW in the manual mode, not Auto. This is important so that they will not change if the span is changed.
Concepts Time Gating Concepts "Quick Rules" for Making Time-Gated Measurements This section summarizes the rules described in the previous sections.
Concepts Time Gating Concepts Figure 15-20 Gate Positioning Parameters Most control settings are determined by two key parameters of the signal under test: the pulse repetition interval (PRI) and the pulse width (τ). If you know these parameters, you can begin by picking some standard settings. Table 15-2 and Table 15-3 summarize the parameters for a signal whose trigger event occurs at the same time as the beginning of the pulse (in other words, SD is 0).
Concepts Time Gating Concepts NOTE Table 15-3 below applies only to ESA spectrum analyzers. PSA gated LO time gating is not affected by analyzer sweep times (unless the sweep time is set too fast, Meas Uncal appears on the screen and the sweep time will need to be increased).
Concepts Time Gating Concepts Table 15-4 If You Have a Problem with the Time-Gated Measurement Symptom Possible Causes Suggested Solution Erratic analyzer trace with dropouts that are not removed by increasing analyzer sweep time; oscilloscope view of gate output signal jumps erratically in time domain. Gate Delay may be greater than trigger repetition interval. Reduce Gate Delay until it is less than trigger interval. Gate does not trigger. 1) Gate trigger voltage may be too low.
Concepts Time Gating Concepts Using the Edge Mode or Level Mode for Triggering NOTE PSA spectrum analyzers use edge mode triggering. ESA spectrum analyzers can use edge or level triggering modes. Depending on the trigger signal that you are working with, you can trigger the gate in one of two separate modes: edge or level.
Concepts Time Gating Concepts Noise Measurements Using Time Gating Time gating can be used to measure many types of signals. However, they must be repetitive and for ESA, have a TTL timing trigger signal available to synchronize the gate. Noise is not a repetitive signal, so if you need to use gating when measuring noise, you should understand the impact on the measurement results.
Concepts Trigger Concepts Trigger Concepts Selecting a Trigger NOTE If you are using an ESA with firmware revision A.07.xx or lower, you can use video and external triggering as set up below in numbers 1 and 2. If you have firmware A.08.xx or later and Option B7E with board part number E4401-60224 or higher, RF burst triggering is also available (recommended for this example). PSA can use video, external and RF burst triggering.
Concepts Trigger Concepts TV Trigger TV Trigger Setup Menu Functions • TV Source When TV Source is set to SA, the analyzer demodulates the TV signal, by using the analyzer as a fixed tuned receiver. This allows stable, zero span sweeps of the baseband video waveform (band limited by the RBW and VBW filters). When TV Source is set to EXT VIDEO IN, an external baseband video signal may be used to produce the TV line trigger.
Concepts Trigger Concepts Table 15-5 TV Standard Number of Lines per Frame Approximate Field Rate Color Encoding Method Color Subcarrier Frequency SECAM 625 50 Hz SECAM 4.406 MHz, 4.250 MHz • Field A television image or frame is composed of 525 (or 625 lines) delivered in two successive fields of 262.5 (or 312.5 lines) interlaced together on a CRT when displayed.
Concepts Trigger Concepts Trigger Settings and Fast Time Domain Sweeps Trigger delay can be used to move the sweep trigger point arbitrarily across a given TV line or lines to allow closer examination of waveform patterns (Press Trig, Trig Delay, and enter a delay time). Concepts In fast sweeps (20 µs to less than 5 ms), there may be up to one trace point of variation in the start time of the waveform digitalization process with respect to the actual TV trigger pulse.
Concepts AM and FM Demodulation Concepts AM and FM Demodulation Concepts Demodulating an AM Signal Using the Analyzer as a Fixed Tuned Receiver (Time-Domain) The zero span mode can be used to recover amplitude modulation on a carrier signal. The following functions establish a clear display of the waveform: • Triggering stabilizes the waveform trace by triggering on the modulation envelope. If the modulation of the signal is stable, video trigger synchronizes the sweep with the demodulated waveform.
Concepts Stimulus Response Measurement Concepts Stimulus Response Measurement Concepts NOTE Stimulus response measurements require option 1DN or 1DQ with ESA spectrum analyzers. Stimulus Response Overview Stimulus response measurements require a source to stimulate a device under test (DUT), a receiver to analyze the frequency response characteristics of the DUT, and, for return loss measurements, a directional coupler or bridge.
Concepts Stimulus Response Measurement Concepts • Source attenuation may be set incorrectly (select Attenuation (Auto) for optimum setting). • The source power may be set too high or too low, use Amplitude (Off) then Amplitude (On) to reset it. • The source power sweep may be set too high, resulting in an unleveled condition at the end of the sweep. Use Power Sweep (Off) then Power Sweep (On) to decrease the amplitude.
Concepts Stimulus Response Measurement Concepts Reconnect the DUT to the analyzer. Note that the units of the reference level have changed to dB, indicating that this is now a relative measurement. Change the normalized reference position: Press View/Trace, More, Normalize, Norm Ref Posn.
Concepts Stimulus Response Measurement Concepts Table 15-6 Power to VSWR Conversion Return Loss (dB) VSWR Return Loss (dB) VSWR Return Loss (dB) VSWR Return Loss (dB) VSWR Return Loss (dB) VSWR 8.0 2.32 14.4 1.47 19.0 1.25 29.0 1.07 39.0 1.02 10.0 1.92 14.6 1.46 19.5 1.24 29.5 1.07 39.5 1.02 10.5 1.85 14.8 1.44 20.0 1.22 30.0 1.07 40.0 1.02 11.0 1.78 15.0 1.43 20.5 1.21 30.5 1.06 40.5 1.02 11.2 1.76 15.2 1.42 21.0 1.20 31.0 1.06 41.0 1.02 11.
Concepts Concepts Stimulus Response Measurement Concepts 162 Chapter 15
ESA/PSA Programming Examples 16 ESA/PSA Programming Examples 163
ESA/PSA Programming Examples ESA/PSA Programming Examples Examples Included in this Chapter: Examples Included in this Chapter: The following C and Visual Basic examples work with both the ESA Series and the PSA Series of spectrum analyzers. There is also a section on programming in C using the Agilent VTL (VISA transition library).
Finding Additional Examples and More Information These examples are available on the Agilent Technologies PSA Series documentation CD-ROM or the ESA Series documentation CD-ROM. They can also be found from the URLs: http://www.agilent.com/find/esa http://www.agilent.com/find/psa VXI plug&play drivers: There are additional examples that use the VXI plug&play instrument drivers. These examples are included in the on-line documentation in the driver itself.
ESA/PSA Programming Examples ESA/PSA Programming Examples Programming Examples Information and Requirements Programming Examples Information and Requirements • The programming examples were written for use on an IBM compatible PC. • The programming examples use C, Visual Basic and VEE programming languages. • The programming examples use GPIB and LAN interfaces. • Many of the examples use the SCPI programming commands, though there are some that use the plug&play or IVI.com drivers.
Programming in C Using the VTL The C programming examples that are provided are written using the C programming language and the Agilent VTL (VISA transition library). This section includes some basic information about programming in the C language. Note that some of this information may not be relevant to your particular application. (For example, if you are not using VXI instruments, the VXI references will not be relevant). Refer to your C programming language documentation for more details.
ESA/PSA Programming Examples ESA/PSA Programming Examples Programming in C Using the VTL Typical Example Program Contents The following is a summary of the VTL function calls used in the example programs. visa.h This file is included at the beginning of the file to provide the function prototypes and constants defined by VTL. ViSession The ViSession is a VTL data type. Each object that will establish a communication channel must be defined as ViSession.
Linking to VTL Libraries Your application must link to one of the VTL import libraries: 32-bit Version: C:\VXIPNP\WIN95\LIB\MSC\VISA32.LIB for Microsoft compilers C:\VXIPNP\WIN95\LIB\BC\VISA32.LIB for Borland compilers 16-bit Version: C:\VXIPNP\WIN\LIB\MSC\VISA.LIB for Microsoft compilers C:\VXIPNP\WIN\LIB\BC\VISA.LIB for Borland compilers See the following section, “Compiling and Linking a VTL Program” for information on how to use the VTL run-time libraries.
ESA/PSA Programming Examples ESA/PSA Programming Examples Programming in C Using the VTL 6. Click on the Add button and type in the following: C:\VXIPNP\WIN95\LIB\MSC For Borland C++ version 4.0 compilers: • You may wish to add the include file and library file search paths. They are set under the Options | Project menu selection.
Example Program This example program queries a GPIB device for an identification string and prints the results. Note that you must change the address. /*idn.c - program filename */ #include "visa.h" #include
ESA/PSA Programming Examples ESA/PSA Programming Examples Programming in C Using the VTL Opening a Session A session is a channel of communication. Sessions must first be opened on the default resource manager, and then for each device you will be using. The following is a summary of sessions that can be opened: • A resource manager session is used to initialize the VISA system. It is a parent session that knows about all the opened sessions.
The session returned from viOpenDefaultRM must be used in the sesn parameter of the viOpen function. The viOpen function then uses that session and the device address specified in the rsrcName parameter to open a device session. The vi parameter in viOpen returns a session identifier that can be used with other VTL functions. Your program may have several sessions open at the same time by creating multiple session identifiers by calling the viOpen function multiple times.
ESA/PSA Programming Examples ESA/PSA Programming Examples Programming in C Using the VTL Addressing a Session As seen in the previous section, the rsrcName parameter in the viOpen function is used to identify a specific device. This parameter is made up of the VTL interface name and the device address. The interface name is determined when you run the VTL Configuration Utility. This name is usually the interface type followed by a number.
The following is an example of opening a device session with the GPIB device at primary address23. ViSession defaultRM, vi; . . viOpenDefaultRM (&defaultRM); viOpen (defaultRM, "GPIB0::23::INSTR", VI_NULL,VI_NULL,&vi); . . viClose(vi); viClose (defaultRM); Closing a Session The viClose function must be used to close each session. You can close the specific device session, which will free all data structures that had been allocated for the session.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using C to Make a Power Suite ACPR Measurement on a cdmaOne Signal Using C to Make a Power Suite ACPR Measurement on a cdmaOne Signal This C programming example (ACPR.c) can be found on the Documentation CD. Example: /*************************************************************************** * ACPR.
int iSwpPnts = 401; double freq,value; static ViChar *cToken ; long lCount=0L; char sTraceInfo [1024]= {0}; FILE *fDataFile; unsigned long lBytesRetrieved; char *psaSetup = "*RST;*CLS;" // PSA setup initialization // Reset the device and clear status ":INIT:CONT 0;"// Set analyzer to single sweep mode ":RADIO:STANDARD IS95";// Set the Radio Standard to IS95 /*open session to GPIB device at address 18 */ viStatus=viOpenDefaultRM (&defaultRM); viStatus=viOpen (defaultRM, "GPIB0::18::INSTR", VI_NULL,VI_NU
ESA/PSA Programming Examples ESA/PSA Programming Examples Using C to Make a Power Suite ACPR Measurement on a cdmaOne Signal viQueryf(viPSA,"%s\n", "%#t","READ:ACP?;*wai" , &iNum , cResult); /*Remove the "," from the ASCII data for analyzing data*/ cToken = strtok(cResult,","); /*Save data to an ASCII to a file, by removing the "," token*/ fDataFile=fopen("C:\\ACPR.txt","w"); fprintf(fDataFile,"ACPR.
Using C to Serial Poll the Analyzer to Determine when an Auto-alignment is Complete This C programming example (SerAlign.c) can be found on the Documentation CD. Example: /********************************************************************* * SerAlign.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using C to Serial Poll the Analyzer to Determine when an Auto-alignment is Complete long lResult = 0; long lOpc = 0; char cEnter = 0; /*open session to GPIB device at address 18 */ viStatus=viOpenDefaultRM (&defaultRM); viStatus=viOpen (defaultRM, "GPIB0::18::INSTR", VI_NULL,VI_NULL,&viPSA); /*check opening session sucess*/ if(viStatus) { printf("Could not open a session to GPIB device at address 18!\n"); exit(0); } /*increase timeout to 60 sec*/
printf("Performing self-alignment.\n"); /* Serial pole the instrument for operation complete */ while(1) { viQueryf(viPSA,"*ESR?\n","%ld",&esr); printf(".
ESA/PSA Programming Examples ESA/PSA Programming Examples Using C and Service Request (SRQ) to Determine When a Measurement is Complete Using C and Service Request (SRQ) to Determine When a Measurement is Complete This C programming example (SRQ.c) can be found on the Documentation CD. /************************************************************************* * SRQ.
***************************************************************************/ #include #include #include "visa.h" ViSessiondefaultRM, viSA; ViStatuserrStatus; ViAddr iAddress; int iSrqOccurred=0; char cBuf[3]={0}; /*Wait until SRQ is generated and for the handler to be called. Print something while waiting.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using C and Service Request (SRQ) to Determine When a Measurement is Complete /* Make sure it is an SRQ event, ignore if stray event*/ if (eventType!=VI_EVENT_SERVICE_REQ) { printf ("\n Stray event type0x%1x\n",eventType); /*Return successfully*/ return VI_SUCCESS; } /* When an interrupt occurs,determine which device generated the interrupt (if an instrument other than the PSA/ESA generates the interrupt, simply report "Instrument at GPIB Address
/*Program Variables*/ ViStatus viStatus long = 0; lOpc=0; /* Open a GPIB session at address 18*/ viStatus=viOpenDefaultRM(&defaultRM); viStatus=viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viSA); if(viStatus) { printf("Could not open a session to GPIB device at address 18!\n"); exit(0); } /* Set I/O timeout to twenty seconds */ viSetAttribute(viSA,VI_ATTR_TMO_VALUE,20000); /*Clear the instrument*/ viClear(viSA); /*Reset the instrument*/ viPrintf(viSA,"*RST\n"); /*Clear the status byte of the instrum
ESA/PSA Programming Examples ESA/PSA Programming Examples Using C and Service Request (SRQ) to Determine When a Measurement is Complete /*Initiate a sweep*/ viPrintf(viSA,"INIT:IMM\n"); /*Make sure the previous command has been completed*/ viQueryf(viSA, "*OPC?\n", "%d", &lOpc); if (!lOpc) { printf("\nProgram Abort! error ocurred: last command was not completed!\n"); exit(0); } /* Set the service request mask to assert SRQ when either a measurement is completed or an error message has occurred.
done.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using Visual Basic® 6 to Capture a Screen Image Using Visual Basic® 6 to Capture a Screen Image This is a Visual Basic example that stores the current screen image on your PC. The program works with the ESA or PSA Series spectrum analyzers. The bas file (screen.bas) and a compiled executable (screen.exe) can be found on the Documentation CD. This example: 1. Stores the current screen image on the instrument’s flash as C:PICTURE.GIF. 2.
’’ declarations needed to make VISA calls from Visual Basic. ’’ To add this module to your project in VB 6, from the menu, select ’’ Project->Add Module, select the ’Existing’ tab, and browse to the ’’ directory containing the VB Declaration file, select visa32.bas, and ’’ press ’Open’. ’’ ’’ The name and location of the VB declaration file depends on which ’’ operating system you are using.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using Visual Basic® 6 to Capture a Screen Image Dim headerlength As Long ’length of header ’Set the default number of bytes that will be contained in the ’ResultsArray to 50,000 (50kB) length = 50000 ’Set the array of pointers to the addresses of the variables ArrayPtr(0) = VarPtr(length) ArrayPtr(1) = VarPtr(ResultsArray(0)) ’Delete picture.gif file if it exists On Error Resume Next Kill "picture.
’Delete the tempory file on the flash named C:PICTURE.GIF status = viVPrintf(vi, ":MMEM:DEL ’C:PICTURE.GIF’" + Chr$(10), 0) If (status < 0) Then GoTo VisaErrorHandler ’Close the vi session and the resource manager session Call viClose(vi) Call viClose(defrm) ’Store the results in a text file fnum = FreeFile() ’Get the next free file number Open "picture.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using Visual Basic® 6 to Transfer Binary Trace Data Using Visual Basic® 6 to Transfer Binary Trace Data This is a Visual Basic example that gets binary trace data from the instrument. Binary data transfers are faster than the default ASCII transfer mode, because less data is sent over the bus. This example works with the ESA or PSA Series spectrum analyzers. The bas file (bintrace.bas) and a compiled executable (bintrace.
’’ declarations needed to make VISA calls from Visual Basic. ’’ To add this module to your project in VB 6, from the menu, select ’’ Project->Add Module, select the ’Existing’ tab, and browse to the ’’ directory containing the VB Declaration file, select visa32.bas, and ’’ press ’Open’. ’’ ’’ The name and location of the VB declaration file depends on which ’’ operating system you are using.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using Visual Basic® 6 to Transfer Binary Trace Data Dim ResultsArray(8192) As Single ’trace element array of Real,32 values ’For Real,64 data use Double.
’Print the IDN string results in a message box MsgBox (strRes) ’Change the instrument mode to Spectrum Analysis status = viVPrintf(vi, ":INST:NSEL 1" + Chr$(10), 0) If (status < 0) Then GoTo VisaErrorHandler ’ Set instrument trace data format to 32-bit Real ’ Note: For higher precision use 64-bit data, ":FORM REAL,64" ’ For faster data transfer for ESA, use ":FORM INT,32" status = viVPrintf(vi, ":FORM REAL,32" + Chr$(10), 0) If (status < 0) Then GoTo VisaErrorHandler ’Set Analyzer to single sweep mode st
ESA/PSA Programming Examples ESA/PSA Programming Examples Using Visual Basic® 6 to Transfer Binary Trace Data output = output & ResultsArray(x) & vbCrLf Next x ’Print Results to the Screen MsgBox (output) ’Store the results in a text file fnum = FreeFile() ’Get the next free file number Open "bintrace.
Using Agilent VEE to Transfer Trace Data This VEE programming example transfers trace data from a PSA or ESA series spectrum analyzer. The program supports data transfer types to integer 32, real 32, real 64 and ASCII data. VEE Window Capture of “tracetransfer.
ESA/PSA Programming Examples ESA/PSA Programming Examples Using Agilent VEE to Transfer Trace Data 198 Chapter 16
ESA Programming Examples 17 ESA Programming Examples 199
ESA Programming Examples Examples Included in this Chapter: Examples Included in this Chapter: ESA Programming Examples This chapter includes C programming examples of how to program the ESA series using SCPI commands. Twelve examples are written for ESA analyzers with GPIB interface (Option A4H). Three examples are written for ESA analyzers with an RS-232 interface (Option 1AX). These examples do not apply to analyzers that have Option 290 (8590 Series Programming Code Compatibility).
ESA Programming Examples Programming Examples System Requirements Programming Examples System Requirements The ESA Series examples were written for use on an IBM compatible PC configured as follows: Pentium processor • Windows 95/98/2000/XP or Windows NT 4.
ESA Programming Examples Using C with Marker Peak Search and Peak Excursion Measurement Routines Using C with Marker Peak Search and Peak Excursion Measurement Routines This C programming example (mkpksrch.c) can be found on the Documentation CD. ESA Programming Examples /************************************************************/ /* Using Marker Peak Search and Peak Excursion */ /* */ /* This example is for the E44xxB ESA Spectrum Analyzers */ /* and E740xA EMC Analyzers.
ESA Programming Examples Using C with Marker Peak Search and Peak Excursion Measurement Routines #include #include #include #include #include #include #include "visa.
ESA Programming Examples Using C with Marker Peak Search and Peak Excursion Measurement Routines { ESA Programming Examples /*Program Variables*/ ViStatus viStatus = 0; double dMarkerFreq = 0; double dMarkerAmpl = 0; float fPeakExcursion =0; long lOpc = 0L; /*Open a GPIB session at address 18.
ESA Programming Examples Using C with Marker Peak Search and Peak Excursion Measurement Routines /*Set the peak thresold */ viPrintf(viESA,"CALC:MARK:PEAK:THR -90 \n"); /*Trigger a sweep and wait for completion*/ viPrintf(viESA,"INIT:IMM;*WAI\n"); /*Set the marker to the maximum peak*/ viPrintf(viESA,"CALC:MARK:MAX \n"); ESA Programming Examples /*Query and read the marker frequency*/ viQueryf(viESA,"CALC:MARK:X? \n","%lf",&dMarkerFreq); printf("\n\t RESULT: Marker Frequency is: %lf MHZ \n\n",dMarkerFreq/
ESA Programming Examples Using C for Marker Delta Mode and Marker Minimum Search Functions Using C for Marker Delta Mode and Marker Minimum Search Functions This C programming example (mkrdelta.c) can be found on the Documentation CD. ESA Programming Examples /************************************************************/ /* Using Marker Delta Mode and Marker Minimum Search */ /* */ /* This example is for the E44xxB ESA Spectrum Analyzers */ /* and E740xA EMC Analyzers.
ESA Programming Examples Using C for Marker Delta Mode and Marker Minimum Search Functions #include #include #include #include #include #include "visa.
ESA Programming Examples Using C for Marker Delta Mode and Marker Minimum Search Functions ESA Programming Examples ViStatus viStatus = 0; double dStartFreq =0.0; double dStopFreq =0.0; double dMarkerAmplitude = 0.
ESA Programming Examples Using C for Marker Delta Mode and Marker Minimum Search Functions viPrintf(viESA,"INIT:IMM;*WAI\n"); /*Set the marker to the maximum peak*/ viPrintf(viESA,"CALC:MARK:MAX\n"); /*Set the analyzer to activate delta marker mode*/ viPrintf(viESA,"CALC:MARK:MODE DELT\n"); /*Trigger a sweep, wait for completion*/ viPrintf(viESA,"INIT:IMM;*WAI\n"); ESA Programming Examples /*Set the marker to minimum amplitude*/ viPrintf(viESA,"CALC:MARK:MIN\n"); /*Query and read the marker amplitude*/ vi
ESA Programming Examples Using C to Perform Internal Self-Alignment Using C to Perform Internal Self-Alignment This C programming example (intalign.c) can be found on the Documentation CD. ESA Programming Examples /************************************************************/ /* Performing Internal Self-alignment */ /* */ /* This example is for the E44xxB ESA Spectrum Analyzers */ /* and E740xA EMC Analyzers. */ /* */ /* This example shows two ways of executing an internal */ /* self-alignment.
ESA Programming Examples Using C to Perform Internal Self-Alignment #define hpESA_IDN_E4401B "Hewlett-Packard, E4401B" #define hpESA_IDN_E4411B "Hewlett-Packard, E4411B" #definehpEMC_IDN_E7401A "Hewlett-Packard, E7401A" ViSession defaultRM, viESA; ViStatus errStatus; ViChar cIdBuff[256]= {0}; char cEnter = 0; int iResult = 0; viQueryf(viESA, "*IDN?\n", "%t", &cIdBuff); iResult = (strncmp( cIdBuff, hpESA_IDN_E4401B, strlen(hpESA_IDN_E4401B)) && strncmp( cIdBuff, hpESA_IDN_E4411B, strlen(hpESA_IDN_E4411B))
ESA Programming Examples Using C to Perform Internal Self-Alignment ESA Programming Examples viStatus=viOpenDefaultRM(&defaultRM); viStatus=viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viESA); if(viStatus) { printf("Could not open a session to GPIB device at address 18!\n"); exit(0); } /*Clear the instrument*/ viClear(viESA); /*Reset the instrument*/ viPrintf(viESA,"*RST\n"); /*Display the program heading */ printf("\n\t\t Internal Self-Alignment Program \n\n" ); /*Check for the instrument model number a
ESA Programming Examples Using C to Perform Internal Self-Alignment viQueryf(viESA, "*OPC?\n", "%d", &lOpc); if (!lOpc) { printf("Program Abort! error ocurred: last command was not completed!\n"); exit(0); } /*Close the session*/ viClose(viESA); viClose(defaultRM); } ESA Programming Examples Chapter 17 213
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over GPIB) Using C to Read Trace Data in an ASCII Format (over GPIB) This C programming example (ascigpib.c) can be found on the Documentation CD.
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over GPIB) /* - Remove the "," from the ACSII data */ /* - Save the trace data to an ASCII file */ /* - Close the session */ /************************************************************/ "visa.
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over GPIB) } ESA Programming Examples } void main() { /*Program Variable*/ ViStatus viStatus = 0; /*Dimension cResult to 13 bytes per sweep point, 8192 sweep points maximum*/ ViChar _VI_FAR cResult[106496] = {0}; FILE *fTraceFile; static ViChar *cToken ; int iNum =0; int iSwpPnts = 401; long lCount=0L; long lOpc=0; /*iNum set to 13 times number of sweep points, 8192 sweep points maximum*/ iNum =106496; lCount =0; /* Open a GPIB sessio
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over GPIB) viPrintf(viESA,"SENS:FREQ:CENT 50 MHz\n"); /*Set the analyzer to 50MHz Span*/ viPrintf(viESA,"SENS:FREQ:SPAN 50 MHz\n"); /*Set the analyzer to single sweep mode */ viPrintf(viESA,"INIT:CONT 0 \n"); /*Trigger a sweep and wait for sweep to complete */ viPrintf(viESA,"INIT:IMM;*WAI\n"); ESA Programming Examples /* Specify units in dBm*/ viPrintf(viESA,"UNIT:POW DBM \n"); /*Set analyzer trace data format to ASCII Format*/ viPri
ESA Programming Examples Using C to Read Trace Data in a 32-Bit Real Format (over GPIB) Using C to Read Trace Data in a 32-Bit Real Format (over GPIB) This C programming example (32btgpib.c) can be found on the Documentation CD.
ESA Programming Examples Using C to Read Trace Data in a 32-Bit Real Format (over GPIB) /* - Remove the "," from the ACSII data */ /* - Save the trace data to an ASCII file */ /* - Close the session */ /************************************************************/ "visa.
ESA Programming Examples ESA Programming Examples Using C to Read Trace Data in a 32-Bit Real Format (over GPIB) void main() { /*Program Variables*/ ViStatus viStatus= 0; ViChar _VI_FAR cResult[5000] = {0}; ViReal32 dTraceArray[401] = {0}; char cBufferInfo[6]= {0}; long lNumberBytes =0L; long lOpc =0L; unsigned long lRetCount = 0L; int iSize = 0; /*BytesPerPoint is 4 for Real32 or Int32 formats, 8 for Real64, and 2 for Uint16*/ int iBytesPerPnt = 4; int iSwpPnts = 401; int iDataBytes=1604; int iHeaderByte
ESA Programming Examples Using C to Read Trace Data in a 32-Bit Real Format (over GPIB) /*which follow represent the number of sweep points multiplied by the number */ /*of bytes per point.
ESA Programming Examples Using C to Read Trace Data in a 32-Bit Real Format (over GPIB) ESA Programming Examples fprintf(fTraceFile,"The %d trace data points of the spectrum:\n\n",(lNumberBytes/4)); for ( long i=0;i
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over RS-232) Using C to Read Trace Data in an ASCII Format (over RS-232) This C programming example (ascrs232.c) can be found on the Documentation CD. /************************************************************/ Reading Trace Data using ASCII Format (RS-232) This example is for the E44xxB ESA Spectrum Analyzers and E740xA EMC Analyzers. This C programming example does the following.
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over RS-232) ESA Programming Examples /* - Remove the "," from the ACSII data */ /* - Save the trace data to an ASCII file */ /* - Close the session */ /************************************************************/ #include #include #include #include #include #include #include "visa.
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over RS-232) } } ESA Programming Examples void main() { /*Program Variable*/ ViStatus viStatus = 0; /*Dimension cResult to 13 bytes per sweep point, 8192 sweep points maximum*/ ViChar _VI_FAR cResult[106496] = {0}; FILE *fTraceFile; static ViChar *cToken; int iNum =0; int iSwpPnts = 401; long lCount=0L; long lOpc=0L; /*iNum set to 13 times number of sweep points, 8192 sweep points maximum*/ iNum =106496; lCount =0; /* Open a serial se
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over RS-232) viPrintf(viESA,"SENS:FREQ:CENT 50 MHz\n"); /*Set the analyzer to 50MHz Span*/ viPrintf(viESA,"SENS:FREQ:SPAN 50 MHz\n"); /*set the analyzer to single sweep mode*/ viPrintf(viESA,"INIT:CONT 0 \n"); ESA Programming Examples /*Trigger a spectrum measurement*/ viPrintf(viESA,"INIT:IMM \n"); /*Read the operation complete query*/ viQueryf(viESA, "*OPC?\n", "%d", &lOpc); if (!lOpc) { printf("Program Abort! error ocurred: last co
ESA Programming Examples Using C to Read Trace Data in an ASCII Format (over RS-232) lCount++; cToken =strtok(NULL,","); if (lCount != iSwpPnts) fprintf(fTraceFile,"\tAmplitude of point[%d] = %s dBm\n",lCount+1,cToken); } fprintf(fTraceFile,"\nThe Total trace data points of the spectrum are :[%d] \n\n",lCount); fclose(fTraceFile); Chapter 17 ESA Programming Examples /*Close the session*/ viClose(viESA); viClose(defaultRM); } 227
ESA Programming Examples Using C to Read Trace Data in a 32-bit Real Format (over RS-232) Using C to Read Trace Data in a 32-bit Real Format (over RS-232) This C programming example (32brs232.c) can be found on the Documentation CD.
ESA Programming Examples Using C to Read Trace Data in a 32-bit Real Format (over RS-232) #include #include #include #include #include #include #include ESA Programming Examples /* - Set VISA timeout to 60 seconds, to allow for slower */ /* transfer times caused by higher number of sweep points */ /* at low baud rates.
ESA Programming Examples Using C to Read Trace Data in a 32-bit Real Format (over RS-232) /* For the analyzers having frequency limits >= 3GHz, prompt the user to*/ /* connect the amplitude reference output to the input*/ printf ("Connect AMPTD REF OUT to the INPUT \n"); printf ("......
ESA Programming Examples Using C to Read Trace Data in a 32-bit Real Format (over RS-232) /* Set the input port to the internal 50MHz reference source */ Route50MHzSignal(); /*Query number of sweep points per trace (firmware revision A.04.00 or later)*/ /*For firmware revisions prior to A.04.
ESA Programming Examples Using C to Read Trace Data in a 32-bit Real Format (over RS-232) { printf("Program Abort! error ocurred: last command was not completed!\n"); exit(0); } /*Calculate size of trace record.
ESA Programming Examples Using C to Add Limit Lines Using C to Add Limit Lines This C programming example (limlines.c) can be found on the Documentation CD. /************************************************************/ Using Limit Lines */ */ This example is for the E44xxB ESA Spectrum Analyzers */ and E740xA EMC Analyzers. */ */ This C programming example does the following. */ The SCPI instrument commands used are given as */ reference. */ */ */ - Open a GPIB session at address 18.
ESA Programming Examples ESA Programming Examples Using C to Add Limit Lines /* - Set the input port to the 50 MHz amplitude reference. */ /* CAL:SOUR:STAT ON */ /* - Check to see if limit line passes or fails. It should */ /* pass. */ /* CALC:LLINE:FAIL? */ /* - Pause for 5 seconds. */ /* - Deactivate the 50 MHz alignment signal. */ /* CAL:SOUR:STAT OFF */ /* - The limit line test should fail. */ /* - Close the session.
ESA Programming Examples Using C to Add Limit Lines else { /* For the analyzers having frequency limits >= 3GHz, prompt the user*/ /* to connect the amplitude reference output to the input*/ printf ("Connect AMPTD REF OUT to the INPUT \n"); printf ("......
ESA Programming Examples Using C to Add Limit Lines exit(0); } /*Clear the instrument*/ viClear(viESA); /*Reset the instrument*/ viPrintf(viESA,"*RST\n"); ESA Programming Examples /* Check for the instrument model number and route the 50MHz signal accordingly*/ /*Route50MHzSignal(); /*Display the program heading */ printf("\n\t\t Limit Lines Program \n\n" ); /*Set the Y-Axis Units to dBm */ viPrintf(viESA, "UNIT:POW DBM\n"); /*Set to Frequency Domain Mode*/ viPrintf(viESA,"CALC:LLINE1:CONT:DOM FREQ\n"); /
ESA Programming Examples Using C to Add Limit Lines viPrintf(viESA,"CALC:LLINE2:STAT ON\n"); /*Set the analyzer to a center frequency of 50 MHz, span to 20 MHz, and resolution bandwidth to 1 MHz.
ESA Programming Examples Using C to Add Limit Lines /* The limit line test should fail.
ESA Programming Examples Using C to Measure Noise Using C to Measure Noise This C programming example (noise.c) can be found on the Documentation CD. /************************************************************/ Chapter 17 ESA Programming Examples /* Measuring Noise */ /* */ /* This example is for the E44xxB ESA Spectrum Analyzers */ /* and E740xA EMC Analyzers. */ /* */ /* This C programming example does the following. */ /* The SCPI instrument commands used are given as */ /* reference.
ESA Programming Examples Using C to Measure Noise ESA Programming Examples #include #include #include #include #include #include #include "visa.
ESA Programming Examples Using C to Measure Noise void main() { /*Program Variables*/ ViStatus viStatus = 0; double dMarkAmp =0.
ESA Programming Examples Using C to Measure Noise printf("Program Abort! error ocurred: last command was not completed!\n"); exit(0); } /*Set the analyzer in a single sweep mode*/ viPrintf(viESA,"INIT:CONT 0 \n"); ESA Programming Examples /*Trigger a spectrum measurement*/ viPrintf(viESA,"INIT:IMM \n"); /*Set the analyzer in active delta marker mode*/ viPrintf(viESA,"CALC:MARK:MODE DELT \n"); /*Set the marker delta frequency to 2 MHz.
ESA Programming Examples Using C to Enter Amplitude Correction Data Using C to Enter Amplitude Correction Data This C programming example (amplcorr.c) can be found on the Documentation CD. /************************************************************/ #include #include #include #include #include #include #include ESA Programming Examples /* Entering Amplitude Correction Data */ /* */ /* This example is for the E44xxB ESA Spectrum Analyzers */ /* and E740xA EMC Analyzers.
ESA Programming Examples Using C to Enter Amplitude Correction Data #define hpESA_IDN_E4401B #define hpESA_IDN_E4411B #define hpEMC_IDN_E7401A "Hewlett-Packard, E4401B" "Hewlett-Packard, E4411B" "Hewlett-Packard, E7401A" ESA Programming Examples ViSession defaultRM, viESA; ViStatus errStatus; ViChar cIdBuff[256]= {0}; char cEnter = 0; int iResult = 0; /*Set the input port to 50MHz amplitude reference*/ void Route50MHzSignal() { viQueryf(viESA, "*IDN?\n", "%t", &cIdBuff); iResult = (strncmp( cIdBuff, hpES
ESA Programming Examples Using C to Enter Amplitude Correction Data long lFreq=0L; long lAmpltd=1; static ViChar *cToken; /*No of amplitude corrections points */ iNoOfPoints = 4; ESA Programming Examples /* Open a GPIB session at address 18*/ viStatus=viOpenDefaultRM(&defaultRM); viStatus=viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viESA); if(viStatus) { printf("Could not open a session to GPIB device at address 18!\n"); exit(0); } /*Clear the instrument*/ viClear(viESA); /*Reset the instrument*/ viPrin
ESA Programming Examples Using C to Enter Amplitude Correction Data /*Query the analyzer for its amplitude correction factors */ viQueryf(viESA,"SENS:CORR:CSET1:DATA?" , "%s" , &cResult); /*Remove the "," from the amplitude correction for analyzing data*/ cToken = strtok(cResult,","); ESA Programming Examples /*Store the array (frequency) value into a two-dimensional real array*/ aRealArray[lFreq=0][lCount=0] = atof( cToken); /*Remove the "," from the amplitude correction for analyzing data*/ cToken =str
ESA Programming Examples Using C to Determine if an Error has Occurred Using C to Determine if an Error has Occurred This C programming example (error.c) can be found on the Documentation CD. /************************************************************/ Determine if an error has occurred */ */ This example is for the E44xxB ESA Spectrum Analyzers */ and E740xA EMC Analyzers. */ */ This C programming example does the following. */ The SCPI instrument commands used are given as */ reference.
ESA Programming Examples Using C to Determine if an Error has Occurred ESA Programming Examples /* *ESE 0 */ /* STAT:QUES:ENAB 0 */ /* STAT:QUES:INT:ENAB 0 */ /* *CLS */ /* - Continue monitoring for an interrupt */ /* - Close the session */ /************************************************************/ #include #include #include #include #include #include #include #include "visa.
ESA Programming Examples Using C to Determine if an Error has Occurred YIELD; } } printf("\n"); } /*Set the input port to 50MHz amplitude reference*/ void Route50MHzSignal() { /*Externally route the 50MHz Signal*/ viPrintf(viESA,"CAL:SOUR:STAT ON \n"); } } /*Interrupt handler,trigger event handler */ ViStatus _VI_FUNCH sSrqHdlr(ViSession viESA, ViEventType eventType, ViEvent ctx,ViAddr userHdlr) { ViUInt16 iStatusByte=0; long lCond = 0L; /* Make sure it is an SRQ event, ignore if stray event*/ if (eventTyp
ESA Programming Examples Using C to Determine if an Error has Occurred return VI_SUCCESS; ESA Programming Examples } /* When an interrupt occurs, determine which device generated the interrupt (if an instrument other than the ESA generates the interrupt, simply report "Instrument at GPIB Address xxx Has Generated an Interrupt").*/ printf ("\n SRQ Event Occurred!\n"); printf ("\n ...
ESA Programming Examples Using C to Determine if an Error has Occurred printf("Could not open a session to GPIB device at address 18!\n"); exit(0); } /*Clear the instrument*/ viClear(viESA); /*Reset the instrument*/ viPrintf(viESA,"*RST\n"); /*Display the program heading */ printf("\n\t\t Status register - Determine if an Error has Occurred\n\n" ); /* Check for the instrument model number and route the 50MHz-signal accordingly*/ Route50MHzSignal(); /*Put the analyzer in single sweep*/ viPrintf(viESA,"INIT:
ESA Programming Examples Using C to Determine if an Error has Occurred /*Allow analyzer to sweep several times.*/ viPrintf(viESA,"INIT:CONT 1 \n"); ESA Programming Examples /*Manually couple sweeptime to 5ms. reduce resolution BW to 30 KHz. "Meas Uncal" should be displayed on the screen, and an interrupt should be generated.
ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) Using C to Measure Harmonic Distortion (over GPIB) This C programming example (harmgpib.c) can be found on the Documentation CD. /************************************************************/ Measuring Harmonic Distortion (GPIB) This example is for the E44xxB ESA Spectrum Analyzers and E740xA EMC Analyzers. This C programming example does the following. The SCPI instrument commands used are given as reference.
ESA Programming Examples ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* - - - *OPC? */ De-activate signal track */ CALC:MARK:TRCK:STAT OFF */ Reset VISA timeout to 3 seconds */ Set units to dBm */ UNIT:POW DBM */ Take a sweep and wait for sweep completion */ INIT:IMM; */ *OPC? */ Perform the peak search */ CALC:MARK:MAX */ Read the marker
ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) #include #include #include #include #include #include #include ESA Programming Examples /* CALC:MARK:MAX */ /* Set marker amplitude in volts */ /* UNIT:POW V */ /* Query, read the marker amplitude in volts */ /* CALC:MARK:Y? */ /* Change the amplitude units to dBm and read the */ /* marker amplitude.
ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) /*Set the input port to the 50MHz amplitude reference for the models*/ /*E4401B, E4411B, and E7401A*/ viPrintf(viESA,"CAL:SOUR:STAT ON \n"); ESA Programming Examples } else { /* For the analyzers having frequency limits >= 3GHz, prompt the user*/ /* to connect the amplitude reference output to the input*/ printf ("Connect AMPTD REF OUT to the INPUT \n"); printf ("......
ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) lMaxHarmonic =5; dFundamental =50.
ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) viPrintf(viESA,"CALC:MARK:SET:RLEV \n"); /*Trigger a sweep, wait for sweep completion*/ viPrintf(viESA,"INIT:IMM;*WAI\n"); /*Perform a peak search */ viPrintf(viESA,"CALC:MARK:MAX \n"); ESA Programming Examples /*increase timeout to 60 sec*/ viSetAttribute(viESA,VI_ATTR_TMO_VALUE,60000); /*Perform activate signal track */ viPrintf(viESA,"CALC:MARK:TRCK:STAT ON \n"); /*Take a sweep and wait for the sweep completion*/ TakeSweep(); /
ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) /*Read the marker frequency.
ESA Programming Examples Using C to Measure Harmonic Distortion (over GPIB) /*Query and read the Marker Amplitude in Volts*/ /*Store the result in the array.*/ viQueryf(viESA,"CALC:MARK:Y?\n","%1f", &fHarmV[lNum]); ESA Programming Examples /*Change the amplitude units to DBM viPrintf(viESA,"UNIT:POW DBM\n"); */ /* Read the marker amplitude */ viQueryf(viESA,"CALC:MARK:Y?\n","%1f", &fHarmDbm[lNum]); } /*Sum the square of each element in the fHarmV array.
ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) Using C to Measure Harmonic Distortion (over RS-232) This C programming example (harmrs23.c) can be found on the Documentation CD. /************************************************************/ Measuring Harmonic Distortion (RS-232) This example is for the E44xxB ESA Spectrum Analyzers and E740xA EMC Analyzers. This C programming example does the following. The SCPI instrument commands used are given as reference.
ESA Programming Examples ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* /* - - - *OPC? */ De-activate signal track */ CALC:MARK:TRCK:STAT OFF */ Reset VISA timeout to 3 seconds */ Set units to dBm */ UNIT:POW DBM */ Take a sweep and wait for sweep completion */ INIT:IMM; */ *OPC? */ Perform the peak search */ CALC:MARK:MAX */ Read the mark
ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) #include #include #include #include #include #include #include ESA Programming Examples /* CALC:MARK:MAX */ /* Set marker amplitude in volts */ /* UNIT:POW V */ /* Query, read the marker amplitude in volts */ /* CALC:MARK:Y? */ /* Change the amplitude units to dBm and read the */ /* marker amplitude.
ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) /*Set the input port to the 50MHz amplitude reference for the models*/ /*E4411B, E4401B*/ viPrintf(viESA,"CAL:SOUR:STAT ON\n"); ESA Programming Examples } else { /* For the analyzers having frequency limits >= 3GHz, prompt the user*/ /* to connect the amplitude reference output to the input*/ printf ("Connect AMPTD REF OUT to the INPUT \n"); printf ("......
ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) /*Setting default values*/ lMaxHarmonic =5; dFundamental =50.
ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) /* Place the signal at the reference level using the marker-to-reference level command and take sweep */ viPrintf(viESA,"CALC:MARK:SET:RLEV\n"); /*Trigger a sweep, wait for sweep completion*/ viPrintf(viESA,"INIT:IMM;*WAI\n"); ESA Programming Examples /*Perform a peak search */ viPrintf(viESA,"CALC:MARK:MAX\n"); /*Increase timeout to 60 sec*/ viSetAttribute(viESA,VI_ATTR_TMO_VALUE,60000); /*Perform activate signal track */ viPri
ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) viQueryf(viESA,"CALC:MARK:Y?\n","%lf",&dFundaAmptdV); /*Read the marker frequency.
ESA Programming Examples Using C to Measure Harmonic Distortion (over RS-232) /*Perform a peak search and wait for completion*/ viPrintf(viESA,"CALC:MARK:MAX\n"); /*Query and read the marker amplitude in Volts*/ /*Store the result in the fHarmV array.
ESA Programming Examples Using C to Make Faster Power Averaging Measurements Using C to Make Faster Power Averaging Measurements This C programming example (average.c) can be found on the Documentation CD. /************************************************************/ Average.
ESA Programming Examples ESA Programming Examples Using C to Make Faster Power Averaging Measurements /* DISP:ENAB OFF */ /* - Select internal machine binary data format (milli-dBm) */ /* FORM:DAT INT,32 */ /* - Select appropriate byte order (Intel) */ /* FORM:BORD SWAP */ /* - Repeat the following the requested number of times: */ /* - Trigger a measurement and wait for completion */ /* INIT:*OPC? */ /* - Read the resulting measurement trace */ /* TRAC:DATA? TRACE1 */ /* - Compute running averaged power a
ESA Programming Examples Using C to Make Faster Power Averaging Measurements #define DATA_LENGTH 4 */ #define MAX_POINTS 8192 */ /* number of data bytes in one trace point /* maximum number of points/trace in ESA */ */ int iResult =0; unsigned long lRetCount; */ /* the number of bytes transferred in one trace record double dDelta, dTimePer, dPower; struct timeb start_time, stop_time, elapsed_time; char cCommand[100]; char cBuffer[100]; char cEnter; double dPwrAvgArray[MAX_POINTS]; ViUInt32 iHeaderLeng
ESA Programming Examples Using C to Make Faster Power Averaging Measurements ***********************/ int HeaderLength(int iArrayLength) int iHeaderLength; iHeaderLength = 3; { /* iArrayLength >0 plus increment for "#" and "n" */ ESA Programming Examples while ( (iArrayLength = (iArrayLength / 10)) > 0 ) iHeaderLength++; } { return(iHeaderLength); } /******************* prepare ESA for measurement ************************/ void setup() { viPrintf(viESA, ":SENS:FREQ:CENT %i MHz\n", iCenter); viPrintf
ESA Programming Examples Using C to Make Faster Power Averaging Measurements ESA Programming Examples { /*Set the input port to the 50MHz amplitude reference for the models*/ /*E4401B, E4411B and E7401A*/ viPrintf(viESA,":DISP:WIND:TRAC:Y:RLEV -25 DBM\n"); viPrintf(viESA,"CAL:SOUR:STAT ON \n"); } else { /* For the analyzers having frequency limits >= 3GHz, prompt the user*/ /* to connect the amplitude reference output to the input*/ printf ("Connect AMPTD REF OUT to the INPUT \n"); printf ("......
ESA Programming Examples Using C to Make Faster Power Averaging Measurements /**************** Write binary trace data to ESA *******************/ void write_binary_trace(char *cScpiCommand, int *ipTraceData) { ESA Programming Examples /* trace data must point to an integer array of size NUM_POINTS memcpy(&cOutBuffer[strlen(cScpiCommand)], ipTraceData, iArrayLength); memcpy(&cOutBuffer, cScpiCommand, strlen(cScpiCommand)); /* Add a to the end of the data, This isn’t necessary /* if the GPIB ca
ESA Programming Examples Using C to Make Faster Power Averaging Measurements */ */ */ /* stop the timer ftime( &stop_time ); */ /* Calculate elapsed time if (start_time.millitm > stop_time.millitm) { stop_time.millitm += 1000; stop_time.time--; } elapsed_time.millitm = stop_time.millitm - start_time.millitm; elapsed_time.time = stop_time.time - start_time.time; */ /* This is measurement time in milliseconds dDelta = (1000.0 * elapsed_time.time) + (elapsed_time.
ESA Programming Examples Using C to Make Faster Power Averaging Measurements viStatus = viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viESA); if(viStatus) { printf("Could not open a session to GPIB device at address 18!\n"); exit(0); } ESA Programming Examples /*Clear the Instrument viClear(viESA); */ /* go to known instrument state with cleared status byte viPrintf(viESA, ":SYST:PRES:TYPE FACT;*RST\n"); */ /* measure, transfer and calculate power average of multiple traces average(); */ /* convert
PSA Programming Examples 18 PSA Programming Examples 277
PSA Programming Examples Examples Included in this Chapter: Examples Included in this Chapter: • “Using C with Marker Peak Search and Peak Excursion Measurement Routines” on page 280 • “Using C for Saving and Recalling Instrument State Data” on page 283 • “Using C to Save Binary Trace Data” on page 287 • “Using C to Make a Power Calibration Measurement for a GSM Mobile Handset” on page 291 • “Using C with the CALCulate:DATA:COMPress? RMS Command” on page 297 • “Using C Over Socket LAN (UNIX)” on page 303 •
PSA Programming Examples Programming Examples Information and Requirements Programming Examples Information and Requirements • The programming examples were written for use on an IBM compatible PC. • The programming examples use C, Visual Basic and LabVIEW programming languages. • There are examples using GPIB and LAN interfaces. • Many of the examples use the SCPI programming commands, though there are some that use the plug&play or IVI.com drivers.
PSA Programming Examples Using C with Marker Peak Search and Peak Excursion Measurement Routines Using C with Marker Peak Search and Peak Excursion Measurement Routines This C programming example (peaksrch.c) can be found on the Documentation CD. /************************************************************/ /* peaksrch.
PSA Programming Examples Using C with Marker Peak Search and Peak Excursion Measurement Routines void main() { /*Program Variables*/ ViStatus viStatus = 0; char cEnter = 0; int iResult = 0; double dMarkerFreq = 0; double dMarkerAmpl = 0; float fPeakExcursion =0; long lOpc = 0L; char *psaSetup = // PSA setup initialization ":INST SA;" "*RST;*CLS;" // Change to Spectrum Analysis mode // Reset the device and clear status ":SENS:FREQ:CENT 50 MHz;"// Set center freq to 50 MHz ":SENS:FREQ:SPAN 50 MHz;"/
PSA Programming Examples Using C with Marker Peak Search and Peak Excursion Measurement Routines /*User enters the peak excursion value */ printf("\t Enter PEAK EXCURSION level in dBm: "); scanf( "%f",&fPeakExcursion); /*Set the peak excursion*/ viPrintf(viPSA,"CALC:MARK:PEAK:EXC %1fDB \n",fPeakExcursion); /*Trigger a sweep and wait for completion*/ viPrintf(viPSA,"INIT:IMM;*WAI\n"); /*Set the marker to the maximum peak*/ viPrintf(viPSA,"CALC:MARK:MAX \n"); /*Query and read the marker frequency*/ viQ
PSA Programming Examples Using C for Saving and Recalling Instrument State Data Using C for Saving and Recalling Instrument State Data This C programming example (State.c) can be found on the Documentation CD. /*************************************************************************** * State.
PSA Programming Examples Using C for Saving and Recalling Instrument State Data /*set the instrument to SA mode*/ viPrintf(viVSA, "INST SA\n"); /*reset the instrument */ viPrintf(viVSA, "*RST\n"); /*set the input port to the internal 50Mhz reference source*/ viPrintf(viVSA, "SENS:FEED AREF\n"); /*tune the analyzer to 50MHZ*/ viPrintf(viVSA, "SENS:FREQ:CENT 50E6\n"); /*change the span*/ viPrintf(viVSA, "SENS:FREQ:SPAN 10 MHZ\n"); /*turn the display line on*/ viPrintf(viVSA, "DISP:WIND:TRACE:Y:DLINE:STAT
PSA Programming Examples Using C for Saving and Recalling Instrument State Data printf("PSA Programming example showing *SAV,*RCL SCPI commands\n"); printf("used to save instrument state\n\t\t------------------------"); printf("\n\nThe instrument state has been saved to an internal register\n"); printf("Please observe the display and notice the signal shape\n"); printf("Then press any key to reset the instrument\n\t\t------------------------"); /*wait for any key to be pressed*/ getch(); /*reset the instr
PSA Programming Examples Using C for Saving and Recalling Instrument State Data viPrintf(viVSA, "*RST;*wai\n"); /*Set the instrument to continuous sweep */ viPrintf(viVSA, "INIT:CONT 1\n"); /* close session */ viClose (viVSA); viClose (defaultRM); PSA Programming Examples } 286 Chapter 18
PSA Programming Examples Using C to Save Binary Trace Data Using C to Save Binary Trace Data This C programming example (Trace.c) can be found on the Documentation CD. This example uses Option B7J. /*************************************************************************** * Trace.c * Agilent Technologies 2001 * * Instrument Requirements: * E444xA with option B7J and firmware version >= A.02.00 or * E4406A with firmware version >= A.05.
PSA Programming Examples Using C to Save Binary Trace Data ViReal64 adTraceArray[10240]; char *psaSetup =/* setup commands for VSA/PSA */ ":INST BASIC;"/* Set the instrument mode to Basic */ "*RST;*CLS;"/* Reset the device and clear status */ ":INIT:CONT 0;"/* Set analyzer to single measurement mode */ ":FEED AREF;"/* set the input port to the internal 50MHz reference source */ ":DISP:FORM:ZOOM1;"/* zoom the spectrum display */ ":FREQ:CENT 50E6;"/* tune the analyzer to 50MHz */ ":FORM REAL,64;"/* Set the o
PSA Programming Examples Using C to Save Binary Trace Data /*print message to the standard output*/ printf("Getting the spectrum trace in binary format...\nPlease wait...
PSA Programming Examples Using C to Save Binary Trace Data sBuffer[lLength] = 0; printf("%s\n",sBuffer); /* append a null to byte count */ /* print error buffer to display */ } while (sBuffer[1] != ’0’); /* set the analyzer to continuous mode for manual use */ viPrintf(viPSA, "INIT:CONT 1\n"); /*save trace data to an ASCII file*/ fTraceFile=fopen("C:\\Trace.txt","w"); fprintf(fTraceFile,"Trace.
PSA Programming Examples Using C to Make a Power Calibration Measurement for a GSM Mobile Handset Using C to Make a Power Calibration Measurement for a GSM Mobile Handset This C programming example (powercal.c) can be found on the Documentation CD. This program uses Basic mode which is optional -B7J- in the PSA Series spectrum analyzers and is standard in the E4406A Vector Signal Analyzer.
PSA Programming Examples Using C to Make a Power Calibration Measurement for a GSM Mobile Handset * Instrument Requirements: * E444xA with option B7J and firmware version >= A.05.00 or * E4406A with firmware version >= A.07.00 or * * Signal Source Setup: * Set up GSM/EDGE frame for either 1, 2, 4, or eight slots per frame. * When configuring two slots per frame, turn on slots 1 and 5 * When configuring four slots per frame, turn on slots 1,3,5, and 7. * Set frame repeat to Single.
PSA Programming Examples Using C to Make a Power Calibration Measurement for a GSM Mobile Handset long i = 0; long lOpc = 0L; double sweeptime = 0; double burstinterval= 0; unsigned long lBytesRetrieved; ViReal64 adDataArray[100]; char sBuffer[80]= {0}; char *basicSetup = // measurement setup commands for VSA/PSA ":INST:SEL BASIC;"// Put the instrument in Basic Mode "*RST; "// Preset the instrument "*CLS; "//Clear the status byte ":STAT:OPER:ENAB 32;" //Enable Status Operation ":DISP:ENAB 0;"// Tur
PSA Programming Examples Using C to Make a Power Calibration Measurement for a GSM Mobile Handset /*check opening session sucess*/ if(viStatus) { printf("Could not open a session to GPIB device at address 18!\n"); exit(0); } /* Set I/O timeout to ten seconds */ viSetAttribute(viVSA,VI_ATTR_TMO_VALUE,10000); viClear(viVSA);//send device clear to instrument /*print message to the standard output*/ printf("Enter number of bursts per frame (1,2,4 or 8): "); scanf( "%ld",&lbursts); /* Send setup commands to
PSA Programming Examples Using C to Make a Power Calibration Measurement for a GSM Mobile Handset while(1) { viReadSTB(viVSA,&stb); //read status byte if (stb & 128) break; //look for "waiting for trigger" bit printf("Waiting on Analyzer...\n"); Sleep (50); // wait 50 ms between each serial poll } /*print message to the standard output*/ printf("Analyzer is Ready!\n\nWaiting for phone to trigger...
PSA Programming Examples Using C to Make a Power Calibration Measurement for a GSM Mobile Handset /* read the terminator character and discard */ viRead (viVSA,(ViBuf)sBuffer,1, <hrowaway); /*print message to the standard output*/ printf("Querying instrument to see if any errors in Queue.
PSA Programming Examples Using C with the CALCulate:DATA:COMPress? RMS Command Using C with the CALCulate:DATA:COMPress? RMS Command This C programming example (calcomp.c) can be found on the Documentation CD. This program uses the CALCulate:DATA:COMPress? RMS command to average the voltage trace data to calculate power of consecutive GSM bursts. Older instrument firmware does not support the newer DME parameter described in the previous example.
PSA Programming Examples Using C with the CALCulate:DATA:COMPress? RMS Command * * CALC:DATA0:COMP? RMS parameters: soffset = 25us (This avoids averaging data points when the burst * is transitioning on.) * length = 526us (Period over which the power of the burst is averaged) * roffset = 4.165 ms (Repition interval of burst. * For this example it is equal to one GSM frame: 4.165 ms.) *****************************************************************************/ #include
PSA Programming Examples Using C with the CALCulate:DATA:COMPress? RMS Command ":DISP:ENAB 0;"// Turn the Display off (improves Speed) ":FORM REAL,64;"// Set the ouput format to binary ":FORM:BORD SWAP;"// set the binary byte order to SWAP (for PC) ":CONF:WAV;"// Changes measurement to Waveform ":INIT:CONT 0;"// Puts instrument in single measurement mode ":CAL:AUTO OFF;"//Turn auto align off ":FREQ:CENTER 935.2MHz;"//Set Center Freq to 935.
PSA Programming Examples Using C with the CALCulate:DATA:COMPress? RMS Command /* Send setup commands to instrument */ viPrintf(viPSA,"%s\n",basicSetup); /* Calculate sweep time and set it*/ sweeptime=4.
PSA Programming Examples Using C with the CALCulate:DATA:COMPress? RMS Command /* get number of bytes in length of postceeding data and put this in sBuffer*/ viRead (viPSA,(ViBuf)sBuffer,2,&lBytesRetrieved); /* Put the returned data into sBuffer */ viRead (viPSA,(ViBuf)sBuffer,sBuffer[1] - ’0’,&lBytesRetrieved); /* append a null to sBuffer */ sBuffer[lBytesRetrieved] = 0; /* convert sBuffer from ASCII to integer */ lNumberBytes = atoi(sBuffer); /*calculate the number of returned values given the number
PSA Programming Examples Using C with the CALCulate:DATA:COMPress? RMS Command /* Turn the Display of the instrument back on */ viPrintf(viPSA,"DISP:ENAB 1\n"); /*save result data to an ASCII file*/ fDataFile=fopen("C:\\calccomp.txt","w"); fprintf(fDataFile,"Calccomp.
PSA Programming Examples Using C Over Socket LAN (UNIX) Using C Over Socket LAN (UNIX) This C programming example (socketio.c) compiles in the HP-UX UNIX environment. It is portable to other UNIX environments with only minor changes. In UNIX, LAN communication via sockets is very similar to reading or writing a file. The only difference is the openSocket() routine, which uses a few network library routines to create the TCP/IP network connection.
PSA Programming Examples Using C Over Socket LAN (UNIX) * * * Query the center frequency: lanio 15.4.43.
PSA Programming Examples Using C Over Socket LAN (UNIX) /* Support both Win32 and HP-UX UNIX environment */ #ifdef _WIN32 # /* Visual C++ 4.0 will define this */ define WINSOCK #endif #ifndef WINSOCK # ifndef _HPUX_SOURCE # define _HPUX_SOURCE # endif #endif #include /* for fprintf and NULL */ #include /* for memcpy and memset */ #include /* for malloc(), atol() */ #include
PSA Programming Examples Using C Over Socket LAN (UNIX) #endif /* WINSOCK */ #ifdef WINSOCK /* Declared in getopt.c. See example programs disk. */ extern char *optarg; extern int optind; extern int getopt(int argc, char * const argv[], const char* optstring); #else # include
PSA Programming Examples Using C Over Socket LAN (UNIX) WSADATA wsaData; int err; wVersionRequested = MAKEWORD(1, 1); wVersionRequested = MAKEWORD(2, 0); err = WSAStartup(wVersionRequested, &wsaData); if (err != 0) { /* Tell the user that we couldn’t find a useable */ /* winsock.dll. */ fprintf(stderr, "Cannot initialize Winsock 1.1.
PSA Programming Examples Using C Over Socket LAN (UNIX) * * $Return: (int) . . . . . . . . A file descriptor similar to open(1).
PSA Programming Examples Using C Over Socket LAN (UNIX) memcpy(&peeraddr_in.sin_addr.s_addr, hostPtr->h_addr, hostPtr->h_length); peeraddr_in.sin_family = AF_INET; peeraddr_in.
PSA Programming Examples Using C Over Socket LAN (UNIX) /* fprintf(stderr, "Sending \"%s\".\n", command); */ if (strchr(command, ’\n’) == NULL) { fprintf(stderr, "Warning: missing newline on command %s.
PSA Programming Examples Using C Over Socket LAN (UNIX) if (*ptr == ’\n’) { ptr++; err = 0; break; } ptr++; } *ptr = ’\0’; if (err) { return NULL; } else { return result; } #else /*********************************************************************** * Simpler UNIX version, using file I/O. recv() version works too. PSA Programming Examples * This demonstrates how to use file I/O on sockets, in UNIX.
PSA Programming Examples Using C Over Socket LAN (UNIX) * > $Function: queryInstrument$ * * $Description: send a SCPI command to the instrument, return a response.$ * * $Parameters: $ * (FILE *) . . . . . . . . . file pointer associated with TCP/IP socket. * (const char *command) * (char *result) . . . . . . where to put the result. * (size_t) maxLength . . . . maximum size of result array in bytes. . . SCPI command string. * * $Return: (long) . . . . . . .
PSA Programming Examples Using C Over Socket LAN (UNIX) ch = tmp_buf[0]; if ((count < 1) || (ch == EOF) || (ch == ’\n’)) { *result = ’\0’; /* null terminate result for ascii */ return 0; } /* use a do-while so we can break out */ do { if (ch == ’#’) { /* binary data encountered - figure out what it is */ long numDigits; long numBytes = 0; /* char length[10]; */ count = recv(sock, tmp_buf, 1, 0); /* read 1 char */ PSA Programming Examples ch = tmp_buf[0]; if ((count < 1) || (ch == EOF)) break; /* End
PSA Programming Examples Using C Over Socket LAN (UNIX) /* Loop until we get all the bytes we requested. */ /* Each call seems to return up to 1457 bytes, on HP-UX 9.05 */ do { int rcount; rcount = recv(sock, result, (int)numBytes, 0); resultBytes += rcount; result += rcount; /* Advance pointer */ } while ( resultBytes < numBytes ); /************************************************************ * For LAN dumps, there is always an extra trailing newline * Since there is no EOI line.
PSA Programming Examples Using C Over Socket LAN (UNIX) if (recv_line(sock, result+1, maxLength-1) == NULL) return 0; /* REMOVE trailing newline, if present. And terminate string.
PSA Programming Examples Using C Over Socket LAN (UNIX) * Don’t bother decoding. ******************************************************************/ if (strncmp(result_str, "+0,", 3) == 0) { /* Matched +0,"No error" */ break; } puts(result_str); } while (1); } /*************************************************************************** * > $Function: isQuery$ * * $Description: Test current SCPI command to see if it a query. $ * PSA Programming Examples * $Return: (unsigned char) . . .
PSA Programming Examples Using C Over Socket LAN (UNIX) * any command with a ’?’ followed by a ’)’ character. * This kind of command is not a query from our point of view. * The analyzer does the query internally, and uses the result.
PSA Programming Examples Using C Over Socket LAN (UNIX) char *charBuf = (char *) malloc(INPUT_BUF_SIZE); char *basename; int chr; char command[1024]; char *destination; unsigned char quiet = 0; unsigned char show_errs = 0; int number = 0; basename = strrchr(argv[0], ’/’); if (basename != NULL) basename++ ; else basename = argv[0]; while ( ( chr = getopt(argc,argv,"qune")) != EOF ) switch (chr) PSA Programming Examples { case ’q’: quiet = 1; break; case ’n’: number = 1; break ; case ’e’: show_errs =
PSA Programming Examples Using C Over Socket LAN (UNIX) strcat(command, " "); } else { strcat(command, "\n"); } } } else { /* Only provided; input on */ strcpy(command, ""); if (optind > argc) { usage(basename); exit(1); } } } else PSA Programming Examples { /* no hostname! */ usage(basename); exit(1); } /**********************************************/ /* open a socket connection to the instrument */ /**********************************************/ #ifdef WINSOCK if (init_winsock() !=
PSA Programming Examples Using C Over Socket LAN (UNIX) fprintf(stderr, "Unable to open socket.\n"); return 1; } /* fprintf(stderr, "Socket opened.\n"); */ if (strlen(command) > 0) { /********************************************************/ /* if the command has a ’?’ in it, use queryInstrument. */ /* otherwise, simply send the command.
PSA Programming Examples Using C Over Socket LAN (UNIX) if ( *charBuf == ’#’ || *charBuf == ’!’ ) continue ; strcat(charBuf, "\n"); if (!quiet) { if (number) { char num[10]; sprintf(num,"%d: ",number); fwrite(num, strlen(num), 1, stdout); } fwrite(charBuf, strlen(charBuf), 1, stdout) ; fflush(stdout); } if ( isQuery(charBuf) ) { PSA Programming Examples long bufBytes; /* Put the query response into the same buffer as the * command string appended after the null terminator.
PSA Programming Examples Using C Over Socket LAN (UNIX) { commandInstrument(instSock, charBuf); } if (number) number++; } } if (show_errs) { showErrors(instSock); } #ifdef WINSOCK closesocket(instSock); close_winsock(); #else close(instSock); #endif /* WINSOCK */ PSA Programming Examples return 0; } /* End of lanio.
PSA Programming Examples Using C Over Socket LAN (Windows NT) Using C Over Socket LAN (Windows NT) This C programming example (getopt.c) compiles in the Windows NT environment. In Windows, the routines send() and recv() must be used, since fread() and fwrite() may not work on sockets. The program reads the analyzer’s host name from the command line, followed by the SCPI command. It then opens a socket to the analyzer, using port 5025, and sends the command.
PSA Programming Examples Using C Over Socket LAN (Windows NT) the first call to the function getopt. When all options have been processed (i.e., up to the first non-option argument), getopt returns EOF. The special option -- can be used to delimit the end of the options; EOF is returned, and -- is skipped. ***************************************************************************/ #include /* For NULL, EOF */ #include
PSA Programming Examples Using C Over Socket LAN (Windows NT) optind++; } c = *scan++; posn = strchr(optstring, c); /* DDP */ if (posn == NULL || c == ’:’) { fprintf(stderr, "%s: unknown option -%c\n", argv[0], c); return(’?’); } posn++; if (*posn == ’:’) { if (*scan != ’\0’) { optarg = scan; scan = NULL; } else { optarg = argv[optind]; optind++; PSA Programming Examples } } return(c); } Chapter 18 325
PSA Programming Examples Using Java Programming Over Socket LAN Using Java Programming Over Socket LAN This Java programming example (ScpiDemo.java) demonstrates simple socket programming with Java and can be found on the Documentation CD. It is written in Java programming language, and will compile with Java compilers versions 1.0 and above. import java.awt.*; import java.io.*; import java.net.*; import java.applet.
PSA Programming Examples Using Java Programming Over Socket LAN Panel p; // Initialize the applets public void init() { SetupSockets(); SetupPanels(); // Set up font type for both panels Font font = new Font("TimesRoman", Font.BOLD,14); scpiResponse.setFont(font); scpiCommand.setFont(font); scpiResponse.appendText("SCPI Demo Program: Response messages\n"); scpiResponse.
PSA Programming Examples Using Java Programming Over Socket LAN public boolean action(Event evt, Object what) { // If this is the correct target if (evt.target == scpiCommand) { // Get the scpi command String str = scpiCommand.getText(); // Send it out to the Scpi socket sck.ScpiWriteLine(str); String tempStr = str.toLowerCase(); // If command str is "syst:err?", don’t need to send another one. if ( (tempStr.indexOf("syst") == -1) || (tempStr.indexOf("err") == -1) ) { // Query for any error sck.
PSA Programming Examples Using Java Programming Over Socket LAN // Clear the error queue before starting the thread // in case if there’s any error messages from the previous actions while ( str.indexOf("No error") == -1 ) { sck.ScpiWriteLine("syst:err?"); str = sck.ScpiReadLine(); } // Start receiving response or error messages while(true) { str = sck.ScpiReadLine(); if ( str != null ) { // If response messages is "No error", do no display it, // replace it with "OK" instead. if ( str.
PSA Programming Examples Using Java Programming Over Socket LAN p.add("West", new Label("SCPI command:")); p.add("Center", scpiCommand); southPanel.add(p); // Set up the Response panel setLayout(new BorderLayout(2,2)); add("Center", scpiResponse); add("South", southPanel); } } // Socks class is responsible for open/close/read/write operations // from the predefined socket ports. // the only port used is 5025 for the SCPI port. For this example program, class Socks extends java.applet.
PSA Programming Examples Using Java Programming Over Socket LAN Socks(URL appletB) { appletBase = appletB; // Set up for port array.
PSA Programming Examples Using Java Programming Over Socket LAN } } // Close the socket(s) if opened public void CloseSocket(int s) { try { if ( sockOpen[s] == true ) { // write blank line to exit servers elegantly sockOut[s].println(); sockOut[s].flush(); sockIn[s].close(); sockOut[s].close(); sock[s].close(); sockOpen[s] = false; } } catch (IOException e) { PSA Programming Examples System.out.println("Sock, Close Error "+e.
PSA Programming Examples Using Java Programming Over Socket LAN //************* Socket I/O routines. //*** I/O routines for SCPI socket // Write an ASCII string with carriage return to SCPI socket public void ScpiWriteLine(String command) { if ( SockOpen(SCPI) ) { sockOut[SCPI].println(command); sockOut[SCPI].flush(); } } // Read an ASCII string, terminated with carriage return from SCPI socket public String ScpiReadLine() { try { if ( SockOpen(SCPI) ) { PSA Programming Examples return sockIn[SCPI].
PSA Programming Examples Using Java Programming Over Socket LAN catch (IOException e) { System.out.println("Scpi Read Byte Error "+e.
PSA Programming Examples Using the VXI Plug-N-Play Driver in LabVIEW® Using the VXI Plug-N-Play Driver in LabVIEW® This example shows how to use the VXI plug and play driver over LAN in LabVIEW 6. The vi file (lan_pnp.vi) can be found on the Documentation CD. You must have Version K of the Agilent IO libraries installed on your PC, either alone or installed side-by-side with the National Instruments IO libraries.
PSA Programming Examples Using LabVIEW® 6 to Make an EDGE GSM Measurement Using LabVIEW® 6 to Make an EDGE GSM Measurement This is a LabVIEW 6 example that uses SCPI commands instead of the instrument driver. It demonstrates reading ASCII trace points of entire EDGE waveform data in the Power Vs. Time measurement over LAN. This program uses the optional GSM/EDGE personality in the PSA Series Spectrum Analyzers and in the E4406A Vector Signal Analyzer. The vi file (epvt.
PSA Programming Examples Using LabVIEW® 6 to Make an EDGE GSM Measurement PSA Programming Examples Chapter 18 337
PSA Programming Examples Using Visual Basic® .NET with the IVI-Com Driver Using Visual Basic® .NET with the IVI-Com Driver This example uses Visual Basic .NET with the IVI-Com driver. It makes a time domain (Waveform) measurement using the Basic mode. Basic mode is standard in the E4406A Vector Signal Analyzer and is optional (B7J) in the PSA Series Spectrum Analyzers. The vb file (vbivicomsa_basicwaveform.vb) and the compiled executable file (vbivicomsa.exe) can be found on the Documentation CD.
PSA Programming Examples Using Visual Basic® .NET with the IVI-Com Driver ’ Copyright (c) 2003. Agilent Technologies, Inc. ’************************************************************************* Option Strict On Imports Agilent.TMFramework Imports Agilent.AgilentSa.Interop Imports Ivi.Driver.Interop Imports System.Runtime.InteropServices Module ConsoleApp Sub Main() ’ Prompt the user for the address of the instrument Dim address As String Console.
PSA Programming Examples Using Visual Basic® .NET with the IVI-Com Driver Dim manufacturer As String Dim model As String Dim firmware As String manufacturer = inherent.Identity.InstrumentManufacturer model = inherent.Identity.InstrumentModel firmware = inherent.Identity.InstrumentFirmwareRevision ’ Output instrument information to the console Console.WriteLine("Manufacturer: " + manufacturer) Console.WriteLine("Model: " + model) Console.WriteLine("Firmware: " + firmware) ’ Reset the instrument inherent.
PSA Programming Examples Using Visual Basic® .NET with the IVI-Com Driver Next Catch ex As Exception Console.WriteLine(ex.Message) Finally ’ Close the connection instr.Close() End Try Catch ex As COMException Console.WriteLine(ex.Message) Catch ex As Exception Console.WriteLine(ex.Message) End Try PSA Programming Examples ’ Wait for user input Console.WriteLine("Press ENTER to end program.") Console.
PSA Programming Examples Using Agilent VEE to Capture the Equivalent SCPI Learn String Using Agilent VEE to Capture the Equivalent SCPI Learn String This example shows how to use VEE to emulate the *LRN SCPI command. The VEE file (lrnstring.vee) can be found on the Documentation CD. PSA Programming Examples This VEE programming example transfers the saved state register (17 in this example) to the program. The program then copies this register back into the instrument and recalls the state.
Index A ACPR C programming example 176 active function position, moving 14 adding limit lines programming example using C 233 adjacent channel power measurement 74 Agilent VEE program example 197, 342 alignments programming example 179 AM demodulation time-domain demodulation, manually calculating 157 AM signal demodulation 92 analyzer distortion products 40 attenuation input, reducing 26 setting automatically 27 setting manually 27 averaging description 30 types 30 averaging faster programming example usi
Index ESA-E time gate 64 PSA gated FFT 66 PSA gated sweep 62 trace averaging 30 tracking a signal 38 TV signals demodulate and view 122 depth of modulation 126 external mixing entering conversion loss data 85 preselected mixers, using 86 setting mixer bias 84 unpreselected mixers, using 82 F finding hidden signals 131 FM demodulation time-domain demodulation, manually calculating 157 FM signal demodulation 98 frequency readout resolution increased 32 G gate delay setting the gate delay, time gating 144 gat
Index saving PSA binary trace data, using C 287 SCPI learn string, using VEE 342 screen image capture 188 SRQ, using 182 system requirements, ESA examples 201 system requirements, PSA examples 279 transfer binary trace data 192 transfer trace data, using VEE 197 using C over socket LAN via UNIX 303 using C over socket LAN via WIN NT 323 using Java over socket LAN 326 VXI Plug-N-Play driver, using LabVIEW 335 R RBW selections 28 read ESA 32-bit trace data over GPIB programming example using C 218 read ESA 3
Index Index gated LO (PSA), concepts 136 gated video (ESA), concepts 136 how time gating works 135 initial settings 148 keys 143 positioning the gate 63, 143 PSA gated FFT, using 66 PSA gated sweep, using 62 rules 147 setting sweep time 148 setting the gate length 144 setting the resolution bandwidth 144, 145 setting the span 143, 146 setting the video bandwidth 144, 146 signal parameters 141 steps for measuring unknown signals 141 sweep time 64, 142 triggering edge mode 151 level mode 151 negative edge 1