The reason is: Specified operation cannot be performed when there are no devices in the task.
The VI works good in development system. How its exe vi shows this error. The VI includes usb 6001 and NI 9266 (with cDAQ-9171). The error occurs for both DAQ when execute DAQmx Timing (Sample Clock) VI. The source input of sampling clock VI is leave unwired, so the source is the default onboard clock.
Solved! Go to Solution.
Could you please provide us with a bit more context about your application?
At which point during the execution of your application the error occurs?
Is this occurring in a particular VI, or is it occurring across multiple VIs in your application?
Are you running the executable on this same machine, or in a different one?
The error occurs when executing sample clock.vi in create a task VI using NI 9266. Same error occurs when create task VI using USB 6001.
In the picture, you can see I put an error indicator before sample clock.vi. This indicator verify the error occurs at this vi.
Yes, I running the executable on this same machine.
Can you post the actual vi, preferably saved back to an earlier version? (I for one would need it saved back to 2016 or earlier.) I tried to generate your -200477 error by feeding invalid physical channel into DAQmx Create Virtual Channel.vi, but the error codes I got were different.
First point: according to your screencap, your error occurs *before* the call to DAQmx Timing.vi
Second point: you've shown us a specific case where an AO current task is supposed to be configured. We have no way of knowing where it gets its inputs from or even whether that's the case that executes. What are the other cases of that case structure?
I had attached actual VI in 2016 version for your review.
For the first point you mention, the error occurs *after* the call to DAQmx Timing.vi.
Ok, now I notice *both* error indicators, one before and one after DAQmx Timing.
As posted, the front panel array of 'Enable' booleans is an empty array. Indexing an empty array gives you the default value for the array element. In the case of a boolean, all indexed values come out False. Thus no channels (or devices) are added to your task.
When I run it, I got the same -200477 error. As soon as I populated the array with any True values, I (correctly) got a different error because I don't have the hardware device specified in your code. If the code that calls this subvi sends in an empty array or an array with all False values, that would explain your error.
You are correct. When build application, a data file was not included in the source. This cause a empty array pass to VI when ini the data. There is error warning if the data file was not found. But for some reason I clear the error.
Thank you so much for you great job.