DAQmx 19.1 and Later
There is now an internal task attribute for the task state (via lvgeneratedAttributes.cpp):
EXTERNC LVStatusCode kNILVAIExport kNICCall getTaskI32(
GenericRefObjSession taskID,
nNIDMXA::tAttributeID attributeID,
int32 * paramValue,
LStrHandle * extendedErrorInfoHdlPtr)
The attribute ID is kAttributeIDTaskInternalTaskState which is0x319A . The state attribute has these values (via nidmxa/enums.h):
enum tInternalTaskState
{
kInternalTaskStateNotVerified = 0,
kInternalTaskStateVerified = 1,
kInternalTaskStateReserved = 2,
kInternalTaskStateCommitted = 3,
kInternalTaskStateRunning = 4,
};
If you want to call it from a CLN(Call Library Function Node) in LabVIEW, your can configure it like below:
- Launch LabVIEW and create a new VI by selecting File>>New VI
- Select Window >> Show Block Diagram to open the block diagram.

- Right click on the block diagram and from the Functions palette that appears, go to Connectivity >> Libraries & Executables >>Call Library Function Node. Click on Call Library Function Node and drop it on the block diagram

- Double click on the Call Library Function Node to open its Configuration dialog.

- On the Function tab, write 「 nilvaiu.*」 as the Library name or path.
- Select getTaskI32 function from the Function name drop down menu.
- Select Run in any thread from the Thread box, and C from the Calling convention box.
- Switch to the Parameter tab.
This function returns an integer (the corresponding task state value), so set the return type as a Signed 32-bit Integer (Int32):
- Select return type from the parameter list on the left.
- In the Current parameter section, pick Numeric from the Type drop down box.
- Leave the Data type as the default Signed 32-bit Integer ( Int32).
This function takes in 3 integers and 1 string as parameters, so add these as inputs:
- Click on the plus sign + to add a new parameter. This will create a new parameter that defaults to a Signed 32-bit Integer (Int32) passed by Value.
Note: You can rename a parameter according to your preferences, this will not affect the way the DLL is called. In This example, the 3 integers will be named taskID, attributeID and value with their Data type set to Unsigned Pointer-sized Integer (uintptr), Unsigned 32-bit Integer (uint32) and Signed 32-bit Integer (Int32) respectively.
- For each integer, edit the Name and Data type as specified above. (Click the + button to add a new parameter)
- Click the plus + button to add last input, Name it as extendedErrorinfo. Pick String as the Type and String Handle as the String format
- Create necessary inputs /outputs and wire them accordingly.
- Create a control for attributeID with 319A as its value ( to be able to insert letter A in this control, click on the control created and open the property window. Change its Display format to Hexadecimal)

- Drop an Emply String Constant from the Function >> String palette on the block diagram, and wire it to extendedErrorinfo input.
- Create a Task in control and Task out indicator items and wire the Task in control to the call library function node's taskID input.
- Select the case structure from the Function >> Structure palette, and place it on the block diagram.
- Place the DAQmx Fill in Error Info function in the default case, and wire its status code, extended error information, and error input terminals, to the call library function node's Return type, extendedErrorinfo, and error output terminals respectively.
Note: The DAQmx Fill in error Info function is located in the DAQmx\Miscellaneous.llb library located at: (Windows 10 ) C:\Program Files (x86)\National Instruments\[LabVIEW version]\vi.lib\DAQmx\miscellaneous.llb
(Windows 11 )
C:\Program Files\NI\LVAddons\nidaqmx\1\vi.lib\DAQmx
- Right-click on the case structure and select Add Case Before from the pop-up window. Name it 0 and wire the error input to the error out indicator as shown below.

Before DAQmx 19.1
There is a public entrypoint in the DAQmx LV API that you can call to get the task state (via lvtask.cpp):
EXTERNC LVStatusCode kNILVAIExport kNICCall DAQGetTaskState(
GenericRefObjSession taskID,
int32* state)
The state out-param has these values (via nidmxa/enums.h):
enum tInternalTaskState
{
kInternalTaskStateNotVerified = 0,
kInternalTaskStateVerified = 1,
kInternalTaskStateReserved = 2,
kInternalTaskStateCommitted = 3,
kInternalTaskStateRunning = 4,
};
If you want to call it from a CLN, your configuration would look like this:
Follow the same steps as above but before DAQmx 19.1, the the Function name is DAQGetTaskState

This function takes in 2 integers as inputs and returns 1 integer (the corresponding task state value):


