From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-07-2013 04:47 PM
The only place I can see an example of this is in the "NI 5751 Finite Acquisition Multiple Channels" example. The conversion in the VI is shown below:
This is a 14-bit digitizer, so I don't understand the "16" for the resolution.
The text in the example says, "The data from the 14-bit ADCs are represented in the CLIP as a 2's compliment, MSB justified, I16. The 2 LSBs are padded with zeros. The data is multiplied by a scaling factor (ADC voltage resolution = voltage range / ADC intervals * 16) to LSB justify the data and scale to volts." This seems to be different than the above code.
I don't understand what the factor of 16 is from the text. Nor do I understand how these are the same.
Solved! Go to Solution.
03-11-2013 08:03 PM
Hello JP82,
This scaling method manually unpacks the I16 values being brought in from the ADC using Split Number nodes.
There are several stages of unpacking because the array itself is initialized as a U64. If we were to use a scaling factor of 14 when we're splitting a power-of-two integer over and over again, the values would lose coherency quickly.
The Shipping Examples for the 5751 are the only ones that use this method for handling data from a 14-bit ADC. The shipping examples for the other 14-bit modules use a less obtrusive subVI for scaling the incoming data LVFPGA Scale Data.
I've attached a small piece of code that (to a very limited extent) demonstrates how the two different methods produce very similar values.
Best regards
03-12-2013 11:23 AM - edited 03-12-2013 11:27 AM
Hey JP82,
The 5751 is one of our FAMs that produces MSB justified data, with the two left most (LSB) containing 0.
If you shifted the data generetaed by the fam to the right by two, then you would use the 14 bit resolution.
Example MSB Justified:
Input Voltage : 1V
Binary Representation from FAM: 0111111111111100
Sign Bit^ Zero LSB's^ ^
Decimal Rep: 32764
MATH:
2/(2^16 - 1) * 32764 =
3.05E-5 * 32764 = 0.999302 ~ 1V
If it was LSB justified:
Input Voltage : 1V
Binary Representation from FAM: 0001111111111111
Sign Bit^
Decimal Rep: 8191
MATH:
2/(2^14 - 1) * 8191 =
1.22E-4 * 8191 = 0.99993 ~ 1V
I don't believe that the data is two's complimented, as the details indicate. I will see to it that that gets fixed.
03-12-2013 12:30 PM
Correction, when I said " two left most (LSB)", I meant "two Right most (LSB)".
I got carried away with the letter L!
03-12-2013 01:03 PM - edited 03-12-2013 01:04 PM
Also, it is 2's complement. If the smallest number that can be represented is 00000000000000, then to two's complement that, you first 1's complement (flip everything) and add 1.
100000000000000, which is the most negative number as an I16
03-19-2013 11:36 AM
That explanation makes this much, much clearer. Thanks! It would be great to see those details in the documentation for the card or in the example.
Sorry for not replying sooner, I was out of the office last week.