Created on 2009-05-12 21:04:00
We’re trying to automate our test which has to be run open loop. Can an external application be invoked from the APx500 control software?
APx500 has a great feature that can be used to call an external application from any measurement in a project file. To use it, right click on the measurement at the point in the sequence where you want to call the application and select Edit Prompts and Properties. This will open the Sequence Step Properties window. To insert a step that calls an external application, click on the Add Program button on the toolbar (Figure 1).
Fig 1 Sequence step properties – adding a program.
This opens another window titled “Run External Program” (Figure 2). Here you can name the sequence step, specify the command that runs the external application, add any command line arguments needed to run it, set the application’s working directory, and tell APx whether to wait for the application to finish before continuing with the sequence
Fig 2 Run external program dialog.
This feature can be very useful for automating tests that require an open loop configuration – devices like disc players, MP3 players, etc. where the stimulus signal originates outside the APx500 analyzer—if the device can be controlled by an external program. Open loop tests typically require a lot of user interaction, with prompts to tell the user to load a test track and press the play button, etc. However, if the device can be controlled by a program that can be invoked by the command line, the process can easily be automated.
In the example shown in Figure 2, we are using a third party program called Goldwave to play a .wav file containing an audio test stream from the PC’s sound card. Goldwave (available from goldwave.com) is an inexpensive audio editing program that has some useful features. It can be invoked from the command line, and the arguments -play and -close instruct it to play the specified file, then close the application when the file is finished playing. In this case we’ve taken an audio test stream created by the APx Waveform Generation utility and have made a shortened version of the track that’s only 2 seconds long.
Fig3 Sequence step properties – adding delay.
To make sure that the track is playing before APx starts the measurement, you can add a delay sub-step to the sequence step as shown in Figure 3. In this case a delay of 1 second was used. Now the measurement is completely automated and takes less than 2 seconds to complete.
Here is an APx project file named Ext_Prog.approj that includes the measurement illustrated above with a THD+N measurement and a Stepped Frequency Sweep measurement. The project file calls the Goldwave audio editor program, so you will either need to install Goldwave, or substitute another audio player with a command line interface. If you do run the project file, first use one of the test stream tracks to set the volume of the DUT as required, and then set the dBrA reference level while the track is playing.
This APx project and related files demonstrates how to run an external program from APx500. Includes THD+N measurement and Stepped Frequency Sweep measurements. The project file calls the Goldwave audio editor program, so you will either need to install Goldwave, or substitute another audio player with a command line interface. Accompanies the kb article "Running an external program from APx500," which gives a complete explanation.