02-28-2008 09:34 AM
02-28-2008 10:40 AM
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
02-28-2008 03:14 PM
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
03-04-2008 12:57 PM
03-04-2008 01:01 PM
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