Steve,
Something that you could try is to monitor whether the device is plugged into the system or not using DAQ Device property nodes. What you can do is put a large IF statement around all of your code (before starting the task or configuring it), use the DAQ device property node to check if the device is plugged into the system. For example, I used the serial number to check if the device is plugged into the system and only then execute the entire task (input or output). Enclose all of this in a larger while loop.
While you are running the task, if you see the particular error that occurs when the device is unplugged, ignore the particular error but break out of your data acquisition/generation loop, thus getting into the larger outer loop. Now you are again checking to see if the device is plugged into the system or not. Only when the device is plugged into the system and completely recognized, start the data acquisition/generation loop again.
This is something I am just playing around with and I have to adjust for the time is takes for my device to be recognized every time I plug it into the system.
Hope this helps.
Regards,
Raajit L
National Instruments