06-30-2021 09:49 PM
Thank you so much!
I was able to convert the data (raw data) to 12 bit by using logical shift. But I am not getting expected output. I am not sure if this is related to logical shift or something else.
I set the input range as 3.3 V (max) and 0V (min), with terminal configuration as RSE. I am giving 3.3V input to a1 channel.
When I am selecting the polymorphic selector for DAQmxRead as "Analog 1D DBL 1Chan NSamp", I receive the output as 3.3V as expected (please refer to "analog.png" image). But since I need raw data, I change the polymorphic selector to "Raw 1D U16". And when I change it to raw data, I get 1V equivalent values as shown in both the waveforms (in front panel) for 16 bit and 12 bit (please refer to raw data.png image).
In "12 bit" waveform, instead of getting output at ~1200, I should get the values as 4096 and in "16 bit" waveform, instead of ~20000, I should get the output at 65536, since I am giving 3.3 V, which is max. Can someone please help? I feel like I am doing a stupid mistake here. I have attached my project too (you might have to download both vi...not sure how they are related but one won't open without another). Thanks!
06-30-2021 11:12 PM
@Santhosh, I didn't get why you are multiplying 0 with 12 bit ADC equivalent...it's giving me 0 result.
07-01-2021 05:12 AM - edited 07-01-2021 05:21 AM
A more general answer:
You use a 621x device , so look into some specs
https://www.ni.com/pdf/manuals/371931f.pdf
depending on gain and individual calibration you get different V per LSB. (ususally different to <nominal range>/16^2 !)
Now you want to emulate your MCU ... 12bit resolution ADC ... but referenced to what?
However you end up in another V/LSB
So if you just want to stick in the 'analog' value world you can use something like this:
input is your higher resolution value (U in Volt), multiple the resolution of your ADC in V/LSB, result the new stepped values
hint: input and result can also be arrays 😉
If you want work with integer values, please define the representations