I am trying to write an application to control my APx500 audio analyzer using the Agilent Vee programming language. I am able to control a limited number of functions such as making the APx application visible and turning the signal monitors on and off. However, most of the .NET objects listed in your API Browser application are not available in Vee.
We investigated this issue and it appears that the problem is a result of the way that Agilent has implemented support for the Microsoft .NET framework in Vee. The APx500 API is implemented with extensive use of .NET interfaces. Although Vee makes these interfaces visible, it appears that Vee only enumerates a small subset of the properties and methods that are included in them. As a result, only a fraction of the properties and methods available in the APx500 API are directly accessible in Vee.
To overcome this problem, AP software engineers have created what is called a “Class wrapper”. It’s a software application called a dynamic link library (DLL) that wraps the APx500’s API interfaces in a Class implementation, so that all the API objects become visible from within Vee. To use the wrapper in a Vee program, proceed as follows:
1) Save the AudioPrecision.API2.dll file (included in the download referenced below) in a folder on the hard drive of your PC.
2) Open the Vee program and add a reference to the above DLL file, as well as to the original APx500 API. Use the Browse button on the .NET Assembly References window (Figure 1) to locate the appropriate files. The original API file can be found under ~Program Files\Audio Precision\APx500 x.x\API (where x.x denotes the APx500 version number).

3) Create an instance of the "APx500_Application" object. This is the API object contained in the new DLL. To do so, select a Constructor for the APx500_Application object under AudioPrecision.API2 in the Function and Object Browser, as shown in Figure 2.

Once the instance of the APx500_Application object has been added, you can build your APx500 program by adding a series of .NET operation builders as shown in Figure 3.

A simple sample program written in Vee is shown in Figure 4. It does the following:
The sample program and the wrapper DLL are both included in the APx_Vee_example.zip download.
*****
jb
A dll that enables you to access the entire APx API when using the Agilent Vee programming language. Includes a sample file written in Vee as a usage example. A discussion and instructions are in the kb article "Using APx with Vee."
Please log in to add a comment.