1 #ifndef __AKELA_VNA_DLL_H
2 #define __AKELA_VNA_DLL_H
47 #pragma message ("Building with dllexport")
48 #define VNADLL_API __declspec(dllexport)
50 #pragma message ("Building with dllimport")
51 #define VNADLL_API __declspec(dllimport)
56 #define __attribute__((visibility("default")))
91 extern VNADLL_API
int ERR_OK;
92 extern VNADLL_API
int ERR_BAD_ATTEN;
93 extern VNADLL_API
int ERR_BAD_CAL;
94 extern VNADLL_API
int ERR_BAD_HANDLE;
95 extern VNADLL_API
int ERR_BAD_HOP;
96 extern VNADLL_API
int ERR_BAD_PATH;
99 extern VNADLL_API
int ERR_FREQ_OUT_OF_BOUNDS;
100 extern VNADLL_API
int ERR_INTERRUPTED;
101 extern VNADLL_API
int ERR_NO_RESPONSE;
102 extern VNADLL_API
int ERR_MISSING_IP;
103 extern VNADLL_API
int ERR_MISSING_PORT;
104 extern VNADLL_API
int ERR_MISSING_HOP;
105 extern VNADLL_API
int ERR_MISSING_ATTEN;
106 extern VNADLL_API
int ERR_MISSING_FREQS;
107 extern VNADLL_API
int ERR_PROG_OVERFLOW;
108 extern VNADLL_API
int ERR_SOCKET;
109 extern VNADLL_API
int ERR_TOO_MANY_POINTS;
110 extern VNADLL_API
int ERR_WRONG_STATE;
111 extern VNADLL_API
int ERR_EMPTY_PROM;
112 extern VNADLL_API
int ERR_PATH_ALREADY_MEASURED;
113 extern VNADLL_API
int ERR_NO_PATHS_MEASURED;
114 extern VNADLL_API
int ERR_NO_ATTEN_PRESENT;
115 extern VNADLL_API
int ERR_PROG_TYPE;
141 extern VNADLL_API HopRate
HOP_45K;
142 extern VNADLL_API HopRate
HOP_30K;
143 extern VNADLL_API HopRate
HOP_15K;
144 extern VNADLL_API HopRate
HOP_7K;
145 extern VNADLL_API HopRate
HOP_3K;
146 extern VNADLL_API HopRate
HOP_2K;
147 extern VNADLL_API HopRate
HOP_1K;
148 extern VNADLL_API HopRate
HOP_550;
149 extern VNADLL_API HopRate
HOP_312;
150 extern VNADLL_API HopRate
HOP_156;
151 extern VNADLL_API HopRate
HOP_78;
152 extern VNADLL_API HopRate
HOP_39;
153 extern VNADLL_API HopRate
HOP_20;
169 extern VNADLL_API Attenuation
ATTEN_0;
170 extern VNADLL_API Attenuation
ATTEN_1;
171 extern VNADLL_API Attenuation
ATTEN_2;
172 extern VNADLL_API Attenuation
ATTEN_3;
173 extern VNADLL_API Attenuation
ATTEN_4;
174 extern VNADLL_API Attenuation
ATTEN_5;
175 extern VNADLL_API Attenuation
ATTEN_6;
176 extern VNADLL_API Attenuation
ATTEN_7;
177 extern VNADLL_API Attenuation
ATTEN_8;
178 extern VNADLL_API Attenuation
ATTEN_9;
179 extern VNADLL_API Attenuation
ATTEN_10;
180 extern VNADLL_API Attenuation
ATTEN_11;
181 extern VNADLL_API Attenuation
ATTEN_12;
182 extern VNADLL_API Attenuation
ATTEN_13;
183 extern VNADLL_API Attenuation
ATTEN_14;
184 extern VNADLL_API Attenuation
ATTEN_15;
185 extern VNADLL_API Attenuation
ATTEN_16;
186 extern VNADLL_API Attenuation
ATTEN_17;
187 extern VNADLL_API Attenuation
ATTEN_18;
188 extern VNADLL_API Attenuation
ATTEN_19;
189 extern VNADLL_API Attenuation
ATTEN_20;
190 extern VNADLL_API Attenuation
ATTEN_21;
191 extern VNADLL_API Attenuation
ATTEN_22;
192 extern VNADLL_API Attenuation
ATTEN_23;
193 extern VNADLL_API Attenuation
ATTEN_24;
194 extern VNADLL_API Attenuation
ATTEN_25;
195 extern VNADLL_API Attenuation
ATTEN_26;
196 extern VNADLL_API Attenuation
ATTEN_27;
197 extern VNADLL_API Attenuation
ATTEN_28;
198 extern VNADLL_API Attenuation
ATTEN_29;
199 extern VNADLL_API Attenuation
ATTEN_30;
200 extern VNADLL_API Attenuation
ATTEN_31;
234 extern VNADLL_API CalibrationStep
STEP_THRU;
258 int band_boundaries[8];
378 VNADLL_API ErrCode
start(TaskHandle t);
388 VNADLL_API ErrCode
stop(TaskHandle t);
405 VNADLL_API ErrCode
setIPAddress(TaskHandle t,
const char* ipv4);
419 VNADLL_API ErrCode
setIPPort(TaskHandle t,
const int port);
437 VNADLL_API ErrCode
setTimeout(TaskHandle t,
const unsigned int timeout);
450 VNADLL_API ErrCode
setHopRate(TaskHandle t,
const HopRate rate);
463 VNADLL_API ErrCode
setAttenuation(TaskHandle t,
const Attenuation atten);
487 VNADLL_API ErrCode
setFrequencies(TaskHandle t,
const double* freqs,
const unsigned int N);
496 VNADLL_API TaskState
getState(TaskHandle t);
505 VNADLL_API
unsigned int getTimeout(TaskHandle t);
630 VNADLL_API ErrCode
utilFixLinearSweepLimits(TaskHandle t,
double& startFreq,
double& endFreq,
const unsigned int N);
675 VNADLL_API ErrCode
utilGenerateLinearSweep(TaskHandle t,
const double startFreq,
const double endFreq,
const unsigned int N);
908 const unsigned int N,
Attenuation getAttenuation(TaskHandle t)
Get the attenuation associated with this Task object. If no rate has yet been set, this function returns ATTEN_UNDEFINED.
Attenuation ATTEN_0
Attenuation value of 0 dB.
Definition: vnalibrary.py:313
int ErrCode
Definition: akela_vna_dll.h:90
Attenuation ATTEN_28
Attenuation value of 28 dB.
Definition: vnalibrary.py:341
Attenuation ATTEN_4
Attenuation value of 4 dB.
Definition: vnalibrary.py:317
HopRate HOP_30K
Hop rate of 30K points/second.
Definition: vnalibrary.py:260
const char * getIPAddress(TaskHandle t)
Get the current AVMU IP address for the Task object. When no IP has yet been set, this will return a ...
bool(* progress_callback)(int progressPercent, void *user)
This is the method signature for the callback function passed to the initialize() function...
Definition: akela_vna_dll.h:306
ErrCode setFrequencies(TaskHandle t, const double *freqs, const unsigned int N)
Set the frequencies to measure during each sweep. Units are MHz. The freqs parameter is an array of l...
int minimum_frequency
Definition: akela_vna_dll.h:247
Attenuation ATTEN_14
Attenuation value of 14 dB.
Definition: vnalibrary.py:327
Attenuation ATTEN_31
Attenuation value of 31 dB.
Definition: vnalibrary.py:344
Attenuation ATTEN_25
Attenuation value of 25 dB.
Definition: vnalibrary.py:338
TaskState getState(TaskHandle t)
Get the current state of the Task object. Returns one of the values defined above.
CalibrationStep STEP_P1_OPEN
Calibration step for measuring a open on port 1.
Definition: vnalibrary.py:510
Attenuation ATTEN_21
Attenuation value of 21 dB.
Definition: vnalibrary.py:334
CalibrationStep STEP_P2_SHORT
Calibration step for measuring a short on port 2.
Definition: vnalibrary.py:514
ErrCode importFactoryCalibration(TaskHandle t)
Load the factory calibration from the VNA into the current task.
const double * getCalibrationFrequencies(TaskHandle t)
Get a pointer to the list of frequencies used in the calibration data. This pointer becomes invalid a...
ErrCode setHopRate(TaskHandle t, const HopRate rate)
Set the frequency hopping rate. See the values defined in the "HopRate" type above.
Attenuation ATTEN_UNDEFINED
Attenuation value not set.
Definition: vnalibrary.py:312
HopRate HOP_550
Hop rate of 550 points/second.
Definition: vnalibrary.py:266
Attenuation ATTEN_8
Attenuation value of 8 dB.
Definition: vnalibrary.py:321
ErrCode setTimeout(TaskHandle t, const unsigned int timeout)
Sets the default time to wait, in milliseconds, for a unit to reply to a command before giving up and...
int TaskState
Definition: akela_vna_dll.h:213
const double * getFrequencies(TaskHandle t)
Get a list containing the actual frequencies the hardware will sample for the configured sweep in tas...
Attenuation ATTEN_19
Attenuation value of 19 dB.
Definition: vnalibrary.py:332
ErrCode setIPAddress(TaskHandle t, const char *ipv4)
Sets the IPv4 address on which to communicate with the unit. The ipv4 parameter is copied into the Ta...
Definition: akela_vna_dll.h:269
ErrCode utilNearestLegalFreq(TaskHandle t, double &freq)
Adjusts a requested frequency, in MHz, to the nearest able to be generated by the VNA hardware...
TaskState TASK_STOPPED
Task state of stopped.
Definition: vnalibrary.py:404
HopRate HOP_78
Hop rate of 78 points/second.
Definition: vnalibrary.py:269
TaskState TASK_STARTED
Task state of started.
Definition: vnalibrary.py:405
int number_of_band_boundaries
Definition: akela_vna_dll.h:260
const char * versionString()
Returns a string describing the version of the DLL and its components.
Definition: vnalibrary.py:741
bool haveCalThru(TaskHandle t)
HopRate HOP_2K
Hop rate of 2K points/second.
Definition: vnalibrary.py:264
Attenuation ATTEN_6
Attenuation value of 6 dB.
Definition: vnalibrary.py:319
int CalibrationStep
Definition: akela_vna_dll.h:227
CalibrationStep STEP_P1_SHORT
Calibration step for measuring a short on port 1.
Definition: vnalibrary.py:511
ErrCode stop(TaskHandle t)
Puts the Task object into the TASK_STOPPED state.
int ERR_BAD_PROM
Error code indicating that the VNA PROM was not in a known format. Please contact support if this is ...
Definition: akela_vna_dll.h:119
Attenuation ATTEN_22
Attenuation value of 22 dB.
Definition: vnalibrary.py:335
CalibrationStep STEP_P2_LOAD
Calibration step for measuring a load on port 2.
Definition: vnalibrary.py:515
ErrCode setAttenuation(TaskHandle t, const Attenuation atten)
Set the attenuation amount. See the values defined above.
Attenuation ATTEN_27
Attenuation value of 27 dB.
Definition: vnalibrary.py:340
HopRate HOP_3K
Hop rate of 3K points/second.
Definition: vnalibrary.py:263
int Attenuation
Definition: akela_vna_dll.h:167
ErrCode clearCalibration(TaskHandle t)
Delete any calibration data stored in the Task t.
Attenuation ATTEN_1
Attenuation value of 1 dB.
Definition: vnalibrary.py:314
Attenuation ATTEN_15
Attenuation value of 15 dB.
Definition: vnalibrary.py:328
Attenuation ATTEN_12
Attenuation value of 12 dB.
Definition: vnalibrary.py:325
int ERR_BYTES
Error code indicating the DLL has received an incorrect number of bytes from the VNA. Possibly indicative of a network issue.
Definition: akela_vna_dll.h:121
Attenuation ATTEN_10
Attenuation value of 10 dB.
Definition: vnalibrary.py:323
HopRate HOP_1K
Hop rate of 1K points/second.
Definition: vnalibrary.py:265
unsigned int getCalibrationNumberOfFrequencies(TaskHandle t)
Get the number of frequencies in the calibration data.
void deleteTask(TaskHandle t)
Deletes the Task object. If the caller does not do this, the handle memory will leak.
HopRate HOP_156
Hop rate of 156 points/second.
Definition: vnalibrary.py:268
Attenuation ATTEN_5
Attenuation value of 5 dB.
Definition: vnalibrary.py:318
ErrCode measure2PortCalibrated(TaskHandle t, ComplexData S11, ComplexData S21, ComplexData S12, ComplexData S22)
Measures the S-parameter(s) of your choice, applying the current calibration. Only paths specified by...
int getIPPort(TaskHandle t)
Get the current port for IP communications. When uninitialized, this will default to 0...
int HopRate
Definition: akela_vna_dll.h:137
ErrCode interruptMeasurement(TaskHandle t)
Interrupts one of the measurement functions while it is waiting for data. Since the measurement funct...
ErrCode measureCalibrationStep(TaskHandle t, CalibrationStep step)
Measures the paths necessary to get data for the requested calibration step. Note that this function ...
HopRate HOP_15K
Hop rate of 15K points/second.
Definition: vnalibrary.py:261
TaskHandle createTask()
Creates a new Task object and returns a handle to it. This handle is required by all of the other API...
int maximum_points
Definition: akela_vna_dll.h:251
bool haveCalP1Load(TaskHandle t)
Attenuation ATTEN_7
Attenuation value of 7 dB.
Definition: vnalibrary.py:320
CalibrationStep STEP_P2_OPEN
Calibration step for measuring a open on port 2.
Definition: vnalibrary.py:513
HopRate HOP_20
Hop rate of 20 points/second.
Definition: vnalibrary.py:271
ErrCode importCalibration(TaskHandle t, const double *freqs, const unsigned int N, const ComplexData e00, const ComplexData e11, const ComplexData e10e01, const ComplexData e30, const ComplexData e22, const ComplexData e10e32, const ComplexData ep33, const ComplexData ep22, const ComplexData ep23ep32, const ComplexData ep03, const ComplexData ep11, const ComplexData ep23ep01)
Imports calibration coefficients from caller-allocated arrays. Note that these frequencies do not hav...
ErrCode setIPPort(TaskHandle t, const int port)
Sets the port on which to communicate with the unit. In general, ports >= 1024 should be used...
int serial_number
Definition: akela_vna_dll.h:253
Attenuation ATTEN_18
Attenuation value of 18 dB.
Definition: vnalibrary.py:331
bool hasFactoryCalibration(TaskHandle t)
Determine of the VNA has a factory calibration stored in it's onboard EEPROM.
ErrCode utilPingUnit(TaskHandle t)
Sends an "are you there" message to the unit. Note that this function should not be called while a fr...
Attenuation ATTEN_9
Attenuation value of 9 dB.
Definition: vnalibrary.py:322
CalibrationStep STEP_THRU
Calibration step for measuring a through from port 1 - port 2.
Definition: vnalibrary.py:516
Attenuation ATTEN_16
Attenuation value of 16 dB.
Definition: vnalibrary.py:329
Attenuation ATTEN_17
Attenuation value of 17 dB.
Definition: vnalibrary.py:330
HopRate getHopRate(TaskHandle t)
Get the frequency hopping rate associated with this Task object. If no rate has yet been set...
bool haveCalP2Short(TaskHandle t)
HardwareDetails getHardwareDetails(TaskHandle t)
Get the hardware details for the unit associated with Task t. If the Task has not yet been initialize...
ErrCode utilGenerateLinearSweep(TaskHandle t, const double startFreq, const double endFreq, const unsigned int N)
Generates a linear sweep with the requested parameters. Note that the start and end frequency will be...
ErrCode exportCalibration(TaskHandle t, ComplexData e00, ComplexData e11, ComplexData e10e01, ComplexData e30, ComplexData e22, ComplexData e10e32, ComplexData ep33, ComplexData ep22, ComplexData ep23ep32, ComplexData ep03, ComplexData ep11, ComplexData ep23ep01)
Copies out the calibration coefficients to caller-allocated arrays. Note that to fully contain a cali...
Definition: akela_vna_dll.h:244
HopRate HOP_7K
Hop rate of 7K points/second.
Definition: vnalibrary.py:262
HopRate HOP_45K
Hop rate of 45K points/second.
Definition: vnalibrary.py:259
bool haveCalP2Open(TaskHandle t)
ErrCode utilFixLinearSweepLimits(TaskHandle t, double &startFreq, double &endFreq, const unsigned int N)
Adjusts the start and end of a requested linear sweep with N points such that all frequencies in the ...
Attenuation ATTEN_20
Attenuation value of 20 dB.
Definition: vnalibrary.py:333
unsigned int getNumberOfFrequencies(TaskHandle t)
Get the number of frequency points for the sweep configured for Task t. If no frequencies have been s...
ErrCode start(TaskHandle t)
Attempts to program the VNA using the settings stored in the Task object. If it succeeds the Task ent...
unsigned int getTimeout(TaskHandle t)
Get the current time to wait for the unit to reply to commands. When a Task is first created...
ErrCode measureUncalibrated(TaskHandle t, ComplexData T1R1, ComplexData T1R2, ComplexData T2R1, ComplexData T2R2, ComplexData Ref)
Measures the path(s) of your choice through the VNA, without applying calibration. The reference path is always measured. The ComplexData parameters are objects that contain pointers to data arrays that the caller has allocated. This function copies the returned data into those arrays, so they must have a minimum length of getNumberOfFrequencies(). Note that this function blocks while the measurement is being performed. Use the interruptMeasurement() function to prematurely halt a slow measurement. The automatic timeout value is the length of the measurement plus getTimeout(). Note that it is safe to supply null pointers.
TaskState TASK_UNINITIALIZED
Task state of uninitialized.
Definition: vnalibrary.py:403
Attenuation ATTEN_3
Attenuation value of 3 dB.
Definition: vnalibrary.py:316
Attenuation ATTEN_26
Attenuation value of 26 dB.
Definition: vnalibrary.py:339
Attenuation ATTEN_11
Attenuation value of 11 dB.
Definition: vnalibrary.py:324
Attenuation ATTEN_24
Attenuation value of 24 dB.
Definition: vnalibrary.py:337
ErrCode initialize(TaskHandle t, progress_callback callback=0, void *user=0)
Attempts to talk to the unit specified by the Task's IP address, and download its details...
Attenuation ATTEN_2
Attenuation value of 2 dB.
Definition: vnalibrary.py:315
double * Q
Definition: akela_vna_dll.h:274
Attenuation ATTEN_30
Attenuation value of 30 dB.
Definition: vnalibrary.py:343
bool haveCalP1Short(TaskHandle t)
Attenuation ATTEN_13
Attenuation value of 13 dB.
Definition: vnalibrary.py:326
int maximum_frequency
Definition: akela_vna_dll.h:249
HopRate HOP_39
Hop rate of 39 points/second.
Definition: vnalibrary.py:270
bool haveCalP2Load(TaskHandle t)
Attenuation ATTEN_23
Attenuation value of 23 dB.
Definition: vnalibrary.py:336
struct task_t * TaskHandle
Opaque type for containing the parameters and associated resources for interfacing with a single VNA...
Definition: akela_vna_dll.h:80
bool isCalibrationComplete(TaskHandle t)
Query if calibration parameters are present in the task.
HopRate HOP_312
Hop rate of 312 points/second.
Definition: vnalibrary.py:267
CalibrationStep STEP_P1_LOAD
Calibration step for measuring a load on port 1.
Definition: vnalibrary.py:512
double * I
Definition: akela_vna_dll.h:272
HopRate HOP_UNDEFINED
Hop rate not set yet.
Definition: vnalibrary.py:257
Attenuation ATTEN_29
Attenuation value of 29 dB.
Definition: vnalibrary.py:342
bool haveCalP1Open(TaskHandle t)