Example Code

NI 5402/5406 Calibration Procedure - Verifying the Sine Wave Flatness Correction Accuracy

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Modular Instrumentation

    Software

  • LabVIEW

    Driver

  • Other

Code and Documents

Attachment

Overview

This example shows the LabVIEW code for programmatically verifying the sine wave flatness correction accuracy of the NI 5402/5406

 

Description

This example shows the LabVIEW code for programmatically verifying the sine wave flatness correction accuracy of the NI 5402/5406 as described on page 14 of the NI 5403/5406 Calibration Procedure.

 

Requirement

Software
  Labview 2012 (or compatible)
  NI-Fgen driver which is compatible with your hardware and version of LabVIEW
Hardware:
  NI 5402 or 5406 device

 

Steps to Implement or Execute Code

This test verifies the Sine Wave Flatness Correction Accuracy of the NI 5402/5406. In this procedure, you will compare the signal generator’s output power level during the generation of sine waves of various frequencies to the output power level measured during the generation of a 50 kHz sine wave. This figure shows the programming flow for this test.

 

1. Connect the NI 5402/5406 CH 0 front panel connector to the power meter.

2. Open an instrument driver session, initialize the device for operation, and return a session handle that will be used to identify the device in future NI-FGEN calls by calling the niFgen Initialize VI.

3. Configure the waveform by calling the niFgen Configure Standard Waveform VI.

Repeat steps 4 through 11 for each of the iterations listed in Table 3.

4. Set the analog path by calling the niFgen Property Node and selecting Output Attributes»Analog Path.

5. Set the pre-amplifier attenuation by calling the niFgen Property Node and selecting Calibration»Pre-Amplifier Attenuation.

6. Set the post-amplifier attenuation by calling the niFgen Property Node and selecting Calibration»Post-Amplifier Attenuation.

7. Set the amplitude by calling the niFgen Property Node and selecting Standard Function Output»Amplitude.

8. Initiate waveform generation by calling the niFgen Initiate Generation VI.

9. Use the power meter to measure the output power level of the NI 5402/5406. This value is the measured power of the 50 kHz sine wave.
10. In this step you generate a sine wave configured for the current iteration of Table 3 at each of the frequencies listed in Table 4.

     a. Set the frequency by calling the niFgen Property Node and selecting Standard Function Output»Frequency.

     b. Use the power meter to measure the power level output of the NI 5402/5406. This value is the measured power of the generated sine wave (dB).
     c. Check to see whether the sine wave flatness error falls between the high and low flatness error calibration test limits. Flatness error can be determined by using the following calculation:
          Sine Wave Flatness Error = (Measured Power of Generated Sine Wave) – (Measured Power of 50kHz Sine Wave)
     d. Repeat steps 10a through 10c for each frequency in Table 4.
11. Abort waveform generation by calling the niFgen Abort Generation VI.

12. Close the instrument driver session, destroy the instrument driver session and all of its properties, and release any memory resources NI-FGEN uses by calling the niFgen Close VI.

13. If any of the errors are greater than the calibration test limits, perform an Adjustment.

 

 

Additional Information or References

Block Diagram

137.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

 

 

Barron
Applications Engineering
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.