Make sure that "Device" and "Channel" names match the hardware. You can check the device name in MAX (Measurement and Automation Explorer).
The common reason for your error is that the "Device" and "Channel" name controls have been reset to the default values that doesn't match your setup.
Best regards,
Philip C.
National Instruments
- Philip Courtois, Thinkbot Solutions