What is IOCard?

IOCard is a MATLAB mex file for MacOS which allows you to interface with National Instruments cards. Update 12/18/01: Now uses NI-DAQ 6.6.1, so can be used with all the cards supported by LabView on the Mac!

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

Usage 1, One-shot Digital Read:
	Result =
		One returned by the NI-DAQ Configuration
		0 to 11. E-Series cards only use 0. PCI-1200/6503 use 0-2. The DIO-96 has
		0 to 31. Usually only 0-7 are valid, for 8 bit ports.
		0 for
digital logic low, 1 for digital logic high

Usage 2, One-shot Analog Read:
	Result =
		One returned by the NI-DAQ Configuration Utility.
		0 to 31. E-Series cards uses 0-7. PCI-1200 uses 0,2,4,6 (see notes below).
		-32,768 to 32,767 when Reading a Channel with 16-bit ADC
		-2,048 to 2,047
when Reading a Channel with 12-bit ADC

Usage 3, One-shot Digital Write:
		Same as for One-shot Digital Read.
		0 for digital logic low, 1 for digital logic high

Usage 4, One-shot Analog Write:
		Same as for One-shot Analog Read.
		-32,768 to 32,767 when Writing a Channel with 16-bit DAC
		-2,048 to 2,047
when Writing a Channel with 12-bit DAC

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 Digital IO cards
(PCI-6503, PCI-DIO-96, and PCI-DIO-32HS)
	and Analog/Digital Multifunction cards (PCI-1200 and E-Series
	since they exist at the Center for Visual Science in various labs.

Configuration Note:
	Analog is setup for bipolar mode: usually (-5,5) or (-10,10) volts (depends on card)
Analog input is setup for differential mode (supply a grounded partner for each channel)
makes valid input channels 0-7 on the E-Series and 0,2,4,6 on PCI-1200)
	Analog input gain is set to 1.
These may be configurable in the future if demand warrants it.

Input/Output State Note:
attempts to maintain the state of other ports/channels. Some hardware does not allow this.

When Other Analog
Channels Might Be Reset
	On E-Series cards, a single channel can be set to input, but this probably won't
work on other
	analog cards. If all channels must be input, they will be, in response to a read request.
In that case, output channels will probably be reset.

When Other Digital Ports Might Be Reset
all cards with multiple digital ports use the Intel 8255 chip, used in PC parallel ports.
	When you read
from a port for the first time, or after having used it to write,
	any other port outputs will be reset. An
easy way to avoid this problem is to use a given port
	for either reading or writing, but not both, and to do
your first read before your first write.
	The E-Series cards don't use the 8255; even individual lines
within a port can change io state
	without affecting the state of other lines.

Testing for NI-DAQ
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?

Limited testing successful on the following cards: PCI-MIO-16XE-50

How do I get it?

Who's using it?

Last updated 10/2003