Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Input voltage range and binary

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
 
 
 
0 Kudos
Message 1 of 7
(3,736 Views)
Why don't you use the VI "read binary file" to directly get the good values ? I already recorded datas in binary file, I opened after and display it or recorded it in txt file, with no more "manual" convertions ...
Wilfried.
0 Kudos
Message 2 of 7
(3,720 Views)

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.

AE KB 3BFEJ95L: How Can I Convert Binary Data From a Data Acquisition Read to Scaled Data?

 

Samantha
National Instruments
Applications Engineer
0 Kudos
Message 3 of 7
(3,705 Views)
Thank you for the suggestion. 
 
Those programs don't really help my application.  The read binary files helps me get back the binary numbers, but not the voltages.  I am using mx vi s, and they don't seem to have that number I can get to. 
 
But more to the point.  If the values do not match up like I stated above then I am not getting full resolution out of my card. 
 
0 Kudos
Message 4 of 7
(3,691 Views)

Hello,

Cont Acq&Graph Voltage-To File (Binary).vi and Graph Acquired Binary Data.vi paired together are the DAQmx version of the Traditional example from the Knowledge Base.  These examples are located in the Example Finder inside of LabView.  In addition, the issue of data not matching up is due to the lack of scaling coefficients and does not relate to utilization of the full resolution of the card.  Please try the examples listed above.  Are you still getting an offset with these examples?

Samantha
National Instruments
Applications Engineer
0 Kudos
Message 5 of 7
(3,681 Views)

I do not think the problem is with an "offset" as I described above I have my conversion above.  This number should work.  I do not see that number I need somewhere...where do I get it?  Perhaps I am missing somethign here.  My conversion should work, I want someone to explain the difference to me.

Thank you.

0 Kudos
Message 6 of 7
(3,667 Views)

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.  This equation is from the Knowledge Base linked in the third post.  Your post states you have a ~ 8-9% offset.  This scale offset can be determined by running the example finder examples.  The example titled Cont Acq&Graph Voltage-To File (Binary).vi contains a function titled Create Header.  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



Message Edited by samantham on 12-07-2007 11:10 AM
Samantha
National Instruments
Applications Engineer
0 Kudos
Message 7 of 7
(3,663 Views)