AcquireAIO


What is AcquireAIO?

AcquireAIO is a MATLAB mex file for MacOS which allows you to interface with National Instruments cards to do asynchronous data acquisition. You can tell it to go and the returned matrix will be filled "behind your back", while you go ahead and do other things with MATLAB.

When you type "AcquireAIO" at the MATLAB prompt, you get the following help:

Usage 1:
	data = AcquireAIO(CardID,Samples,SamplesPerSecond,ChanList,[GainList],[mode],[polarity])
	Asychronously acquires Samples of data at a SamplesPerSecond rate
	for a list (if supported) of analog channels on the NI card specified by CardID.
	data:
		A (Samples*number of channels in ChanList) x 1 matrix containing signed digitized voltages.
		Note: data matrix will be initialized to -1.000000. Channel samples are interleaved.
	CardID:
		One obtained by the NI-DAQ Configuration Utility.
	Samples:
		The number of samples to acquire (per channel).
	SamplesPerSecond:
		How many samples to acquire per second (per channel).
	ChanList:
		A 1 x number of channels list of channels to sample, in order.
		Note: Not all devices can sample multiple channels (e.g., E-Series can, PCI-1200 can't.)
		Note: Most cards don't sample the channels simultaneously-- they only have one ADC.
		Channels are sampled as close together in time as is possible-- 
		The maximum is determined the first time you try an acquisition.
		If your hardware can't do it, only the first channel is sampled.
	GainList - optional (default 1)
		Specifies the gain for each corresponding channel in the ChanList.
		Commonly 1,2, or 10. See Appendix B of 
	mode - optional (default 0)
		Options are:
			0 for Differential- each channel has a grounded partner channel you provide.
			1 for Referenced Single Ended- one ground for all channels, provided by card.
			2 for Non-Referenced Single Ended- one ground for all channels, you provide to AISENSE pin.
	polarity - optional (default 0)
		Options are:
			0 for bipolar: voltage input centered around 0 (ex, -5 to 5, -10 to 10)
			1 for unipolar: voltage input starts at 0 (ex, 0 to 5, 0 to 10)


Usage 2:
	AcquireAIO('Stop')
		Stop an acquisition in progress.

Current support:
	Requires NI-DAQ 6.x (compiled for 6.6.1).
	All cards that are supported by NI-DAQ 6.x should work.
	I will be testing both PCI-1200 and E-Series (PCI-MIO-16XE-50)
	since they exist at the Center for Visual Science in various labs.

Testing for NI-DAQ 6.x...
NI-DAQ is installed!

Hey! I thought NI-DAQ 6.x only works from LabView according to National Instruments!

In December 2000 I found that you can link against nidaq32.dll (inside the NI-DAQ container in the Extensions folder when you install 6.6 on the Mac-- use The Fragmalyzer to get it out) and use the 6.6 PC header files (with minor modifications) and access NI-DAQ 6.6.x from your app on the Mac! The advantage is that 6.6 can do DMA while the one NI wants you to use on MacOS classic is 4.9.x which is interrupt based. I had to go through this to be able to generate waveforms at a frequency higher than 4.9.x could achieve. Now I use it instead of 4.9.x for everything on classic MacOS. Unfortunately for MacOS X, there doesn't appear to be an equivalent nidaq32.dll included with demo LabView, for instance.

How is the testing going?

Testing successful on PCI-MIO-16XE-50 for single channel only until 3/14/2003; as of 3/14/2003 multiple channel acquisition is working. Report any successes/failures to me please! I am adding some new features (like marking the stream, using a circular buffer, retrieving data and information on progress) in the next couple days, so stay tuned!

How do I get it?

Who's using it?

Daphne Bavelier at CVS and Keith Schneider in Sabine Kastner's lab at Princeton Psychology.
Up
Last updated 10/2003
bdsinger@princeton.edu