Example Code

NI 5402/5406 Calibration Procedure - Verifying the Main Path 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

  • NI-FGEN

Code and Documents

Attachment

Description

Overview

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

 

Description

This example shows the LabVIEW code for programmatically verifying the main path gain and offset accuracy of the NI 5402/5406 as described on page 21 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 main path gain and offset accuracy of the NI 5402/5406 into a high-impedance load. In this procedure you generate a number of DC voltages and 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 analog filter state by calling the niFgen Property Node and selecting Output Attributes»Analog Filter Enabled.

4. Set the load impedance by calling the niFgen Property Node and selecting Output Attributes»Load Impedance.

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

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

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

8. Create an array of waveform samples for the positive full-scale DC waveform. This array should contain 16,384 samples with each sample having the value 1.0 (representation: double).
9. Define the waveform by calling the niFgen Define User Standard Waveform VI.

 

Repeat steps 10 through 18 for each of the iterations listed in Table 5, changing the Digital Gain, Amplitude, and DC Offset values for each iteration.

 

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

11. Set the digital gain by calling the niFgen Property Node and selecting Output Attributes»Digital Gain.

12. Set the DC Offset by calling the niFgen Property Node and selecting Standard Function Output»DC Offset.

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

14. Wait 200 ms for the output to settle.
15. Use the DMM to measure the DC voltage output of the NI 5402/5406. This value is the measured DC output value.
16. Determine the error for positive full scale using the following formula:
     DC Error = (Measured DC Output – (Ideal DC Output)
17. Compare the DC Error to the calibration test limits and the published specifications.

18. Abort waveform generation by calling the niFgen Abort Generation VI.

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

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

 

Additional Information or References

Block Diagram

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