AP - The Recognized Standard In Audio Test

Login / Register Contact

Home Solutions Products Downloads Library Service & Support Sales & Lease About

Share with Friend
  • Service & Support
  • Overview
  • Knowledge Base
  • Training
  • Solutions Partners
  • Service Offerings
  • Schedule Service
  • Calibration
  • Shipping Instructions
  • Downloads
  • AP Warranty terms and conditions
  • AP Calibration Services Datasheet

Knowledge BaseHOME/SERVICE & SUPPORT/KNOWLEDGE BASE

Using APx with Vee

Created 23 Oct 2009

Problem

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.

Solution

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).

Figure 1. Adding references to the APx500 API and API wrapper to the Vee program.

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.

Figure 2. Creating an instance of the APx500_Application object.

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.

Figure 3. Adding a .NET operation to the Vee program.

A simple sample program written in Vee is shown in Figure 4. It does the following:

  1. Opens APx500 with the application window visible.
  2. Turns off the signal monitors.
  3. Selects the measurement named Frequency Response in Signal Path1.
  4. When the Start button is clicked, it sets the start frequency, stop frequency, and analog generator level and then runs the Frequency Response measurement.

The sample program and the wrapper DLL are both included in the APx_Vee_example.zip download.

Figure 4. Completed Vee program (see larger view).


*****
jb


Related Downloads

APx Vee dll and Sample

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."

APx_Vee_dll_and_Sample.zip (65.2 KB)

Return to Knowledge Base home

Comments

0 comments so far

Please log in to add a comment.

Back To Top

Accredited by A2LA

Browse Products View Solutions Schedule a Demo Get Service Register

Audio Precision

Copyright © 2009 Audio Precision Inc. All Rights Reserved.    |  Privacy Policy