Tektronix RSA7100A Programmer's Manual

Page 1
x
RSA7100A Real-Time Spectrum Analyzer Application Programming Interface (API)
ZZZ
Programmer Manual
*P077149600*
077-1496-00
Page 2
Page 3
xx
ZZZ
Programmer Manual
www.tek.com
077-1496-00
Page 4
Copyright © Tektronix. All rights reserved. Licensed software products are owned by Tektronix or its subsidiaries or suppliers, and are protected by na
tional copyright laws and international treaty provisions.
Tektronix pro previously published material. Specications and price change privileges reserved.
TEKTRONIX and TEK are registered trademarks of Tektronix, Inc.
ducts are covered by U.S. and foreign patents, issued and pending. Information in this publication supersedes that in all
Contacting Tektronix
Tektronix, Inc. 14150 SW Karl Braun Drive P.O. Box 500 Beaverton, OR 97077 USA
For product information, sales, service, and technical support:
In North America, call 1-800-833-9200. Worldwide, visit www.tek.com to nd contacts in your area.
Page 5
Table of Contents
Preface ................................................................................................................................. ii
Function cal
Index
ls .......................................................................................................................... 1
Table of Content
s
DRAFT—23 August 2018
RSA7100A API Programmer Manual i
Page 6
Preface
Preface
In the typical API scenario, the custom user program calls functions from the API to fetch data. This is known as a “pull” model. The user’s program must “pull” the data from the instrument. T his is not the case with the RSA7100A IQFlow™ streaming API.
The RSA7100A IQFlow™ streaming API uses a “push” model to “push” the data to the user ’s code by calling user supplied callback functions. These callback functions have immediate access the latest acquired data and can then use it however the user has programmed.
IQ data is structured as an array of 16-bit signed integer pairs and needs to be scaled by multiplying it with a scaling factor. The AuxData structure returned by the USERDATA_GetAuxData() function contains this scaling factor.
ii RSA7100A API Programmer Manual
DRAFT—23 August 201 8
Page 7
Function calls
dataCallbackFxn Type denition for the user’s data callback function. Called automatically by
Declaration:
Parameters:
data
size
startofBlockSample size_t sample number of the rst sample in the IQ data block.
streamOverload bool. True indicates an IQ data block was missed. False indicates no skipped
sampleRate
centerFreq
triggerCallbackFxn Type denition for the user’s trigger callback function. Called automatically by
Declaration:
Parameters:
Triggersample
Function calls
the API when new data is available.
dataCallbackFxn(IQDataPtr data, size_t size, size_t startOfBlockSample, bool streamOverload, double sampleRate, double centerFreq);
IQDataPtr structure. Provides the IQ pair data block.
size_t of the IQ pair data block.
IQ data block.
double of the sample rate for the current acquisition.
double of the center frequency for the current acquisition.
the API when the RSA is triggered.
triggerCallbackFxn(size_t triggerSample);
size_t of the sample number for the current trigger event.
USERDATA_Connect() Connects the user’s callback functions to the IQFlow™ streaming API.
Declaration:
Parameters:
dataSize size_t passed by reference. Sets the buffer size of the IQ pair data block. This
dCbFxn dataCallbackFxn. Sets the user supplied callback function to be called by the
tCbFxn triggerCallbackFxn. Sets the user supplied callback function to be called by the
Return values:
noError
errorBufferTooSmall The buffer size specied is too small.
errorBufferTooLarge The buffer size specied is too large.
USERDATA_Disconnect() Disconnects the user’s callback functions from the SignalVu-PC streaming API.
Declaration:
Return values:
noError
ReturnStatus USERDATA_Connect(size_t &dataSize, dataCallbackFxn dCbFxn, triggerCallbackFxn tCbFxn);
value is bound between 2
API each time a new data block is available. Can be set to null if real-time IQ data is not required.
API each time a trigger event occurs. Can be set to null if trigger timestamp is not required.
The function completed successfully.
USERDATA_Disconnect();
The function completed successfully.
21
to 228.
DRAFT—23 August 2018
RSA7100A API Programmer Manual 1
Page 8
Function calls
USERDATA_GetA
Declaration:
Parameters:
AuxData structure de ned as follows:
Float version
bool skippedFrame:
bool adcOv
bool refFr
bool ifPo
bool ifP
bool dma
bool gpsStatus; True indicates GPS is on. False indicates GPS is off.
doubl
doubl
doub
bool validTimeRef;
uin
uint64_t nSeconds; Nanosecond resolution of current IQ data block.
uint64_t timestamp;
int64_t timeRefTimestamp;
u
double sampleRate;
double cf; Returns the center frequency of the current
double scalingFactor;
Return Values:
noError:
errorInvalidShared­Memory:
errorTimedOut: The function timed out.
errorNotConnected: The function had no valid connection to SignalVu-PC.
Additional Detail:
uxData()
errange:
eqUnlock:
werOverloadStartAcq;
owerOverloadRuntime;
Overow;
e gpsLat;
e gpsLong;
le gpsAlt;
t64_t seconds;
Fetches a data s
ReturnStatus
tructure containing metadata for the acquired data.
USERDATA_GetAuxData(AuxData &auxData);
Version of structure
True indicates a skipped frame. False indicates no skipped fra
me.
True indicates adc over range occurred. False indicates
no adc overrange.
IF power overload occurred during instrument
zation.
initiali
IF power overload occurred during run time.
True ind
icates dma overow occurred. False
indicates no dma overow.
Returns GPS latitude if GPS status is true.
Returns GPS longitude if GPS status is true.
Returns GPS altitude if GPS status is true.
source used is valid.
Time
Returns time of IQ data block in seconds (based off posix time) if GPS status is true.
Returns the timestamp of the rst IQ pair in data
ock.
bl
eturns the current time reference source timestamp
R associated with time.
Returns the sample rate of the current acquisition.
acquisition.
Returns the scaling factor for the IQ data. Multiply the signed 16-bit integer values by this to scale the data factor.
The function completed successfully.
No data found in auxiliary data.
GFRM_OFF (0) is returned when GNSS source is not selected.
2 RSA7100A API Programmer Manual
DRAFT—23 August 201 8
Page 9
Function calls
USERDATA_GetD
Declaration:
ata ()
Fetches the lat
ReturnStatus
est IQ data using a traditional pull method.
USERDATA_GetData(IQDataPtr data, size_t size, size_t &startofBlockSample, bool &streamOverload, double &sampleRate, double ¢erFreq);
Parameters:
data
size
IQDataPtr structure. Provides the IQ pair data block.
size_t of the number of samples in the IQ pair data block.
startofBlockSample size_t sample number of the rst sample in IQ data block.
streamOverload bool. True indicates an IQ data block was missed. False indicates no skipped
IQ data block.
sampleRate
centerFreq
double of the sample rate for the current acquisition.
double of the center frequency for the current acquisition.
Return values:
noError
The function completed successfully.
errorBufferTooSmall The buffer size specied is too small.
errorBufferTooLarge The buffer size specied is too large.
USERDATA_FindData () Searches for the sample number passed to it in the API’s local circular buffer
turns a data set containing the requested sample, if it can be found.
and re
Declaration:
rnStatus USERDATA_FindData(IQDataPtr data, size_t size, size_t
Retu ndSample, size_t &startofBlockSample, bool &sreamOverlaod, double &sampleRate, double ¢erFreq);
Parameters:
a
dat
e
siz
ndSample
IQDataPtr structure. Provides the IQ pair data block.
size_t of the number of samples in the IQ pair data block. —
startofBlockSample size_t sample number of the rst sample in the IQ data block.
streamOverload bool. True indicates an IQ data block was missed. False indicates no skipped
IQ data block.
sampleRate
centerFreq
double of the sample rate for the current acquisition.
double of the center frequency for the current acquisition.
Return values:
noError
The function completed successfully.
errorInvalidSize The function parameter size is 0.
errorInvalidDataRate
The function parameter sampleRate is 0 or negative.
errorStaleTrigger The function failed to acquire the trigger since the data has already passed.
errorTimedOut The function timed out while looking for a trigger.
unknownError
The function received an unknown error.
DRAFT—23 August 2018
RSA7100A A PI Programmer Manual 3
Page 10
Function calls
4 RSA7100A API Programmer Manual
DRAFT—23 August 201 8
Page 11
Index
Index
C
Connect, 1
D
Data structure
fetch, 2
Data type denition, 1 Disconnect, 1
F
Fetch data, Fetch data structure, 2
3
Find data, 3
T
Trigger type denition, 1
DRAFT—23 August 2018
RSA7100A A PI Programmer Manual 5
Loading...