LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange DAQmx Timing Source Timed Loop Error

Solved!
Go to solution

I have a digital edge counter fed into a timed loop. Everything works fine until I stop the loop, and stop the DAQ task. Once I restart the loop it fails with "resource is reserved". Attached is my code.

 

Thanks

0 Kudos
Message 1 of 10
(3,284 Views)
I've done some experimenting, it seems that if the VI is stopped, some kind of internal resource is released. I could not find a VI that releases any such resource related to timers or timing sources. Does anyone have any information on this?
0 Kudos
Message 2 of 10
(3,280 Views)

Hi there

 

Please post some code so we can have a deeper look.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 3 of 10
(3,261 Views)

Here is a piece of code to illustrate the issue. If the timing source is created in the loop (it will be created each loop iteration) the error occurs. If it is moved outside the loop, and only created once the issue is resolved. Is there a way to RELEASE the timing source so that it can be created again? If the VI is stopped, this "resource" is released. I want to programatically release it.

 

Note the error comes from the timed loop Error terminal that is Probed (50).

Message Edited by bkb on 10-08-2008 09:52 AM
Message Edited by bkb on 10-08-2008 09:53 AM
0 Kudos
Message 4 of 10
(3,257 Views)
No, this is only a picture of a piece of code. Please post some code, this will help us to solve your problem.
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 5 of 10
(3,251 Views)

There is nothing else required to post that illustrates the problem. Everything that contains a properly illustrated problem is in the previous post.

0 Kudos
Message 6 of 10
(3,245 Views)
The whole point of this is that I need to change the Edge count on my timing source while the program is running. I fail to see how you cannot determine the problem based on my code snippit ts.jpg.
0 Kudos
Message 7 of 10
(3,236 Views)
Here is a VI (click the stop button to generate the error)
0 Kudos
Message 8 of 10
(3,221 Views)
Solution
Accepted by topic author bkb

I believe the problem is that when you configure a Timed Loop to use a DAQmx Task as its timing source, the Timed Loop is automatically set up to start the task when the loop starts. Here, you don't seem to ever stop the Counter task before restarting the Timed Loop. So the second time you run the Timed Loop, it tries to start the Counter task again, and sees that a task is already running with that resource (from the first Timed Loop run).

 

If you use the Stop Task function for the Counter task after stopping the timed loop, you should be able to restart things.

Jarrod S.
National Instruments
Message 9 of 10
(3,203 Views)
Thanks, can't believe I didn't try that.
0 Kudos
Message 10 of 10
(3,196 Views)