Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoding datas on 12 bits

Hello

I'm looking for informations on encoding of datas on 12 bits. Generally we receive infomation on a i16 (short) but I can't find on manuals where are the MSB and LSB. For bipolar operations, must I substract 2048 at the obtained value ?

I work on DAQCard6062E with VC++ 6.0 on XP.

Tanks for your help.

I first try this question with the French community, but I had no answer.

Christian
0 Kudos
Message 1 of 4
(3,215 Views)
Usually a 12-bit device uses the least significant 12 bits of a 16-bit word. A negative number will generally be encoded using two's complement, and the sign extended into the upper bits. For analog input, this usually happens without you having to do anything. On output, usually the device will simply ignore the upper bits; at most you might have to mask off the upper bits.

You don't provide much information.

Are you encountering a problem? What is your application? What are the symptoms of the problem?

Your question is about a very low-level aspect of DAQ programming. If you describe what you are trying to do, it may be that there is a solution at a higher level.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 2 of 4
(3,209 Views)
Hi John

Thank you for your answer.

My application is to acquire signals on a DAQCard6062E over 14 channels at a frequency sample of 30 KHz per channel.
1/ I must reduce my sample frequency to 25 KHz, so my Card stop to acquire.
2/ With little signals on entries (Oscilloscop), I obtain a mean value of 1500. (with measurment automation, I  select NRSE and +- 10 Volts) but I don't really known signals content.
3/ I developped with VC++ 6.0 and use traditionnal NI-DAQ drivers.

Regards

Chistian.
0 Kudos
Message 3 of 4
(3,191 Views)
I have looked at the NI-DAQ function documentation; Appendix B lists constants for voltage calculation. For "Most E-series" devices, it says in Bipolar mode the max reading is 2048. That would imply that I was correct- the raw numbers should be in two's complement.

>1/ I must reduce my sample frequency to 25 KHz, so my Card stop to acquire.

The rated conversion speed for that device is 500 kSamples/s, 500/14 = 35.7, so you should be able to acquire at 30 kSamples/s. What sort of problem do you have?

>2/ With little signals on entries (Oscilloscop), I obtain a mean value of 1500.
>(with measurment automation, I  select NRSE and +- 10 Volts) but I don't really known signals content.

Do you mean that the signals are near zero Volts? In that case, a reading 1500 is not consistent with any type of numeric encoding. I think you have a different problem.

1) I suggest you try the measurement with a known voltage, like a battery or even a just a wire across the analog inputs (for truly zero volts input).

2) Using NRSE you must provide a path for bias current if your source is floating. Check the connections.

>3/ I developped with VC++ 6.0 and use traditionnal NI-DAQ drivers

The 6062E is supported by NI-DAQmx. I would recommend that any new development work be done using NI-DAQmx. It should make your life easier. The README for NI-DAQ 8 says that C development is supported by VC 6. If you are using C++ you really should got to VC.net.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 4 of 4
(3,176 Views)