Error -201133 with NI 9401 in NI-DAQmx When Running Multiple Digital I/O or Counter Tasks

Updated Oct 29, 2018

Reported In

Hardware

  • NI-9401

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

The product page for the NI 9401 states that the NI 9401 is "Bidirectional, configurable by nibble (4 bits)," but when I try to run multiple Digital I/O (DI/O) or counter tasks in LabVIEW using NI-DAQmx, I get the following error:
Error -201133
Possible reason(s):

Device cannot be configured for input or output because lines and/or terminals on this device are in use by another task or route. This operation requires temporarily reserving all lines and terminals for communication, which interferes with the other task or route.

If possible, use DAQmx Control Task to reserve all tasks that use this device before committing any tasks that use this device. Otherwise, uncommit or unreserve the other task or disconnect the other route before attempting to configure the device for input or output.


Why is this happening and how can I configure my 9401 to run multiple DI/O or counter tasks?

Solution

This error occurs because digital lines on the device are being reserved in the wrong order due to the execution timing of LabVIEW. In order to avoid seeing Error -201133 when configuring the NI 9401 in NI-DAQmx for multiple DI/O or counter tasks, all tasks but one must be reserved. Subsequently, the unreserved task must be started first, as seen below.

Additional Information

In this case, two digital tasks and one counter task are being run simultaneously. Two tasks are put into the reserved state by using DAQmx Control Task. Then, the one unreserved task is started prior to starting the two reserved tasks.

Keep in mind that the lines for the 9401 have to be configured as an input or output by nibble and not by individual line. This means that whether you are using counter or DI/O tasks, lines 0-3 (nibble 0) must all be configured together as either input or output and lines 4-7 (nibble 1) must all be configured together as either input or output.

If the default PFI line for the counter output resides on a digital input nibble, an error will occur in the NI-DAQmx Start Task VI for the digital input task due to nibble 0 already being reserved for a counter output task. This can be avoided by using a NI-DAQmx Channel Property Node to specify a PFI line on nibble 1 for the counter output.

See Configuring an NI 9401 for Bidirectional DI/O By Nibble with DAQmx for an example demonstrating the bidirectional configuration and the capability to independently control the execution timing of each nibble.

See Configuring Nibble DI/O Configuration for Triggering with NI 9401 for an example utilizing the nibble configuration to trigger an analog task.

WAS THIS ARTICLE HELPFUL?

Not Helpful