Stephan,
As far as I'm concerned, this is not possible programmatically. The DAQ device number is a unique number assigned to each board to facilitate software calls through the NI-DAQ driver. The DAQ Device Number is usually the same as the PCI Device Number, but the PCI Device Number cannot be changed, and the DAQ Device Number can only be changed in MAX.
You can, however, change the NI-DAQ configuration file used by MAX. But you have to access the registry to do so. See example:
http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/334942e7223a04c58625696200602085?OpenDocument
You might also find interesting the following example that shows how to programmatically detect the device number of your PCI-6023E board:
http://zone.
ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/12284c844bea32b7862569420055be02?OpenDocument
Regards,
Azucena