Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading binary values with NI-USB 6008 using NI-DAQmx base 1.4 and visual C++

I want to know how to read binary values of an Analog input channel (samples are acquired continuously at 1Khz).
I tried to call the function "DAQmxBaseReadBinaryI16" with an array of 16 bits integers but it always returns the error code -200428:'Value passed to the Task/Channels In control is invalid'

Should i always use "DAQmxBaseReadAnalogF64" with a double precision floating points array,
or did i forget something in the channel configuration?
(I used the same configuration in the 2 cases but the first doesn't work)

This is approximatively what i've done

//channel Configuration
DAQmxBaseCreateTask("",&taskHandle);
DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL);
DAQmxBaseCfgSampClkTiming(taskHandle,clockSource,sampleRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,samplesPerChan);
DAQmxBaseCfgInputBuffer(taskHandle,100000);
DAQmxBaseStartTask(taskHandle);

//reading

//this call works
DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByScanNumber,/*float64*/data,bufferSize,&pointsRead,NULL);

//this call returns the error code -200428
DAQmxBaseReadBinaryI16(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByScanNumber,/*int16*/data,bufferSize,&pointsRead,NULL);
0 Kudos
Message 1 of 6
(4,311 Views)
Hi,

You cannot read 16 bit Raw data with a USB-6008 device that has a 12 bit resolution. This option is only available for 16 bit devices.

Regards.

JV
0 Kudos
Message 2 of 6
(4,286 Views)


@JorisV wrote:
Hi,

You cannot read 16 bit Raw data with a USB-6008 device that has a 12 bit resolution. This option is only available for 16 bit devices.

Regards.

JV




Actually, at least for DAQmx Base on Macintosh OS X, the ReadMe file shows this:

NI USB-9211
*Analog Input
-Multi-channel, multi-sample read (scaled)
-Multi-channel, single sample read (scaled)
NI USB-9215
*Analog Input
-Multi-channel, multi-sample read (scaled)
-Multi-channel, single sample read (scaled)
NI USB-6008/9
*Analog Input
-Digital start triggering
-Multi-channel, multi-sample read (scaled)
-Multi-channel, single sample read (scaled)

Note that none of the supported USB devices supports raw input mode, even the 16-bit 9215.

It was surprising hardware and software limitations like this, plus missing functionality (most notably the lack of Properties available in NI-DAQmx) that convinced me that I can't develope a commercial-quality product based on DAQmx Base.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 3 of 6
(4,283 Views)
thank you for the answer.
0 Kudos
Message 4 of 6
(4,271 Views)

NI-DAQmx 7.5 (link below) now supports the USB-6008 and USB-6009 devices on Windows.  I strongly recommend installing this much more powerful and robust driver.  For more information on how to switch your device to use NI-DAQmx, refer to the KB linked below.

 

 

NI-DAQmx 7.5
http://digital.ni.com/softlib.nsf/websearch/CF7ECCEA4C4CC7DE86257038004D88AE?opendocument&node=132060_US 

 

 

KB: 3NE7GJMY

 

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIRDCA4&l=en-US

 

 

 

 

 

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

 


@Jeremy C wrote:

NI-DAQmx 7.5 (link below) now supports the USB-6008 and USB-6009 devices on Windows.  I strongly recommend installing this much more powerful and robust driver.  For more information on how to switch your device to use NI-DAQmx, refer to the KB linked below.

 

 

NI-DAQmx 7.5
http://digital.ni.com/softlib.nsf/websearch/CF7ECCEA4C4CC7DE86257038004D88AE?opendocument&node=132060_US 

 

 

KB: 3NE7GJMY

 

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIRDCA4&l=en-US

 

 

 

 

 

 





Back from vacation...

Yes, the commercial-grade product was developed with NI-DAQmx. I learned about all the limitations of NI-DAQmx Base in the process of trying to port it to Macintosh.

We still don't have a commercial-grade solution for Mac OS X.

John Weeks

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