Error -89137 When Using Multiple NI-DAQmx Tasks

Updated Sep 25, 2018

Reported In

Hardware

  • Multifunction I/O Device

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

I am programming multiple tasks in an NI-DAQmx device, however I am getting the following error:
Error -89137: Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

How can I fix this error?

Solution

The error is caused by the impossibility of routing the reference clock to all the created DAQmx tasks.

This error can occur any time separate tasks require access to a shared resource. Therefore it is important that you check to make sure you don't have any unexpected LabVIEW or DAQmx tasks running while you are running/troubleshooting your VI.

If you plan to use multiple subsystems like AI, AO, DIO, or Counter at the same time, you must define the same reference clock for ALL the tasks you are creating, using the NI-DAQmx timing properties Reference Clock Rate and Reference Clock Source, which should be set before any other channel configurations (such as triggering and timing).

In order to set these properties, you need to call the appropriate API based on your development environment:
  • If you are programming in LabVIEW, you should:
  1. add a DAQmx Timing Property Node after channel creation
  2. right-click the property node and select Add element
  3. select More:Reference Clock:Rate Property and More:Reference Clock:Source Property, as shown in the image below (an example is also attached):
  1. set RefClk.Src input to the Source Terminal value that was indicated by the error message, for example PXIe_Clk100 (thus, RefClk Rate input should be set to 100 MHz in this case)
  • If you are programming in LabWindows™/CVI, you should add the following functions to your code, after channel creation and before configuring task timing:
DAQmxErrChk(DAQmxSetTimingAttribute(TaskHandle,DAQmx_RefClk_Src,"PXIe_Clk100")); 
DAQmxErrChk(DAQmxSetTimingAttribute(TaskHandle,DAQmx_RefClk_Rate,100000000.0)); 

 
 

Additional Information

The reference clock can be set either implicitly or explicitly. When using a reference clock with NI-DAQmx devices, the same reference clock must be set for every task on that device.  If the reference clock is not explicitly set, the first task to commit will implicitly define the reference clock for the whole card. Thus, if another task tries to explicitly set a different reference clock later, that clock will try to use the reference clock circuitry which is already in use by the first task.

This can also manifest when using channel expansion on certain DSA, S Series, and simultaneously sampling X Series cards. This is because the channel expansion synchronization is completed using a reference clock from the chassis.
 

WAS THIS ARTICLE HELPFUL?

Not Helpful