The best way to get this error is to accidentally use the wrong device number in your program. Double check what the device number is for your card inside MAX under "Devices and Interfaces," Then make sure this is the same number you are using in your program. I hope this helps!
Russell
Applications Engineer
National Instruments