NI Home
Cart Cart | Help
Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Currently Being Moderated

Using a DAQmx Task in LabVIEW

VERSION 4

Created on: Sep 15, 2008 6:45 AM by Dan King - Last Modified:  Feb 18, 2009 6:28 PM by Dan King

REQUIREMENTS:
Application Software: LabVIEW Base Development System 8.2
Driver Software: NI-DAQmx 8.7.1
Hardware Family: CompactDAQ, Multifunction DAQ (MIO), PXI/CompactPCI, Portable DAQ
Add-on Software: LabVIEW FPGA Module 8.6
Product Category: LabVIEW
Development Topic: Analog I/O, Analog Input
Industry: ATE/Instrumentation
Application Type: Angular Velocity
Technology: Bluetooth

This VI is a very simple bit of example code that uses a task created in Measurement and Automation Explorer (MAX) and acquires data.

 

DAQmx Task.jpg

 

The task shown here is what is being used in this example.  In this case, because the task is only performing a finite acquisition the read is only performed once, instead of within a loop.

 

DAQmx Task Block Diagram.jpg

 

Performing a continuous read, would of course, require the use of a while loop with a stop condition around the DAQmx Read VI.

 

Tasks in MAX can be used in LabVIEW very simply.  You can either drag a task from MAX straight into your block diagram or you can place a Task Constant from the functions palette. The Task Constant can be found under Measurement I/O»NI-DAQmx. From here all you need to do for an acquisition task is connect the task to a DAQmx Start VI and then to a DAQmx Read VI and then to a DAQmx Stop VI.

 

There are benefits of using a task from MAX instead of using a DAQ Assistant

  • You can control when the task starts and stops.
  • You can easily use the same channel setup in multiple instances/VIs
  • You can edit some aspects of the task for a particular instance/VI without changing the setup of the task.

There are also benefits of using a task from MAX instead of setting up your task completely in LabVIEW

  • You can set up multiple channels, scales, timing and triggers outside of LabVIEW, cleaning up your code.
  • It is easier to port task information between different VIs.

 

Downloads:
Average User Rating
(0 ratings)




There are no comments on this document

More Like This

  • Retrieving data ...