// The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the VNAGRA_EXPORTS // symbol defined on the command line. this symbol should not be defined on any project // that uses this DLL. This way any other project whose source files include this file see // VNAGRA_API functions as being imported from a DLL, wheras this DLL sees symbols // defined with this macro as being exported. #ifdef VNAGRA_EXPORTS #define VNAGRA_API __declspec(dllexport) #else #define VNAGRA_API __declspec(dllimport) #endif // // Version Info. // Return format is (Major * 100 + Minor) - 102 means Version 1.02, e.g. // VNAGRA_API int _stdcall VNAgraVersion (); // // Compute One-Port Calibration method error terms from three independent measurements of calibration standards. // // These three error terms are then used by VNAgraComputeActualReflectionCoefficient() to turn the measurement // of an unknown into an actual reflection coefficient. // // (ReM1, ImM1) is the measured reflection coefficient for the first calibration standard. // (ReA1, ImA1) is the actual reflection coefficient for the first calibration standard. // (ReM2, ImM2) is the measured reflection coefficient for the second calibration standard. // (ReA2, ImA2) is the actual reflection coefficient for the second calibration standard. // (ReM3, ImM3) is the measured reflection coefficient for the third calibration standard. // (ReA3, ImA3) is the actual reflection coefficient for the third calibration standard. // VNAGRA_API BOOL _stdcall VNAgraComputeOnePortCalibrationErrorTerms (double ReM1, double ImM1, double ReA1, double ImA1, double ReM2, double ImM2, double ReA2, double ImA2, double ReM3, double ImM3, double ReA3, double ImA3, double *pRee00, double *pIme00, double *pRee11, double *pIme11, double *pReDeltae, double *pImDeltae); // // Computes an actual reflection coefficient from a measured reflection coefficient and error terms. // VNAGRA_API BOOL _stdcall VNAgraComputeActualReflectionCoefficient (double ReRhoM, double ImRhoM, double Ree00, double Ime00, double Ree11, double Ime11, double ReDeltae, double ImDeltae, double *pReRhoA, double *pImRhoA); // // Computes a complex impedance (Zx) from an actual reflection coefficient (RhoA) and a base impedance (Z0 - usually 50+0i). // VNAGRA_API BOOL _stdcall VNAgraComputeComplexImpedance (double ReRhoA, double ImRhoA, double ReZ0, double ImZ0, double *pReZx, double *pImZx); // // Computes capacitance (or inductance) from a complex impedance and frequency // VNAGRA_API BOOL _stdcall VNAgraComputeCapacitance (double ImZx, double Freq, double *pCap); VNAGRA_API BOOL _stdcall VNAgraComputeInductance (double ImZx, double Freq, double *pInd); // // Compute series from parallel. // VNAGRA_API BOOL _stdcall VNAgraComputeSeriesFromParallel (double Rp, double Xp, double *pRs, double *pXs); // // Compute parallel from series. // VNAGRA_API BOOL _stdcall VNAgraComputeParallelFromSeries (double Rs, double Xs, double *pRp, double *pXp); // // Computes Q from a complex impedance. // VNAGRA_API BOOL _stdcall VNAgraComputeQ (double ReZx, double ImZx, double *pQ); // // Computes SWR (or Return Loss [RL]) given a reflection coefficient. // VNAGRA_API BOOL _stdcall VNAgraComputeSWR (double ReRho, double ImRho, double *pSWR); VNAGRA_API BOOL _stdcall VNAgraComputeRL (double ReRho, double ImRho, double *pRL); // // Polar-to-Rectangular conversion, and vice-versa. // Angles are expressed in Radians. // VNAGRA_API BOOL _stdcall VNAgraPToR (double Mag, double Angle, double *pRe, double *pIm); VNAGRA_API BOOL _stdcall VNAgraRToP (double Re, double Im, double *pMag, double *pAngle); // Degrees-to-Radians conversion, and vice-versa. VNAGRA_API BOOL _stdcall VNAgraDToR (double Degrees, double *pRadians); VNAGRA_API BOOL _stdcall VNAgraRToD (double Radians, double *pDegrees); // // Adjusts an "ideal" reflection coefficient. // (ReRhoIdeal, ImRhoIdeal) The ideal reflection coefficient // R Series resistance (in Ohms) // L Series inductance (in nanohenrys) // C Shunt capacitance (in picofarads) // Freq Frequency (in Hz) // (ReZ0, ImZ0) base impedance (usually (50, 0)) // VNAGRA_API BOOL _stdcall VNAgraAdjustIdealReflectionCoefficient (double ReRhoIdeal, double ImRhoIdeal, double R, double L, double C, double Freq, double ReZ0, double ImZ0, double *pReRho, double *pImRho);