Sorry, I wasn't clear. I wasn't actually suggesting that your VI needs to initialize NI-DAQmx. Rather, the issue is that NI-DAQmx hasn't had an opportunity to initialize itself. After the system boots, NI-DAQmx needs some time to figure out what hardware is installed in your machine and how it is configured before it is ready for VIs to start using that hardware.
While you may no longer be encountering the error, I would not be surprised if it still appears intermittently. By adding the DAQmx Create Task and DAQmx Clear Task VIs, which probably aren't necessary in your application, you've simply delayed the invocation of the DAQmx Write VI. While this delay may decrease the probability of encountering the issue, it doesn't solve the issue.
A more robust solution would be to add some code after the first invocation of the DAQmx Write VI to recognize the "resource not found" error, invoke the Wait VI, and then invoke the DAQmx Write VI again. Of course, you would want to code an additional timeout such that if the hardware really isn't installed, you VI doesn't try forever. For example, you could wrap the DAQmx Write VI and the Wait VI in a for loop to accomplish this.
I hope this is more clear.
geoff
--
Geoff Schmit
Huskie Robotics, FIRST Team 3061 Lead Mentor
http://team3061.org/
@team3061