LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog output FPGA LSB Offset

I'm developing an application that requires me to generate a calibrated analog ouptput from within the FPGA code.  I'm familar with scaling analog values in the host or RT program using LSB weight and offset, but for a portion of my application, the analog value will be set from within the FPGA vi.  Do I need to include some scaling of the value using LSB weight and offset?  For example, during a particular sequence, I need to output a value (that will come from the host) then in a subsuquent sequence (determinded by logic in the FPGA) I need to output 0 volts.  If I wire a binary 0 to the analog output IO node will this mean 0 V output, or do I need to include somehow the Offset?
 
steve
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 1 of 5
(5,984 Views)

You  need the LSB weight and offset when converting integer (on the FPGA) to floating point( Windows or RT) as you mentioned.

In the inverse case, this is not true.

If you have a 16-bit voltage output with a range of +-10V, the first bit will indicate the sign. The other 15 bits can be used to indicate the

absolute value. In other words, write 0 for 0 Volts and 2^15 for the full range.

KostasB

NI UK

0 Kudos
Message 2 of 5
(5,969 Views)

Hi Steven,

I assume your using cRIO modules if your asking about Calibration and Scaling of LSB and Offsets.  If your using binary values on the FPGA and not performing Calibration and Scaling, than writing a 0 to an AO node will not necessarily write a zero to the AO because you have not compensated for the Offset and weight.  For example, writing a 0 might give you a voltage slightly greater than zero if it has a positive offset, or conversely it might give a slightly negative value if the offset if negative. 

If you needing to just output zero you can figure out the exact binary value you need for that particular DAC by using the Nominal to Binary value, and then in your code you output that value during the sequence that wants to output a zero.

If you have logic that is not as straight forward as just setting zero and your wanting to manipulate the AO value being sent out, I would suggest using the latest NI RIO Driver 2.4, that has a new feature for Calibration and Scaling on the FPGA using Fixed-Point Numbers.  You can also check out information at this KB on using Fixed-Point Numbers with cRIO.

Hope that helps,

Basset Hound

0 Kudos
Message 3 of 5
(5,925 Views)
Thanks Basset Hound,
 
II was beginning to suspect that I need to offset my zero based on the Nominal to Binary value.  I'll also give the new RIO driver a try.  Is the new feature you mention obvious?  Is there a KB on how do use this?
 
StevenA 
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 4 of 5
(5,094 Views)

Hey Steve,

The feature will be on by default for new IO added so it should be pretty straight forward.  For existing IO you can change it on the properties page of the module ( right click in the project ).  Here is the portal you can use for using Fixed Point with CompactRIO.

Make sure to post any questions you have in regards to using Fixed Point with cRIO.

Steve

0 Kudos
Message 5 of 5
(5,091 Views)