APx500 Measurement Software has the most advanced audio measurement user interface in the world. The Measurement Navigator and Sequencer allow complex automation — including user prompts and calls to external applications– without a single line of code.

Sometimes, however, the Operator needs a custom interface, or application-to-application automation is required. For these cases, APx has a comprehensive Application Programming Interface (API).

AP supports the VB.NET, C#.NET, MATLAB, and LabVIEW development environments. For help getting started, documentation, drivers, and examples, see the APx API Developer Tools download area.

About the API
The Audio Precision APx500 API is organized in a manner that reflects the APx user interface. The API is logically organized to reflect major concepts such as a project file, sequence, and measurements.

The APx user interface (UI) is divided visually into a left side and right side. The Measurement Navigator occupies the left side of the screen and offers organizational features of your project, as well as the ability to run the contents of your project as a sequence. The right side of the user interface is occupied by the active measurement. All settings and results for the active measurement are presented in the user interface.

The API is organized in a similar manner. Each measurement in the UI has a corresponding property call with the same name as displayed on the UI:

• ReferenceLevels
• LevelAndGain
• ThdN
• FrequencyResponse
• SignalToNoiseRatio
• Phase
• Crosstalk
• ContinuousSweep

Most of the measurements share common Properties such as Generator, Start() and ClearData() as well as having properties that are unique to that measurement, such as OneToOneSourceChannel in the Crosstalk measurement. In turn, these Properties have action calls associated with them that can be shared or unique depending on the measurement.

  • Name
  • IsValid
  • GetValues
  • CopyToClipboard

API Best Practices
While the API does contain calls for nearly all of the APx’s individual operations, the best way to automate the APx is to combine a manually created project file with the “Run Sequence” API call APx.Sequence.Run().

• Open APx user interface
• Create the sequence of measurements you need via the Measurement Navigator
• Adjust measurement analyzer parameters, add user prompts and set limits as necessary for each measurement
• Save the sequence as an APx project file, for example ampbuild01.approj
• Close APx and switch over to your programming environment
• Use the API call “Run Sequence” command to find and run the project you saved in Step 3.
• The API has many calls to extract the results from the sequence. These results can then be used in your program

This approach takes best advantage of the APx UI’s ease-of-use combined with the flexibility of a programmatic environment to automate tests and/or integrate the APx into a larger test rig.

For example, to run a project named “Test23.approj”, you would use:

APx.Sequence.Run(“c:\\mytests\Test23.approj”)

To run a single measurement in a sequence, you would use:

APx.Sequence.Item(“Signal Path1”).Item(“Level and Gain”).Run()

Note: The Measurement Navigator always specifies which signal path a measurement belongs to, so the API call must specify the signal path parameter.

API samples and resources
APx API Project Template

AP has provided a VB Express project template installer which gives you a starting point to begin creating new projects for the APx.

This project will provide a blank form with the APx class defined. For more detailed code examples, use the Visual Basic Sample Tests in the APx API Developer Tools.

Instructions
• Download, unzip and install Microsoft Visual Basic Express 2008.
• Open VB Express 2008.
• Open a new project (File/New Project/ Installed Templates/ APx500 Application
• In the Solution Explorer navigation, right click “APxMainForm.vb” and select “View Code”
• You are now ready to start API development.

APx API Samples
The APx API Developer Tools contain sample files and other resources to help you get started. Visit the Software section of AP.com to browse all API drivers and resources, or download the APx API Developer Tools.

• The API Browser — utility that lists all the API calls in a hierarchical tree, allowing you to follow every path of the API. Also contains examples of code and links to the help file.
• Sample tests in Visual Basic.NET and C# — Over 30 common audio test routines as well as examples of all the new API calls in the latest APx software version.
• LabVIEW Virtual Instruments — The same tests as above written as LabVIEW VIs.