PXI 3000 Series Programming Manual
PXI 3000 Series Programming Manual
Programming Manual
Intended audience
Engineers who want to learn how to control PXI modules programmatically for making RF
measurements.
This manual assumes the engineer is competent in his chosen language and concentrates
on the detail of controlling the PXI modules rather than providing a known good
architecture for the engineer to modify.
Document conventions
The following conventions apply throughout this manual:
CAPS Capitals are used to identify names of controls and panel markings.
[CAPS] Capitals in square brackets indicate hard key titles.
[Italics] Italics in square brackets indicate soft key titles.
Associated publications
If you want to… Refer to…
Find information about soft front panels, drivers, PXI Modules CD-ROM
application software, data sheets, getting started Part no. 46886/028
and user manuals for this and other modules in the Supplied with the module
3000 Series.
Install modules into a rack, interconnect them, 3000 Series PXI Modules Common
power up and install drivers. Installation Guide
Part no. 46882/663
On the CD-ROM and at www.cobham.com/wireless
Set up a populated chassis ready for use. 3000 Series PXI Modules Installation Guide
for
Chassis
Part no. 46882/667
On the CD-ROM and at www.cobham.com/wireless
2
Contents
About this manual ......................................................................................................................................................... 2
Intended audience ................................................................................................................................................................ 2
Document conventions ...................................................................................................................................................... 2
Associated publications ...................................................................................................................................................... 2
Precautions ......................................................................................................................................................................... 5
Anti-virus protection ............................................................................................................................................................ 5
Scope ...................................................................................................................................................................................... 6
Getting started ................................................................................................................................................................. 6
Adding a reference to the Aeroflex module drivers in Visual Studio ......................................................... 6
Instantiating the digitizer, signal generator and combiner objects ..................................................... 8
Error handling ........................................................................................................................................................................... 8
Booting Aeroflex PXI modules........................................................................................................................... 11
EepromCacheEnable.......................................................................................................................................................... 11
Booting Aeroflex signal generators ........................................................................................................................... 12
Booting Aeroflex digitizers............................................................................................................................................. 12
Booting Aeroflex combiners ......................................................................................................................................... 12
Checking options................................................................................................................................................................. 12
The 10 MHz reference and PXI module configurations ................................................................................. 13
Checking the PXI system is locked to the 10 MHz reference ..................................................................... 14
10 MHz termination .......................................................................................................................................................... 15
Fast switching Option 01 ................................................................................................................................................ 16
Combiners ............................................................................................................................................................................... 16
Closing down the instrument ....................................................................................................................................... 17
Signal generator basics ........................................................................................................................................... 18
Leveling mode ....................................................................................................................................................................... 18
AIQ file level information ............................................................................................................................................... 19
CW vs. ARB file ..................................................................................................................................................................... 19
CW....................................................................................................................................................................................... 19
Arb file ............................................................................................................................................................................... 19
302x leveling control ........................................................................................................................................................ 20
Auto leveling mode ............................................................................................................................................................ 20
Peak leveling mode............................................................................................................................................................. 21
RMS leveling mode............................................................................................................................................................. 21
Frozen mode.......................................................................................................................................................................... 22
Detector Zero user calibration ..................................................................................................................................... 22
IQ user calibration .............................................................................................................................................................. 22
Loss compensation............................................................................................................................................................. 22
Manual mode ........................................................................................................................................................................ 23
Generating a CW tone at a given power and frequency................................................................................ 23
®
Generating a waveform in ................................................................................................................... 23
Playing out a waveform at a known power and frequency .......................................................................... 24
Digitizer basics .............................................................................................................................................................. 25
Sample rate ............................................................................................................................................................................ 25
Data IQ resolution .............................................................................................................................................................. 25
Setting the frequency and expected input level ........................................................................................ 26
Data type ................................................................................................................................................................................. 26
Triggering ................................................................................................................................................................................ 26
Software trigger or free run trigger ........................................................................................................................... 26
RF triggered or internal triggered ............................................................................................................................... 27
Trigger delay .......................................................................................................................................................................... 27
PXI routing .............................................................................................................................................................................. 28
External trigger ..................................................................................................................................................................... 29
Capturing IQ........................................................................................................................................................................... 29
3
Checking for ADC overload ........................................................................................................................................... 30
Correcting the signal ......................................................................................................................................................... 30
Aborting the capture ......................................................................................................................................................... 30
Making an analysis library measurement ................................................................................................... 31
Adding a reference to the GSM Analysis Library in Visual Studio ............................................................. 31
Adding a reference and instantiating the GSM analysis library.................................................................. 32
Error handling ........................................................................................................................................................................ 32
Configuring the GSM analysis library ....................................................................................................................... 32
Making a GSM analysis library measurement ...................................................................................................... 32
Retrieving results ................................................................................................................................................................. 33
Useful links ...................................................................................................................................................................... 34
4
Precautions
Anti-virus protection
Your instrument is supplied without anti-virus protection software. We recommend that if you
connect to the internet or accept files from portable media (for example, memory sticks), you install
a proprietary anti-virus software product. Provided that you install the software in accordance with
the manufacturer’s recommendations, your Cobham warranty will not be affected.
Cobham accepts no liability whatsoever for any loss or damage caused by viruses, worms, Trojan
horses or other malicious programs downloaded through connection of the instrument to the
internet or external storage device or portable media
5
Scope
This manual currently limits the scope to exclude Cobham phase 5 modules 3320, 3050A and
3070A, which require a different programming interface.
Getting started
This document provides a programming guide to using PXI 3000 system modules. All example code
fragments are written in the C# language. It is not a complete reference guide; it assumes that you
have installed correctly the PXI modules in a chassis and connected it to the PC. It also assumes that
NI VISA and the PXI module drivers (NI VISA runtime without Measurement and Automation
Explorer is installed as part of the module driver installation) have both been installed. These are
available from the following links.
http://www.ni.com/visa/
http://www.aeroflex.com/ats/products/prodfiles/download.cfm?PFID=9840
A guide to installing PXI modules and module software is available from the following link:
http://www.aeroflex.com/ats/products/prodfiles/opsmanuals/Common_Installation_Guide.pdf
All Cobham software is primarily written to provide C-style windows DLLs. To provide support for
other languages, wrappers for COM and .NET exist see Figure 1. This guide focuses on coding against
the .NET wrapper using C# in a Visual Studio 2008 IDE. Cobham’s .NET wrapper can be used with
.NET 2.0 and above.
6
Getting started
4 From the dialog box that pops up click on the ‘browse’ tab and navigate to and add the
following DLLs. See Figure 3.
7
Getting started
Now add three private member variables to a class to represent each of the three PXI modules.
private afSigGen SigGenObj = null;
private afDigitizer digitizerObj = null;
private afCombiner combinerObj = null;
Now call the individual constructors to instantiate the objects that were defined.
combinerObj = new afCombiner();
SigGenObj = new afSigGen();
digitizerObj = new afDigitizer();
Error handling
A method can be installed for the signal generator, digitizer and combiner that is called when either
an error or warning occurs. In addition, each method call returns an integer error code that can be
looked up to determine the error.
// Turn on and install a method to be called when an error/warning occurs in the digitizer.
digitizerObj.EventOnError.Enable_Set(AfTrue);
digitizerObj.EventOnError.Handler_Set(MyErrorMethodDigitizer,0);
digitizerObj.EventOnWarning.Enable_Set(AfTrue);
digitizerObj.EventOnWarning.Handler_Set(MyWarningMethodDigitizer, 0);
// Turn on and install a method to be called when an error/warning occurs in the Signal
Generator.
SigGenObj.EventOnError.Enable_Set(AfTrue);
SigGenObj.EventOnError.Handler_Set(MyErrorMethodSigGen,0);
SigGenObj.EventOnWarning.Enable_Set(AfTrue);
SigGenObj.EventOnWarning.Handler_Set(MyWarningMethodSigGen,0);
// Turn on and install a method to be called when an error/warning occurs in the combiner.
combinerObj.EventOnError_Set(AfTrue);
combinerObj.EventOnError.Handler_Set(MyErrorMethodCombiner, 0);
combinerObj.EventOnWarning_Set(AfTrue);
combinerObj.EventOnWarning.Handler_Set(MyWarningMethodCombiner, 0);
The method that is called when an error/warning happens is called with a series of parameters that
allow for additional debug information. These are:
HandlerID — A unique module ID that is supplied during the method installation that allows for
different modules of the same type to identified in a system.
Module Type — ENUM describing the module type throwing the error or warning. (this could
include the LO as well as the digitizer module as they are booted together.
Error Code — An error code value.
Error Message — A message describing the error.
private void MyErrorMethodDigitizer(int HandlerId,
afDigitizerDll_mtModuleType_t ModuleType,
int errorCode, string errorMessage)
{
MessageBox.Show ("Handler ID: " + HandlerId.ToString() +
"\nModule Type: " + ModuleType.ToString() +
"\nError Code: " + errorCode.ToString() +
"\nError Message: " + errorMessage);
}
8
Getting started
Note: the warning methods are not shown, but they have the same method prototypes as their corresponding error
methods
Note: the methods above would look the perfect place to put a throw Exception(…) call in but these methods are actually
call backs and are therefore called within the sequence of the module drivers code. Exceptions are swallowed within the
call back, preventing module driver code from exiting incorrectly. Therefore they can be used for additional information
only.
Checking each returned error code and parsing it within a helper method can allow the programmer
to adopt a traditional .NET throw exception, capture exception model.
int errorCode;
errorCode = SigGenObj.BootInstrument(SigGenLOResource, SigGenRFResource, AfFalse);
ErrorCheckSource(errorCode);
9
Getting started
The combiner, signal generator and digitizer each have their own method to look up errors, therefore
three separate helper methods can be used while programming to the Cobham PXI modules.
public void ErrorCheckSource(int errorCode)
{
string messagebuffer = new string(' ', 1024);
10
Booting Cobham PXI modules
Once an object reference for each module has been obtained, the modules need to be booted before
they can be used. Each module in a PXI system has a separate unique address. Cobham makes use of
the VISA layer for communicating to PXI modules and therefore each module has a unique VISA
address. To discover the different module addresses NI’s Measurement and Automation (MAX)
application can be used. See Figure 4.
The 302x Signal Generator series and the 303x Digitizer series require a local oscillator (LO) to
function. These are separate modules within the PXI system, part of the 301x series of local
oscillators, and are also known as RF synthesizers. The 306x Combiner series does not require an LO
to function. When the signal generator or digitizer is booted, the VISA address of the actual module
and that of the LO supplying the tuning frequency is required. From looking at MAX it can be seen
what the different VISA addresses are for each module within the author’s system. Therefore they
are added into the example code as follows.
// Set this to the correct address for your system.
private string SigGenLOAddress = "PXI18::15::INSTR";
private string SigGenAddress = "PXI18::14::INSTR";
private string DigitizerLOAddress = "PXI18::11::INSTR";
private string DigitizerAddress = "PXI18::10::INSTR";
private string CombinerAddress = "PXI19::13::INSTR";
For historic reasons Cobham defines its own version of True and False and therefore for convenience
when programming in c#:
public const int AfTrue = -1;
public const int AfFalse = 0;
EepromCacheEnable
To improve the speed at which the 3020, 3020A, 3025, 3030, 3030A and 3035 PXI modules boot,
an eeprom cache file is stored on the PC and when the ‘<module>.EepromCacheEnable_Set’ method
is set to true, makes use of the cache file. However, the first-time boot is significantly extended.
11
Booting Cobham modules
Checking options
Each module in a PXI system has a series of options that allow HW/SW related features to be enabled
such as LO option 1 — ‘Fast Switching’ or digitizer option 100 — ‘GSM/EDGE’. Each option can be
queried as follows:
int SigGenhasOCXO = AfFalse;
int SigGenhasIQCreator = AfFalse;
12
Booting Cobham modules
The code below checks to see if the LO associated with the signal generator has option 99 fitted
(OCXO). If it does, it uses it to generate the 10 MHZ; if not, it throws an error. The digitizer is then set
to ‘external daisy’ so that it makes use of the externally received 10 MHz reference rather than
generating its own.
// Now setup the Siggen to generate the 10 MHz reference. Using the OCXO option if it's fitted.
errorCode = SigGenObj.LO.Options.CheckFitted(99, ref SigGenhasOCXO);
ErrorCheckSource(errorCode);
if (SigGenhasOCXO != 0)
{
errorCode = SigGenObj.LO.Reference_Set(afSigGenDll_lormReferenceMode_t.afSigGenDll_lormOCXO);
ErrorCheckSource(errorCode);
errorCode =
digitizerObj.LO.Reference_Set(afDigitizerDll_lormReferenceMode_t.afDigitizerDll_lormExternalDaisy);
ErrorCheckDigitizer(errorCode);
}
else
{
throw new ApplicationException("System Not Locked!!");
}
13
Booting Cobham modules
Once the LOs are configured to generate or receive the reference, the signal generator and digitizer
need to be configured to make use of the external reference.
// If we’re using a AF3020, AF3020A or AF3025 Signal Generator then we can also
// set the Voltage-controlled oscillator to be external for improved performance.
errorCode = SigGenObj.VCO.ExternalReference_Set(AfTrue);
ErrorCheckSource(errorCode);
A method that can be used to boot PXI modules, handling different PXI VISA addresses and different
10 MHz references, can be found in the example code that is associated with this manual.
14
Booting Cobham modules
10 MHz termination
The LOs can be configured in such a way so that they can terminate a 10 MHz reference signal.
When this mode is set, the 10 MHz I/O sockets are set to 50 Ω and there is no output to the I/O
socket. As an example, the code to terminate the 10 MHz reference at the LO associated with the
digitizer in the system would be as follows. The physical layout of the system would have the
10 MHz cabled as seen in Figure 6.
// Now set the digitizer to use the external 10MHz reference.
errorCode = digitizerObj.RF.ExternalReference_Set(afDigitizerDll_erExternalReference_t.
afDigitizerDll_lormExternalTerminated);
ErrorCheckDigitizer(errorCode);
Figure 6 Physical cable configuration of the 10 MHz reference terminating on the 3010
associated with 3035C
15
Booting Cobham modules
if (fastswitchingHWoptionfitted == Aeroflex303XConstant.AfTrue)
{
// Fast switching is enabled, therefore LO Speed Synch is not needed and the LO loop
// bandwidth can be set to Normal for best frequency switching times.
status = this.digitizerAf.LoRfSpeedSyncEnable_Set(Aeroflex303XConstant.AfFalse);
ErrorCheckDigitizer(status);
status =
this.digitizerAf.LO.LoopBandwidth_Set(afDigitizerDll_lolbLoopBandwidth_t.afDigitizerDll_lolbNormal)
;
ErrorCheckDigitizer(status);
}
else
{
// Fast switching is disabled, therefore LO Speed Synch needs to be enabled to make sure
// the LO moves in time with the digitizer. Loop bandwidth is set to narrow for better
// phase noise performance.
status = this.digitizerAf.LoRfSpeedSyncEnable_Set(Aeroflex303XConstant.AfTrue);
ErrorCheckDigitizer(status);
status =
this.digitizerAf.LO.LoopBandwidth_Set(afDigitizerDll_lolbLoopBandwidth_t.afDigitizerDll_lolbNarrow)
;
ErrorCheckDigitizer(status);
}
Combiners
A combiner is an RF switch and allows for the DUT to be connected to the signal generator and
digitizer.
Note: if cables are being routed through the combiner it needs to be booted, otherwise large losses in the RF path and in
the signal generated or captured may not be seen.
16
Booting Cobham modules
if (SigGenObj != null)
{
errorCode = SigGenObj.CloseInstrument();
ErrorCheckSource(errorCode);
}
if (combinerObj != null)
{
errorCode = combinerObj.CloseInstrument();
ErrorCheckCombiner(errorCode);
}
17
Signal generator basics
The signal generator has five modes of operation each providing a different way of controlling the
signal generator. The modes are as follows:
• Manual — a simplified interface for the control of the signal generator. This mode provides a
limited number of functions and properties, providing all the basic signal generator
functionality.
• ArbSeq — a form of list mode: The purpose of this mode is to allow the definition of a
sequence of ARB files. The emphasis of this mode is placed on ARB files and the sequence in
which they are played.
• Hopping — a form of list mode: The emphasis of this mode is the control of a frequency and
or level hop/sweep and as such provides the ability to define the dwell duration for each list
point independently of each other. It does not provide channelized ARB file selection or
control.
• GroupSeq — a method of sequencing ARB files. Specifically designed to allow basic power
control of DUTs.
• Full — this is the default and is provided for legacy support. It provides full access to all
channelized and list mode controls. This mode requires comprehensive knowledge and
understanding of the signal generator to achieve the functionality provided by any of the
other modes of operation.
Setting the mode can be achieved as follows:
// Set the Signal Generator Mode to Full.
errorCode = SigGenObj.Mode_Set(afSigGenDll_mMode_t.afSigGenDll_mManual);
ErrorCheckSource(errorCode);
Leveling mode
There are four leveling modes used in the 302x signal generator:
• Auto
• Peak
• RMS
• Frozen
18
Signal generator basics
Date=10/18/2011
Time=09:03:53
FileVers=
Packager=44540/198
PackSWVers=01.21
Samples=301
Title=PowerRamp50kHz
SampleRate=50000
Description=
RMS=4729
RelRMS=-7.78165
CrestFactor= 8.4113
LevelMode=IQDefault
AlcBW=Narrow
SignalBandwidth=0
CW
When a 302x series signal generator
generates a CW signal, the IQ
modulator is set with the values I=1
and Q=1.
Q
Arb file
When an ARB file is created, it
contains multiple IQ pairs. Usually (but
Unit Circle not always), these IQ pairs are such
that the combination of I and Q are
within the ‘Unit Circle’ (where √(I2+Q2)
-1,-1 -1,1 = 1).
19
Signal generator basics
IQ
Modulator
RF
IQ Data ALC Control
ARB File Levelling ALC RF
Control Modulator
Envelope
Detector
The signal generator sets the attenuators as if it were trying to achieve a CW power 7.78165 dB
higher than -10 dBm (i.e. -2.21835 dBm). The RelRMS is the ‘Relative Level of the RMS’ of the IQ data
to the 1,1 point on the IQ square (CW).
The leveling loop is then used to measure the instantaneous power of the ARB file as it is playing.
From the IQ data, it knows the expected power level at the output — it adjusts the ALC modulator to
correct to reach the desired RMS power.
20
Signal generator basics
This ARB file has IQ values so that it produces a rotating vector: it has a constant magnitude of 1
(which is -3 dB from the 1,1 point on the IQ square).
21
Signal generator basics
Frozen mode
In frozen mode, the current settings for the ALC are ‘frozen, based on the current value’ and the ALC
modulator is kept to this fixed value. The step attenuators are also ‘frozen’. The output power varies,
dependent upon the IQ data. Changing the set power level does NOT change the actual output
power level until ‘Frozen Mode’ is exited.
IQ user calibration
Factory calibration of the IQ modulator is used to calculate and store IQ modulator errors that are
used in the 302x to correct the I and Q data to optimize modulation accuracy. IQ user calibration is
also available to give further improvement in performance for the specific conditions of operation
and ensure that guaranteed specifications of carrier leak and image suppression are met. The module
calibrates at the current frequency, or at a range of frequencies, and stores the results so that if you
change frequency and return again, the calibration still applies. During the user calibration process
the 3020 output is disabled. For optimum performance the user calibration should be done following
a period of warm-up, and periodically if the operating temperature is expected to change by more
than 5°C. The following types of user IQ calibration are available:
• Cal All Bands
• Cal Current Frequency
• Cal Selected Bands
// Calibrate All Bands.
errorCode = SigGenObj.Calibrate.IQ.AllBands();
ErrorCheckSource(errorCode);
// Interigate the signal generator to find out the frequency range in Hz of the Band 0
errorCode = SigGenObj.Calibrate.IQ.GetBandInformation(0,ref startfreq,ref stopfreq);
ErrorCheckSource(errorCode);
Loss compensation
No loss compensation exists for the 302x Series module and so any accounting for loss needs to be
manually applied.
22
Signal generator basics
Manual mode
This mode of operation provides a simplified interface for the control of the signal generator. A
limited number of functions and properties is available, providing all the basic signal generator
functionality:
• RF frequency
• RF level
• RF levelling mode
• Modulation — CW, AM, FM and ARB
• ARB control.
// Set the frequency to 890 MHz, the level to -30 and the RF to be on.
errorCode = SignalGeneratorObj.Manual.Frequency_Set(890e6);
ErrorCheckDigitizer(errorCode);
errorCode = SignalGeneratorObj.Manual.Level_Set(-30);
ErrorCheckDigitizer(errorCode);
errorCode = SignalGeneratorObj.Manual.RfState_Set(AfTrue);
ErrorCheckDigitizer(errorCode);
23
Signal generator basics
// Set the frequency to 890 MHz, the level to -30 and the RF to be on.
errorCode = SignalGeneratorObj.Manual.Frequency_Set(890e6);
ErrorCheckSource (errorCode);
errorCode = SignalGeneratorObj.Manual.Level_Set(-30);
ErrorCheckSource (errorCode);
errorCode = SignalGeneratorObj.Manual.RfState_Set(AfTrue);
ErrorCheckSource (errorCode);
Note: take care when loading ARB files to make sure they are not already loaded.
Note: certain actions cannot be performed while a waveform is playing. Changing the ARB file that is to be played out
while it is currently playing out an ARB file results in an error.
The ARB file playback can be stopped using the ‘ArbStopPlaying()’ method and the RF output turned
off using the ‘RfState_Set (…)’ method:
// Stop the AIQ file from being played out.
errorCode = SignalGeneratorObj.Manual.ArbStopPlaying();
ErrorCheckSource(errorCode);
// Turn RF off.
errorCode = SignalGeneratorObj.Manual.RfState_Set(AfFalse);
ErrorCheckSource(errorCode);
24
Digitizer basics
The digitizer captures IQ at a known frequency and input range. The digitizer also supports a complex
list mode whereby IQ can be captured at different frequencies and input power levels in sequence.
Once the IQ has been made available it can be fed into the analysis libraries, and results obtained.
This section describes the basic operation of the digitizer, and includes calculating the GSM-specific
results from the capture of a GSM signal generated from the signal generator using knowledge from
the previous section.
Sample rate
The sample rate is the number of samples the digitizer captures per second. The higher the sample
rate then the larger the amount of data that is produced during a capture. It is important to set the
sample rate high enough so that each symbol within the signal being captured is captured but not
too high such that too much data is produced. The digitizer supports a modulation mode that allows
the sample rate to be configured correctly for a given format. It also supports a ‘generic mode’
whereby the sample rate can be specified manually. This manual makes use of the generic mode as it
gives the greatest freedom.
Note: if the decimation ratio is changed internally the sample rate is changed to match this, but this is not reflected in the
decimations ratios get() method. This is also true when using the sample rates get method if you have set the decimation
value.
errorCode = digitizerObj.Modulation.GenericSamplingFrequency_Set(SampleRate);
ErrorCheckDigitizer(errorCode);
Data IQ resolution
Depending on the sample rate and decimation, the IQ data that has been captured can be transferred
to the controller PC with 16-bit or 32-bit resolution. This affects the time to transfer the data and
therefore should be set appropriately. This can be easily achieved in software using the
Resolution_Set(…) command, which can be configured to Auto whereby the IQ resolution is chosen
based on the decimation ratio and sample rate.
errorCode =
digitizerObj.Capture.IQ.Resolution_Set(afDigitizerDll_32Wrapper.afDigitizerDll_iqrIQResolution_t.
afDigitizerDll_iqrAuto);
ErrorCheckDigitizer(errorCode);
Note: for UMTS, if a sample rate of 30.72 MHz is defined, the module drivers then set the decimation ratio to 2 and the
rules used in the driver set a 32-bit resolution. In this case, a 16-bit resolution would be preferable.
The general rule is 32-bit is available for sampling rates < MaxSamplingRate MHz/8, otherwise 16-bit is used.
25
Digitizer basics
Note: when setting the input level take care to include any headroom for signals with a high peak-to-average ratio as the
digitizer does not have an explicit API call for this.
Data type
The data captured can be set to either IQ or IF using the following method:
errorCode = digitizerObj.Capture.SampleDataType_Set(
afDigitizerDll_sdtSampleDataType_t.afDigitizerDll_sdtIQData);
ErrorCheckDigitizer(errorCode);
A different set of API commands is used to capture and extract IQ or IF samples. This manual
focuses on collecting IQ samples.
Triggering
Cobham PXI provides a number of different triggering techniques. Triggering can be set to ‘free run’,
‘RF triggered’, or ‘externally triggered’. ‘Free run’ or ‘software triggered’ captures immediately once the
capture method is issued. ‘RF triggered’ or ‘internal triggered’ captures only when certain triggering
conditions are met, such as when a rising edge is seen above a threshold level. ‘External triggering’
causes a capture to occur once a TTL signal is seen on a defined external trigger line. It is the task of
the programmer to handle timeout conditions.
errorCode =
digitizerObj.Trigger.SwTriggerMode_Set(afDigitizerDll_swtSwTrigMode_t.afDigitizerDll_swtArmed)
ErrorCheckDigitizer(errorCode);
digitizerObj.Capture.IQ.TriggerArm(TotalDwellSamples)
26
Digitizer basics
errorCode =
digitizerObj.Trigger.Source_Set(afDigitizerDll_tsTrigSource_t.afDigitizerDll_tsINT_TRIG);
ErrorCheckDigitizer(errorCode);
errorCode = digitizerObj.Capture.IQ.TriggerArm(5400);
ErrorCheckDigitizer(errorCode);
sw.Reset();
sw.Start();
do
{
System.Threading.Thread.Sleep(0); // Don’t busy wait.
errorCode = digitizerObj.Capture.IQ.CaptComplete_Get(ref CaptureComplete);
ErrorCheckDigitizer(errorCode);
elapsedTime = sw.ElapsedMilliseconds;
} while (CaptureComplete != AfTrue && (elapsedTime < measTimeout));
Trigger delay
The trigger delay is the number of samples to include before the trigger. Trigger delay is often
expressed in time so the formula below can be used to calculate the number of samples:
Number of samples = sample rate (Hz) x trigger delay (s)
errorCode = digitizerObj.Trigger.PreEdgeTriggerSamples_Set(100); // -92 µs
ErrorCheckDigitizer(errorCode);
27
Digitizer basics
PXI routing
Cobham provides extensive routing capabilities. This is achieved by using the routing SetConnect()
method to connect two lines. One line is the input or where the signal is to be routed from. The other
line is the output, which is where the line is to be routed to. Once the connection has been made the
output needs to be enabled using the SetOutputEnable() method. Connections can be made on the
signal generator or on the digitizer. In the example below the marker 1 bits(input) within the ARB file
are routed onto the PXI_TRIGGER_0 line(output) and then the output enabled.
// Configure the ARB marker 1 to be routed to PXI trigger 0.
errorCode =
SigGenObj.RF.Routing.SetConnect(afSigGenDll_rmRoutingMatrix_t.afSigGenDll_rmPXI_TRIG_0,
afSigGenDll_rmRoutingMatrix_t.afSigGenDll_rmARB_MARKER_1);
ErrorCheckSource(errorCode);
This causes the PXI_TRIGGER_0 line to go high every time the marker 1 bits are set high within an
ARB file.
28
Digitizer basics
External trigger
An external trigger causes the capture to be started whenever the configured trigger line goes high.
The example below routes the marker 1 bits within an ARB file to PXI_TRIGGER_0 and then set
external trigger to be PXI_TRIGGER_0. This causes a capture to take place whenever the ARB file
being played out encounters the marker 1 bits. In the example code the sample waveform GSM-
NORMAL-1SLOT-TSC5.aiq has marker 1 set to high on the first few samples. This causes the capture
to align to the start of the playback and capture the entire frame synchronized to timeslot 0.
using System.Diagnostics;
errorCode =
SigGenObj.RF.Routing.SetOutputEnable(afSigGenDll_rmRoutingMatrix_t.afSigGenDll_rmPXI_TRIG_0,
AfTrue);
ErrorCheckSource(errorCode);
errorCode = digitizerObj.Capture.IQ.TriggerArm(NumberOfIQSamples);
ErrorCheckDigitizer(errorCode);
sw.Reset();
sw.Start();
// Poll until the capture is complete or we’re exceeded our timeout value.
do
{
System.Threading.Thread.Sleep(0); // Don’t busy wait.
errorCode = digitizerObj.Capture.IQ.CaptComplete_Get(ref CaptureComplete);
ErrorCheckDigitizer(errorCode);
elapsedTime = sw.ElapsedMilliseconds;
} while (CaptureComplete != AfTrue && (elapsedTime < measTimeout));
Capturing IQ
Cobham digitizers specify captures in samples. Therefore the number of samples for a given time
period needs to be calculated from the sample rate. Appropriate float arrays can then be defined to
hold the I and Q data.
Number of samples = sample rate(Hz) x capture time (s)
‘<INST>.Capture.IQ.CaptMem(…)’ then instructs the digitizer to capture IQ samples.
double CaptureTime = 0.005; // 5 ms
uint NumberOfIQSamples = (uint)(CaptureTime * SampleRate);
29
Digitizer basics
The CaptMem method blocks until the Idata and Qdata buffers are full or an error occurs.
if (overloaded == AfTrue)
{
throw new ApplicationException("Overloaded");
}
30
Making an analysis library measurement
The analysis libraries take IQ data as input, perform a number of user-defined measurements and
then return the results. Cobham supports a different DLL/library for each format. Some formats also
support loop-back BER and are supported with a different library.
The analysis libraries are installed as part of installing a measurement suite. All measurement suites
can be downloaded from the following location:
http://www.aeroflex.com/ats/products/product/PXI/Application_Software/Measurement_Suites~531
4 From the dialog box that pops up click on the ‘browse’ tab and navigate to and add the
following DLLs. See Figure 8.
31
Making an analysis library measurement
Now add a private member variable to a class to represent the GSM analysis library:
private Gsm GsmObj = null;
Now call the GSM analysis library constructor to instantiate the private member variable GsmObj you
added above:
GsmObj = new Gsm();
Error handling
All Cobham .NET analysis libraries support .NET exceptions and therefore no explicit error checking
needs to be made. All code should be written to handle .NET exceptions though.
AutoAnalysisBurstType sets the analysis library to determine automatically if the burst is a GSM burst
or an EDGE burst, and AutoAnalysisTSC sets the analysis library to detect the training sequence (TSC)
of the analyzed burst rather than use a specific value.
GsmObj.Configuration.SamplingFreq = 1.08e6;
GsmObj.Configuration.AutoAnalysisBurstType = true;
GsmObj.Configuration.AutoAnalysisTSC = true;
32
Making an analysis library measurement
Retrieving results
Once the Analyse method returns, the results are available. No polling is required. Results are
available under the results property from the instantiated analysis library object.
BurstType bursttype;
long powerprofile = 999;
float freqError = 999;
float modError = 999;
float power = 999;
char detectedTsc = 'z';
power = GsmObj.Results.BurstPower;
freqError = GsmObj.Results.FrequencyError;
bursttype = GsmObj.Configuration.BurstType;
modError = GsmObj.Results.ModulationErrorRms;
powerprofile = GsmObj.Results.PowerProfileComplete;
detectedTsc = GsmObj.Results.DetectedTSC;
Note: analysis libraries are not thread-safe so only one thread should call Analyse at any given time. If analysis is to done
concurrently then multiple instances of analysis libraries are required.
33
Useful links
34