LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital code as input to dac(NI 9263)

Solved!
Go to solution

Hi,

 

I have a question related to Ni 9263 which is a DAC module (analog output module). I am working on DNL/INL error of 12 bit ADC and I want to to increase NI9263 analog output voltage of DAC 1 LSB by 1 LSB (of DAC). However, DAC takes input as analog voltage. Hence, it is very hard to increment output by 1 LSB even if I know the Vref of Ni9263. Since it uses 16 bit DAC which results in an easy change in 1 LSB voltage if Vref changes a little. So I want to apply digital code rather than dealing with analog voltage which I can read later with another ADC(Ni 9205) or a DMM.

Do you have any suggestions how to do this?

 

Thanks,

 

Ouz

NSC Intern  

0 Kudos
Message 1 of 6
(3,383 Views)
Solution
Accepted by topic author ouz

Hi Ouz,

 

Are you using DAQmx? If so, click on the DAQmx Write VI's polymorphic VI selector and choose Analog >> Unscaled >> 2D I16. Note that DAQmx does not apply the NI 9263's calibration constants with this version of the write VI. You could use the AO.DevScalingCoeff property in the DAQmx Channel property node to calculate the calibrated voltage based on the unscaled value, but measuring the output with another device makes this a non-issue.

 

Brad

---
Brad Keryan
NI R&D
Message 2 of 6
(3,369 Views)

Hi Brad,

 

Thanks for your response. Using Unscaled 2D I16 works for my purpose. Let me try to use AO.DevScalingCoeff property also even if I need to read the output with a DMM.

 

Regards,

 

Ouz

0 Kudos
Message 3 of 6
(3,361 Views)

Hi Brad,

 

Could you explain a little bit how to use two values returning from AO.DevScalingCoeff to calculate the analog output?

 

Thanks,

Ouz

 

 

0 Kudos
Message 4 of 6
(3,357 Views)

Hi Ouz,

 

The array returned from that property contains coefficients for converting voltages to binary DAC codes:

 

binary = coeff[0] + coeff[1] * voltage + coeff[2] * voltage^2 + coeff[3] * voltage^3 + ...

 

(By '^' I mean exponentiation, not xor.)

 

To convert binary DAC codes back to voltages, you need to invert the polynomial. DAQmx includes a helper VI that uses curve fitting to do this in the general case (DAQmx Compute Reverse Polynomial Coefficients.vi) but it isn't necessary here. The NI 9263's scaling polynomial has a degree of 1, so the inverse is easy to compute:

 

voltage = (binary - coeff[0]) / coeff[1]

 

Brad

 

 

---
Brad Keryan
NI R&D
0 Kudos
Message 5 of 6
(3,343 Views)

Hi Brad,

 

Thanks for the help. 

Have a good one.

 

Ouz

0 Kudos
Message 6 of 6
(3,336 Views)