Releasing Trigger Lines or PFIs Reserved by DAQmx

Updated Jun 20, 2023

Environment

Driver

  • NI-DAQmx

NI-DAQmx reserves certain resources like PFIs, RTSI lines or PXI Trigger Bus lines, when they are used to export a trigger or clock so that said resources are not double-driven, preventing potential device damage by returning an error in any task attempting to use a reserved resource. Resources reserved by a task will not be available to be driven by a different task. In the event you need a task to release a resource so it can be used by another, follow the steps outlined in this article.

There is not a specific method or call to release a reserved resource. You need to explicitly destroy the route following the next steps:
  1. Stop the task that initially reserved the resource.
  2. Remove the route by returning the corresponding trigger or clock property to its default value.
  3. Commit the tasks and/or restart it if needed.
  4. Reserve the resource by the second task.
  5. Commit and/or restart the second task when needed.
Note: there is not an explicit method to release a reserved resource. You need to explicitly destroy the route to make the resource available for a different task.

Note: this cannot be done on the fly because changing the route requires the task to be committed, so you'll need to stop all involved tasks, implement the change, and restart the tasks.

Note: refer to Task State Model in the Related Links section for more information about the committed state, and other task states.

Assume there are two devices in a system called Dev1 and Dev2. If you are exporting the start trigger from the first device to the /Dev1/PXI_Trig0 trigger line either using the DAQmx Export Signal VI or setting the task's Start Trigger: Output Terminal with a DAQmx Export Signal Property Node, and need to remove that PXI Trigger line from the task to export the trigger from a different device using the same line.
  1. Stop the tasks
  2. Write a value of /Dev1/ai/StartTrigger to the Start Trigger: Output Terminal of the first task, or even just write an empty string, which is the default value for the property.
  3. Commit the first task using a DAQmx Control Task VI or just start it (which implicitly commits the change). After that, the PXI_Trig0 trigger line will be available free for another device to reserve.
  4. Export the second task's trigger to /Dev2/PXI_Trig0
  5. Commit and/or start the second task as needed.