- 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 DAQGetTaskState function from the Function name drop down box.
- 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 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 if you would like, this will not affect the way the DLL is called. In This example,
the 3 integers will be named taskID, attributeID and value with Data type set as Unsigned Pointer-sized Integer (uintptr),
nsigned 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 plus button to add 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 control for attributeID with 310A 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 palette>> 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
C:\Program Files (x86)\National Instruments\[LabVIEW version]\vi.lib\DAQmx\miscellaneous.llb
- 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.