Error -200088 when Calling DAQmx API in LabVIEW

Updated Jul 26, 2023

Reported In

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

  • I have successfully configured my DAQmx Virtual Channels and started the DAQmx task, but I am receiving Error -200088: Task specified is invalid or does not exist when I try and read samples from my DAQ device.
  • I have a TestStand™ Sequence that calls into LabVIEW™ VIs that utilise the DAQmx API. The DAQmx Create Virtual Channel VI is producing error -200088. How can I fix this?
  • I am using DAQmx VIs in my LabVIEW code. The code runs successfully once but after this, I am receiving error -200088. Why is this happening?

Solution

This error can occur for multiple reasons. Work through the steps outlined below to resolve this issue:

1. If the DAQmx task is successfully initialised and started, but this error occurs when trying to read or write samples, this indicates that an empty task handle has been connected to the DAQmx Read or DAQmx Write VI. 
  • Check the logic of the program to ensure that the initialisation state is not being skipped, or that the task is not being cleared prior to the read/write.
2. If the LabVIEW code consists of Case Structures or Event Structures that pass the DAQmx task handle, ensure that Use Default Value if Unwired is not checked for the output terminal.
  • See the figure below for an example.
  • Instead of using the Use Default Value if Unwired terminal, ensure that the DAQmx task handle is directly wired through all structures and cases.
 
  • In this example, since Use Default if Unwired is checked, depending on which case is executed prior to this code, the default value for the task handle will be passed to DAQmx read, which could be an empty task handle. This will result in error -200088.
3. If the DAQmx task handle is being passed over Shift Registers in a Functional Global Variable (FGV), consider the points in Storing DAQmx Task Handle in Shift Registers.
4. Ensure that the DAQmx task handle is not being retrieved or stored in a LabVIEW Local or Global Variable.
  • Local and Global Variables can introduce race conditions and it can be almost impossible to monitor when they are being updated. Instead, directly connect the DAQmx task handle between DAQmx VIs.
  • To better understand the risks of using Local and Global Variables, refer to Using Local and Global Variables Carefully.
5. If none of the steps above resolve the error, repair or reinstall the NI-DAQmx driver by following Repair Software In NI Package Manager (NIPM).