Discussion:
Input voltage range and binary
(too old to reply)
mheien
2007-12-04 17:40:13 UTC
Permalink
Hi, I am collecting data using a M-series 6221.  Because I am collecting a lot of data, I am collecting and storing it in binary format.  The card is 16 bit, and I have the voltage range set up to +/- 10 V. 
 
So, when converting the binary data back to voltage, I need to multiply my binary number by 20 V  / 2^ 16 bits to get the binary number back in bits.  But there is a problem here....when I apply 5 V and measure it, I only read ~ 15 000 bits instead of 16 384 (converting to ~4.7 V).  I have tried this with multiple cards.  The number seems to be off by ~ 8-9% each time at different voltages.  I am runnning in differential mode.  Am I doing something wrong?   Is the range of the bits really larget than +/- 10 V?
 
Thanks,
Michael
 
 
 
samantham
2007-12-05 23:10:05 UTC
Permalink
Hello,

Wilfried is right, you will be able to use the read binary file function to automate this conversion process.  However, if you are still interested in doing it manually or are just curious about the offset, please refer to the Knowledge Base linked below.  It explains the offset you are seeing and how to get the proper scale multiplier and scale offset.

<a href="http://digital.ni.com/public.nsf/allkb/24AEA7688B27C2A186256ED30071662D" target="_blank">AE KB 3BFEJ95L: How Can I Convert Binary Data From a Data Acquisition Read to Scaled Data?</a>

&nbsp;
mheien
2007-12-06 16:40:09 UTC
Permalink
Thank you for the suggestion.&nbsp;
&nbsp;
Those programs don't really help my application.&nbsp; The read binary files helps me get back the binary numbers, but not the voltages.&nbsp; I am using mx vi s, and they don't seem to have that number I can get to.&nbsp;
&nbsp;
But more to the point.&nbsp; If the values do not match up like I stated above then I am not getting full resolution out of my card.&nbsp;
&nbsp;
samantham
2007-12-07 17:10:10 UTC
Permalink
Hello,

The conversion you have posted above (the first post of the forum) just takes into account the scale multiplier from the equation listed below.&nbsp; This equation is from the Knowledge Base linked in the third post.&nbsp; Your post states you have a ~ 8-9% offset.&nbsp; This scale offset can be determined by running the example finder examples.&nbsp; The example titled Cont Acq&amp;Graph Voltage-To File (Binary).vi contains a function titled Create Header.&nbsp; This function will take in the task information and return the scaling information I believe you need.

Scaled Data = (scale multiplier * Binary Data) + scale offset


CreateHeader.JPG:
Loading Image...

mheien
2007-12-07 16:40:09 UTC
Permalink
I do not think the problem is with an "offset" as I described above I have my conversion above.&nbsp; This number should work.&nbsp; I do not see that number I need somewhere...where do I get it?&nbsp; Perhaps I am missing somethign here.&nbsp; My conversion should work, I want someone to explain the difference to me.
Thank you.
Loading...