06-25-2009 04:29 AM
Solved! Go to Solution.
06-26-2009 07:02 AM
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
06-26-2009 10:10 AM
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
06-28-2009 09:07 PM
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
07-03-2009 04:37 AM
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
07-03-2009 01:12 PM
Hi Chiara,
From the document that you linked:
- 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)- 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