There are three ways to configure tasks in NI-DAQmx Base.
The first method, which is preferred, involves dynamically creating the task using DAQmx Base Create Task VI followed by the DAQmx Base Create Virtual Channel VI. The steps to do this are listed below with the resulting block diagram in figure 1:
- Create empty task using DAQmxBase Create Task.vi
- Create a Thermocouple (TC) temperature measurement channel using DAQmxBase Create Virtual Channel.vi.
- Specify the hardware timing parameters using DAQmxBase Timing.vi
- Start the acquisition using DAQmxBase Start Task.vi
- Read N samples using DAQmxBase Read.vi and Plot it. By default, the Read VI reads all available samples, but you can specify how many samples to read at a time and the timeout value. Continue reading data until the stop button is pressed or an error occurs.
- Stop the task using DAQmxBase Stop Task.vi
- Clear the Task using DAQmxBase Clear Task.vi
- Use the pop up dialog box to display an error if any.
Figure 1: DAQmx Base Thermocouple Example
Programming data acquisition with NI-DAQmx Base for Linux is analogous to NI-DAQmx. The NI-DAQmx Base VIs have all the same input and output terminals. The user can open each VI and tunnel down to the lowest level which leads to the RLP node. These RLP nodes call into chip objects for the hardware used. These RLP nodes are closed source. If personal modifications happen to break the driver, National Instruments recommends reinstalling the driver as it is not possible to support personal modifications.
The second and third methods both use the NI-DAQmx Base Configuration Utility; the difference between the second and third method is how the utility is launched and used.
To use the second method, launch the NI-DAQmx Base Task Configuration Utility from the Tools menu in LabVIEW. Launching the utility from the Tools menu in LabVIEW includes any other tasks that may be in memory in LabVIEW at the time the utility is launched. Any changes made with the LabVIEW launched utility immediately takes effect in LabVIEW and on any C program launched after the utility is exited.
The third method involves running 'mxbaseconfig' from the command line. The 'mxbaseconfig' command opens the NI-DAQmx Base Task Configuration Utility. The utility saves its data to the same configuration file as the LabVIEW launched version, but changes made with this version are only be seen in LabVIEW if LabVIEW is restarted.
Figure 2: NI-DAQmx Base Task Configuration Utility