Example Code

NI 5402/5406 Calibration Procedure - Verifying Square Wave Gain and Offset 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

Description

Overview

This example shows the  LabVIEW code for programmatically verifying square wave gain and offset accuracy of the NI 5402/5406

 

Description

This example shows the LabVIEW code for programmatically verifying square wave gain and offset accuracy of the NI 5402/5406 as described on page 30 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 square wave gain and offset accuracy of the NI 5402/5406 into a high-impedance load. In this procedure you generate a square wave using a number of amplitudes and DC offsets, measure the voltage with a DMM, and compare the results to the error limits.


1. Connect the NI 5402/5406 CH 0 front panel connector to the DMM.
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. Set the load impedance by calling the niFgen Property Node and selecting Output Attributes»Load Impedance.

4. Set the output impedance by calling the niFgen Property Node and selecting Basic Operation»Output Impedance.

 

Repeat steps 5 through 13 for each of the iterations listed in Table 6, changing the Analog Static Value, Amplitude, and DC Offset values for each iteration.

 

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

6. Set the analog data mask by calling the niFgen Property Node and selecting Output Attributes»Data Mask»Analog Data Mask.

7. Set the analog static value by calling the niFgen Property Node and selecting Output Attributes»Data Mask»Analog Static Value.

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

9. Wait 200 ms for the output to settle.
10. Use the DMM to measure the DC voltage output of the NI 5402/5406. This is the measured DC output value.

11. Determine the error for each measurement using the following formula:
     DC Error = (Measured DC Output Value) – (Ideal DC Output Value)
12. Compare the DC error to the calibration test limits and published specifications.
13. Abort waveform generation by calling the niFgen Abort Generation VI.

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

15. If any of the errors are greater than the calibration test limits, perform a self-calibration procedure, followed by a reverification procedure.

 

 

Additional Information or References

Block Diagram

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