LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

an Analog Input Task with Multiple Measurement Types

I can measure one set of data contain temperature and voltage. However, when I tried to measure two or more
temperatures, I could not make it.
I attach the sample provided in the forum.
0 Kudos
Message 1 of 8
(9,037 Views)
Wwert,

In order to measure multiple temperatures you can create a single DAQmx task and create virtual channels for each individual measurement. You can also create separate DAQmx tasks for each individual measurement, each with a single virtual channel, to further modularize the types of measurements that you would like to perform. The example VI that you attached illustrates this in practice.

A DAQmx task can be thought of as a measurement that you want to take. Intuitively, the task we are currently trying to accomplish is temperature measurement so we create a data acquisition task to accomplish this. A DAQmx task can be created either in LabVIEW or in Measurement & Automation Explorer (MAX). If you open up your attached VI and double click on the 'DAQmx Task Example_Configuration.vi' you can see that a single task has already been created. This task was created by right-clicking on the block diagram and following Functions->All Functions->NI Measurements->DAQmx -Data Acquisition->DAQmx Create Task.vi.

A virtual channel specifies the �real-world� reading that we want to take. For example, if we are taking our temperature measurements with a thermocouple, the physical channel, then we need to create a virtual channel to specify that physical channel. A virtual channel can also be created either in MAX or in LabVIEW. The voltage, temperature, and strain gage virtual channels were created by right-clicking on the block diagram and selecting Functions->All Functions->NI Measurements->DAQmx � Data Acquisition->DAQmx Create Virtual Channel.vi.

In this example a single task was created with multiple virtual channels taking multiple measurements (one for voltage, temperature, and strain). For detailed insight into the �DAQmx Create Task.vi� and the �DAQmx Create Channel.vi� make sure that you have enabled context help by clicking Help->Show Context Help. Hover your mouse over the VIs and click the link found at the bottom of the popup window for detailed help. If you have any other problems please post back! Good luck!

Craig H.
National Instruments
Message 2 of 8
(9,037 Views)
What are the pros and cons of creating a single DAQmx task with multiple channels veruses multiple tasks with a single virtual channel to take multiple measurements?
- Jimmy
0 Kudos
Message 3 of 8
(8,683 Views)

Hi Jxjimmy,

 

Let’s first make the difference between physical channel and virtual channel.  “A physical channel is a terminal or pin at which you can measure or generate an analog or digital signal. A virtual channel is a collection of settings such as a name, a physical channel, input terminal connections, the type of measurement or generation, and can include scaling information.” Creating a Virtual Channel in NI-DAQmx and using it in LabVIEW, also remember that a Local Virtual Channels is a Virtual channel created inside a task and Global Virtual Channel is a channel created outside a task. Advantages and disadvantages of creating: DAQmx task with multiple channels versus multiple tasks with a single virtual channel to take multiple measurements. The best place to find this information is in the LabVIEW help and the DAQmx help. The main concern between these two options are timing and triggering, in single task multiple channel sampling rate, sampling clock and triggering is homogeneous whereas multiple task will result in multiple rates for different channels.

 

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
Message 4 of 8
(8,656 Views)
Thank you, I'm not sure how to give you 5 stars, but it is a great response.
- Jimmy
0 Kudos
Message 5 of 8
(8,644 Views)
Hello I can not open the SubVI to see how to programmatically create a task,
add multiple types of DAQmx Global Channel, and that is exactly what I need
0 Kudos
Message 6 of 8
(8,244 Views)

In terms of a single VI featuring many tasks to read different devices, how do you pprevent them from interfering?

I've got a situation where I've got one task to read 8 thermocouples, and another task to read the analog input current of a different device. Each task is within it's own case structure, engage temp and engage current respectively. My program shows no errors and will happily provide me the required information if I am only engaging temp or only engaging current, however if both have been selected to be engaged then the current reading takes priority.

 

Why might this be the case?

 

My VI has the tasks set up similarly to this example https://decibel.ni.com/content/docs/DOC-32342, just less the DAQ log VI and with each create virtual channel VI in it's own case structure.

 

Many thanks

0 Kudos
Message 7 of 8
(5,877 Views)

Where can I get the DAQmx task example_configuration.vi? Also it appears tha NI-DAQ has not loaded since I do not see the DAQmx VIs in my controls palette

 

0 Kudos
Message 8 of 8
(4,929 Views)