Created on 2011-01-27 00:47:00
When using the APx API, it is important to get settled readings. Readings that are not settled may be unsteady and lack repeatable results. The following inquiry is typical of this situation:
We use an APx586 to measure analog voltages on 16 channels simultaneously in an audio test application. The APx audio analyzer is controlled using a software application that we developed in National Instruments Lab Windows/CVI with the APx Application Programming Interface (API). We have had many problems with what we consider to be “bad”readings—voltage levels measured with the Level and Gain measurement are different than expected across channels, and results are inconsistent. We have programmed in a delay of 1.0 seconds between successive measurements, and even with this, we continue to experience the problem. Do we need a larger delay time to correct this? Also, should we use AutoRanging or Fixed Ranging?
Based on your description of the problem, we think that the underlying reason is that you are not acquiring settled data.
When you open the APx500 software and select the RMS Level result of the Level and Gain measurement, you might notice that the levels indicated by the meters for each channel fluctuate continuously. These meters are constantly being updated according to the voltage sensed at the analog inputs. However, the levels indicated by these meters are not “settled” readings. Therefore, if the signal is not steady or is contaminated by the presence of noise,the readings indicated by these meters will probably not indicate the desired result.
To get settled readings in APx, you must use the Sequencer. For example, to run the Level and Gain measurement, you would check the box beside this measurement in the Project Navigator tree and check the boxes of the desired results(for example RMS Level and Gain). Then, you could either run the entire sequence by clicking the triangular Run Sequence button, or you could right-click on the Level and Gain measurement and select “Start Selected Measurement”. This will start the generator, acquire data using the specified settling algorithm, and insert the data into the report. It also accumulates the settled readings into the Sequence Results collection, which can be accessed from the API. The settling algorithm is set to default values, which can be changed on the Advanced Settings panel of the measurement.
If you are using APx.Level And Gain.Level.Get Values() or a similar API method to get the levels from the Level and Gain measurement, you will only return instantaneous unsettled readings (like the fluctuating levels on the meter displays in the GUI). To get settled readings, you need to use the Sequencer to run the measurement and then retrieve the results from the Sequence Results Collection. The example code below in VB.Net illustrates how to do this: