Create new VI to acquire data from a thermocouple sensor.
To create a virtual channel and acquire data from the thermocouple sensor, Firstly we need to create and select the virtual channel for acquiring the data from the sensor.
Switch to block diagram and add the DAQmx Start task.vi. (Fig 1)
DAXmx Start task.vi
The DAXmx Start Task.vi is used to switch tasks to running state to begin the generation or measurement of the values. (Fig 2)
The Task/Channels in Terminal input must be given.
Creating a virtual channel with NI Max.
To create a virtual channel to acquire the values from the thermocouple Right-click on the Task/Channels in Terminal and Select the Create Constant. (Fig 3)
Now click the down arrow button and click Browse the select items window will be prompted. (Fig 4) and click create a new button and select project MAX.
The create new window will be prompted. And from the window select the Aquire Signals and from that select the Thermocouple. (Fig 5)
Select the Thermocouple and click next. (Fig 6)
Select the ai0 and click next. And enter the name of the task and click finish (Fig 7). The DAX Assistant window will be prompted. (Fig 8)
In the DAQ assistant window select the range of the thermocouple and the type of the thermocouple and if required simulate and view the out from the virtual channel created by DAQmx and click OK.
Now add the DAQmx read.vi to the Functional block diagram.
Now connect the error wire and the task wire from Start Task.vi to read.vi.
TheDAQmx read.vi is being used for reading the sample data from the Analog 1channel 1 sample.
Now add and connect the DAQmx clear task.vi to the Block diagram.
DAQmx Clear task.vi
The DAQmx clear task.vi is used to abort the running task and clearing the task and once the task is cleared it can only be recreated.
Now add the simple error handler vi and connect the error to it.
Find the error handler vi using the following fig.
Simple error Handler.vi
The error handler vi displays the error message and error code which are caused during the run-time simulation of the program.
Now add an indicator to display the current temperature for that Firstly create an indicator using from the panel. And add to the front panel. (fig 10)
After adding the indicator to the front panel connect the indicator the output data terminal from the DAXmx read.vi in the block diagram.
Now go to the front panel and run the VI. The current temperature will be displayed on the indicator. after running the vi the following fig is the output. (Fig 11)
Thus creating the project and acquiring value from the DAQ device is being done.