Hi John,
The functions you are trying to use are Traditional DAQ function calls. For M-Series devices of which your 6221 is one, you need to use the DAQmx API.
It would be best to make sure you have installed the DAQmx 8.1 driver to check this can you please open Measurement and Automation Explorer (MAX) and go to My System >> Software >> NI-DAQmx. Please make sure this entry is in the list and that the version is 8.0 or 8.1.
If you need to upgrade or install the driver please follow this link to the
Drivers and Updates page. While installing the NI-DAQmx driver please make sure you include C support .
After installation please go to Start >> All Programs >> National Instruments >> NI-DAQ >> NI-DAQmx C Reference Help
This will give you all the functions you can use in DAQmx and also this will give you programming flow charts, to give you the structure of the program you need. The flowcharts can be found in seide the help file at the following location NI-DAQmx Concepts >> NI-DAQmx Help >> Common Applications. From here you have a number of different subcategories to determine what type of flow chart you need to see.
You might also find the examples helpful located at "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Temperature"
In DAQmx you do not need to specifically state a multiplexing function, if you choose mulitiple channels then the driver multiplexes for you. i.e "SC1Mod1/ai0" will only get data from ai0, but "SC1Mod1/ai0:31" will automatically multiplex between all channels on a 1102B board apart from the CJC channel. So it will get data from channels 0 through 31.
I Hope this gives you a good starting point
Regards
JamesC
NIUK and Ireland