Seed Solutions, Inc.
VNAccess (va-nak-sess) is an API (application programming interface) for the N2PK VNA. It encapsulates all of the details concerning the clocking of the chips through the parallel port (printer) interface. It also manages the various timing issues present in setting the DDS chips and reading the ADC. VNAccess calls are made in terms of the hardware registers present in the major integrated circuits.
If you are using the LTC2440 ADC chip, then you need to use VNAccess version 2.00, or greater. Versions under 2.00 were written with the LTC2410 in mind, and communicated with the 2410 in a way which does not work with the 2440. The newer version of VNAccess works with both chips.
VNAccess assumes that it can directly access the parallel I/O port on the computer. On Windows 95, 98, and ME, this is the default mode of operation. On Windows NT, 2000, and XP, the operating system normally disables direct application program access to the hardware as part of the overall security and protection model. On these platforms, direct access to the hardware can be obtained through the use of a driver which selectively turns off the protection mechanism. That driver is not part of VNAccess. We have been using UserPort 1.0, one of the many available packages for enabling direct access.
VNAccess is provided in a DLL (dynamic link library) form. The code has been written so as to minimize dependence upon additional packages, features or software. Although it is written in the C++ language, and was developed using the Microsoft Visual Studio version 6, the library can be used by standard C programs, and other popular languages such as Visual Basic.
VNAccess does not include direct support for the computation of electrical parameters such as reflection coefficient, or impedance. The data returned by VNAccess is the raw input to that next step. The VNAgra API supports those calculations.
The best way to understand what VNAccess provides is to read the documentation, including the header file, which includes example calling sequences. Short of that, here are a few highlights.
Full control of DDS chips: All of the DDS functions can be controlled via VNAccess. This includes setting the frequency via a tuning word, setting the relative phase angle, and setting the power down state. As a result of the electrical schematic, the two DDS chips are clocked, updated, and reset in parallel. VNAccess carefully controls the reset signal so as to maintain the relative phase shifts of the synthesizers even after changes in state. This is necessary to perform reusable sequential quadrature measurements
Full control of the ADC chip: The ADC chip is controlled via VNAccess. Readings normally consist of a 24-bit data word, although it is possible to increase or decrease the number of data bits, following the rules laid out in the ADC data sheet. With version 2.0 of VNAccess, VNAs with variable conversion rate detectors (LTC2440) are supported. Two detectors are also allowed.
Flexible Parallel Port Pin Assignments: The mapping between software function and parallel port I/O pins can be reassigned. This capability allows a single program to work with different hardware configurations. Although there are a large number of possible mappings, the common cases can be conveniently specified. This includes the August 20, 2004 N2PK planned parallel port expansion, and what I call the OZ hardware modification, which provides 4 ADC conversion rates with the LTC2410 chip.
Timing Control: There are a number of operations which have certain timing requirements. Thankfully, the timing requirements are all minimum requirements. Since Windows is not a real-time operating system, it is nearly impossible to guarantee that some task can be completed within some time duration. On the other hand, it is possible to guarantee that a minimum amount of time has elapsed. All of the timing intervals are specified as parameters to VNAccess calls.
Convenient conversion functions: The DDS chips accept a tuning word, which is a way of specifying frequency based upon the master oscillator frequency. VNAccess conversion functions map between frequency and tuning words. The ADC chip data is a number. It can be converted to micro volts with a VNAccess function call that accepts the reference and offset voltage connected to the converter.
Printer reservation: The parallel I/O port is often times used as a printer port. If the VNA port is indeed shared with a printer, the use of the port should be serialized between applications so that a simultaneous access of the printer and VNA is not attempted. VNAccess can be programmed to attempt to open a printer device to determine if the printer port is in use. If it is in use (the device cannot be opened), then VNAccess will report that the VNA is not available.
Support for the DDS power down mode: The DDS power down mode is exposed in the VNAccess interface. The power consumed by the VNA drops by nearly 60 percent if the DDS chips are put in power down mode. This capability may be valuable if the VNA is battery powered. The power down state can be controlled explicitly, or put into an automatic mode where power is shut off after a programmed time interval of inactivity.
Multiple Language Support: VNAccess can be called from C and C++ programs. We have created VNAccess.dll with the intent that it can be called from other languages, such as Visual Basic.
The VNAccess download consists of a single ZIP file (VNAccess.zip). It contains the following files:
VNAccess.dll: The dynamic link library. There are a set
of rules which determine how a program finds the DLLs it uses. In recent years,
the trend has been to put the DLL in the same folder as the program. This
reduces sharing problems (since nothing is shared).
VNAccess.lib: Used by the linker when linking a program
which uses VNAccess.dll. Not necessary if the program is willing to call
LoadLibrary and GetProcAddress explicitly.
VNAccess.h: The declarations of the functions in VNAccess.
Usually included in C/C++ programs that want to use the DLL. Can also be used as
a reference when writing a file of DECLARE declarations for Visual Basic.
VNAccessDoc.htm: The on-line documentation. It can be read with a web browser.
Click to Download VNAccess.zip
Only the most recent version will be available for download. See the Introduction section for information on the most recent version.
Often times, examples are better than documentation. VNAccess.h is heavily commented, and includes a number of common functional sequences based on calls in the library.
The data sheets for the DDS (AD9851) chips and ADC (LTC2410) should be read to understand how those chips function. Both are available at the web sites of the chip makers. VNAs created as part of my March 2004 Group Build (or any VNA after that time that has something to do with W8WWV) will use the LTC2440 chip, which supports a 10 different conversion rates.
VNAccess documentation is written in HTML, and is available from the following link.
If you have problems, questions, or comments (concerning this software), please contact me via email, at ordy@seed-solutions.com.
VNAccess was developed by, and is owned by Seed Solutions, Inc. Copyright ©, 2004, Seed Solutions, Inc. All rights reserved. No warranty of any kind is made as to performance, or fitness of use in any application. Your use of this software is your agreement with these terms. You agree to hold Seed Solutions, Inc. free from responsibility for any damages that may or may not be associated with the installation or operation of the program.
This software may be redistributed in original form. No fee may be charged for redistribution without the prior and specific written consent of Seed Solutions. Inc. This software is licensed for personal and non-commercial use only, and is subject to the export laws and regulations as defined by the State Department of the United States of America, and other applicable regulatory agencies.
Windows, Windows 95, Windows 98, Windows NT, Windows 2000, Windows ME, Windows XP are either registered trademarks or trademarks of Microsoft Corporation. Other product and company names mentioned on this site may be the trademarks of their respective owners.
Back to my Software Contributions Page
Back to my Experimentation Page