Hi, there isn't a specific function to retrieve channel count for a specific device, you surely can build a lookup table to associate detected board type to number of channel of that device.
Another workaround could be to try to configure an acquisition on a specified channel (ai8-ai16-ai32...) and verify the task, until you get an error (something like -200170).
Hope this help.
Ciao.
NicolaC.
National Instruments