Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Get "Resource Not Found" message on first attempt to run my application

I get a "Resouce Not Found, VI was stopped at node 0x554 of subVI "DAQmx Write..." message when I first start my application. The VI is set to run when opened, and after the error message I can hit the run arrow and it runs just fine. I have the PC set to run this application when it is booted. This does not happen on every re-boot, it seems to be hit and miss; I get the error on maybe 3 out of 10 re-boots. The application is very simple, I just sit in a loop and do two writes to a digital I/O card using DAQmx Writes. Any ideas on what I need to do to fix this?

Thanks,
Dave
0 Kudos
Message 1 of 5
(3,762 Views)
I expect that what is happening is that your VI is running before NI-DAQmx has had a chance to initialize itself which occurs shortly after the system has booted. Therefore, since it is not initialized, it reports that the resource (i.e., DIO channel) is not found. To work around this issue, I would change your VI such that it handles the "resource not found" error, sleeps for a bit to give NI-DAQmx a chance to finish its initialization, and then retries the operation.

geoff
--
Geoff Schmit
Huskie Robotics, FIRST Team 3061 Lead Mentor
http://team3061.org/
@team3061
Message 2 of 5
(3,750 Views)
Goeff,

Thanks for your reply. You are right about the initializing. This was my first attempt at working with a DAQmx function and after looking at some examples, I realized that I needed to add some better initialization. I added a DAQmx Create Task vi before the loop and DAQmx Clear Task after the loop and I no longer get the error message. Thanks again for your assistance.
0 Kudos
Message 3 of 5
(3,748 Views)
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
0 Kudos
Message 4 of 5
(3,739 Views)
By the way, this issue should be addressed in an upcoming release of NI-DAQmx. At that point, the workaround will no longer be necessary.

geoff
--
Geoff Schmit
Huskie Robotics, FIRST Team 3061 Lead Mentor
http://team3061.org/
@team3061
0 Kudos
Message 5 of 5
(3,714 Views)