Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

voltage read out from analog inputs has about 5% gain error PCI 6259

Solved!
Go to solution
Hi All,
 
I have a nasty problem with my data acquisition device.
I'm working with PCI 6259 board and SCC-68 terminal and i'm using Ubuntu with Comedi driver.
Problem is that the voltage read out from analog inputs has about 5% gain error.

 

If I read the voltage from the analog input on LabView or with a multimeter i saw it's the same but on Linux I find this error.
For example, i read 3.75 V on LabView (or multimeter) and 3.56 V with my Linux code.
I'm using +/-10 V range but i tried with other range and it's the same.
 
All the help would be greatly appreciated.
 
Thanks
 
Chiara
0 Kudos
Message 1 of 6
(4,184 Views)

Hi Chiara

 

It seems that Comedi isn't supported by NI (look at here). Since the contributions to the COMEDI have not been evaluated by National Instruments, COMEDI issues must be supported by the groups who created them or by other third-party sources.

 

I will suggest you to contact COMEDI directly (here for references). The fact that you succeeded in taking a correct measure with LV and a multimeter confirms that it isn't an hw failure.

 

I hope this helps!

 

Good job!

 

HUDSON

0 Kudos
Message 2 of 6
(4,163 Views)

One likley thing to look at: If you check out the M Series user manual (Analog input range)you'll see that the ranges of the device actaully extend %5 oustide the specified range. My guess is that COMEDI uses linear scaling based on +/10V, when in fact its a third order polynomial at +/- 10.5 V.

 

Hope this helps,

Andrew S 

0 Kudos
Message 3 of 6
(4,155 Views)
Solution
Accepted by topic author ChiaraLuciano

A possible solution may be to read the unscaled data with the comedi driver, and apply your own scaling in software.  You can see my post here showing how to get the calibraiton coefficients from your DAQ device with DAQmx.

 

I agree with Andrew that the 5% offset is very suspicious given that this is the amount above the nominal range DAQmx actually maps data to.

 

-John 

John Passiak
0 Kudos
Message 4 of 6
(4,135 Views)

Hi John

you were right... The solution is also expressed in this document.

I've another question for you on this sentence on the document:

<<

Pay special attention to the relationship of resolution and integers of
the device when converting binary values to scaled values.  Suppose
your DAQ device has a resolution of 16 bits. You should set the DAQmx
Read.vi in Raw 1D U16 or Raw 1D I16 mode, or you will lose effective
bits. When the reading is greater than 32767(2^15-1) in U16 mode, it
means that the voltage is negative and this value is complementary
code. You can convert it to a signed integer by subtracting 65536. For
example, 65534 in U16 is -2 in I16.

>> 

With my M-series board i noticed that the conversion from binary values to Volt isn't the same but i've to subtract 32767 to get the same reading of LabView. Why? I supposed that raw data is unsigned but is it?

 

Thanks for the information.

 

Chiara 

 

 

 

0 Kudos
Message 5 of 6
(4,095 Views)

Hi Chiara,

 

From the document that you linked:

  1. If your voltage range is bipolar (+/- 5V), then the reading is the signed (I16) representation within the range of -32768 to 32767 for the binary reading returned.
    (i.e. Vmax = 5V, Vmin = -5V, bit = 16, binary reading = -8192, voltage reading = -1.25V)
  2. If your voltage range is unipolar (0-10V), then the reading is the unsigned (U16) representation within the range of 0 to 65535 for the binary reading returned.
    (i.e. Vmax = 10V, Vmin =0V, bit = 16, binary reading = 8192, voltage reading = 1.25V)

Since our M series devices (including the 6259) are bipolar only, you should be reading the data back as I16.  If you have the data in U16, you should be able to typecast it to I16 to get the correct value.

 

-John 

 

John Passiak
0 Kudos
Message 6 of 6
(4,086 Views)