Dear amlu,
Thansk for asking this question because I was planning to ask the same one today. I have the same requirements for getting available analog channels plus I also need to be able to get external counter/timer channels, if available.
For some parameters such as for available gains, you can attempt to set the parameter when you attempt to create a channel such as by calling DAQmxCreateAIVoltageChan(...) and then check to see what the value of the parameter parameter was actually set. Unfortunately, if you try to set a non-existent channel, you get an error returned and the executable or, in my case, the dll crashes. At least, it does so in the shipping examples that I've tried and in my own dlls.
If your program uses a graphic interface and if it is intended for interactive use only, you can use NIDAQmx_NewPhysChanAICtrl(...) followed by setting filter properties using SetPhysChanCtrlAttrib(...) to limit the list displayed in the pull-down list in the special text box that the channel control uses to get the list of available channels. Unfortunately, I haven't found a way to programatically get the list or the number of items in the list. In my case, I mostly want my dll to return an error and perhaps display a message with crashing. Fortunately, getting a list of available devices ort checking to see if a particular device is real and/or active is simple but I haven't found a way to do the same thing for available channels.
Message Edited by duncan carter on 06-06-2005 11:05 AM