Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Reserve/Unreserve Task Resources

I've constructed a VI that utilizes a number of AI and DO tasks in multiple instances, only to run into the reserved resources error.  My plan to fix this problem is to reserve and unreserve the task resources using the DAQmx Control Task within the sub VI's, but there are a number of while loops that involve both AI and DO tasks.  My question is, what is the behavior of a task and its physical channels when it resources are reserved and unreserved during operation?  And when there are multiple while loops that involve different AI and DO tasks, is there a way to programatically wait for resources to become available?  Thanks in advance!  BTW, using a PCI-6224, though I'm not present to actually use it (working from a distance).

0 Kudos
Message 1 of 4
(7,313 Views)
woops, just realized i posted this in the wrong forum, sorry!
0 Kudos
Message 2 of 4
(7,306 Views)

The reserve command reserves all the resources that the task requires to run (most notably the sample clock).  The unreserve releases these resources for use by other tasks.  I'm not really sure what you meant by how it treats the physical channels, lets just suffice it to say that all reserved resources become freed.

 

With regard to waiting for the resources to free up I was looking for a property node that would output the state of the task but wasn't able to find one.  One thing that you could do is repeatedly try and start the task and check the error line to see if you are receiving a resources reserved error.  If you are just clear the error out so your program doesn't error out and go back to try and start again.

 

If your task is actually done and not just being unreserved you could use a DAQmx Event structure to go into other tasks - triggering when another task is done.

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 3 of 4
(7,302 Views)

Doug,

 

Thanks for the reply.  What would happen, say, if I had multiple while loops each with their own set of AI tasks and DAQmx Reads running continuously?  Attached is an example of what I'm thinking.  I'd run a while loop until the task is created, then run the while loops in succession using error as a sequencer.

 

Provided the amount of code I'd have to change to consolidate all channels to one task in my program, I'm looking for an easier way 🙂  Would this type of setup work, or would there be severe timing issues?

 

0 Kudos
Message 4 of 4
(7,298 Views)