Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring multiple thermocouple channels simultaneously via 9213 (with 9171 USB)

Solved!
Go to solution

Hi Matthewcc

 

I have read most of your post and I will like to ask you some questions if you do not mind:

 

How many thermocouples have your application?

 

How many J and T thermocouples do you have?

 

Which is the sample rate required for one channel in this application?

 

Specifying Different Sample Rates for Multiple NI CompactDAQ Modules

 

For example, if you are using an NI-9211 Thermocouple Module (Max sample rate = 14S/s), an NI-9201 A...

 

I think it is not possible to assign different thermocouples types to each channel on the same task, but depending of the sample rate required we could group all the J thermocouple in a task. Then stop the J thermocouple task and start a T thermocouple task. That way we will always have one task with the same thermocouple configuration.

 

Another workaround will be to acquire the voltage data without the scaling and the programmatically scale the data ourselves, this will require more code but will allow to have more control on your data.

 

 The NI 9213 does not allow simultaneous sampling so it only has on ADC so if there is a task using one channel you might not be able to create or open another task for this same module.

 

Which cDAQ chassis are you using? How many NI 9213 do you have on that chassis?

 

Regarding the time stamp:

 

Which is the execution rate of your while loop? Which is the sampling rate configuration in your application?

 

If you have two NI 9213, I might recommend you to use one module for all the J thermocouples and the other module for all the T thermocouple. That way you could have two tasks running in parallel without problem.

 

I am not familiar with your application but I think that you could still improve the application and the code in order to use just one computer.

 

Regards

Esteban R.

0 Kudos
Message 11 of 24
(5,778 Views)

Thank you for your response Esteban.  I have a variable number of J and T type thermocouples.  I am running learning experiments where I will be investigating different thermocouple types and mounting methods.  I believe the program as written will configure each channel individually, but I have not yet populated the 9213 with 16 thermocouples to try it out (so far just using 1 J-type and 1 T-type).  The number of thermocouples I may use for any given experiment will fluctuate so I wanted to create a robust program that could handle any configuration.

 

Typically I sample at 1 per second, but I would like the ability to configure to high speed collection.

 

On this particular computer in the lab I am running a separate Labview program that is using a 9174 with two modules, one being a 9213.  That program is currently too advanced for me to change as I do not understand how it initializes the communication.  I have been working with a 9213 connected to a 9171, and if I plug into the computer before I start the other program I mess up its communication.

 

I have plenty of work arounds, but I would like to understand why my program is not working as intended and how to simplify and streamline.  I attempted to start with example programs so as to start with a good base upon which to modify.  As described earlier, the program has become more complicated and the most recent modification (open front panel) altered the program in such a way that I do not understand all the functions.

0 Kudos
Message 12 of 24
(5,772 Views)

I would also add that the VI block code that Labview generated seems wasteful of resources, as it opens and closes the task each time the loop runs.  I am going to continue to study the Labview generated code and use that to modify the earlier example "thermocouple-continuous input".

0 Kudos
Message 13 of 24
(5,764 Views)

Hi Matthewcc

 

If you are going to program a task with a single type of thermocouple you might be able to modify the example code that is located in the NI example finder.

 

LabVIEW help » Find examples… » Hardware input and output » DAQmx » Analog input » Thermocouple - continuous Input.vi

 

But if you want to create a task in which you will have mix types of thermocouples I might recommend you to use a voltage example and programmatically condition and scale the signal depending of the number and type of thermocouples.

 

LabVIEW help » Find examples… » Hardware input and output » DAQmx » Analog input » Voltage – Continuous input.vi

 

The second recommendation would be that since National Instruments has  LabVIEW and DAQ & Signal condition courses available, it would be beneficial for you to improve your programming skills, and that might help you to accelerate the developing process of your application.

 

 

NI Training and Certification

 

LabVIEW Core 1

 

Data Acquisition and Signal Conditioning

 

 

Regards

Esteban R.

0 Kudos
Message 14 of 24
(5,753 Views)

I concur and am proceeding along that path.  As you will see from my post on 3/4 I have tried using the NI example of thermocouples - continuous measurement.  I plan to modify that VI block code with some code from my alternate development path posted on 3/7 which achieves the flexibility but is not streamlined.  When I started the post I wasn't sure what was possible, but I have continued the thread to document my learning so that if someone else searches on this topic they will be able to see what I have learned coming in as a complete novice of the current software version.

0 Kudos
Message 15 of 24
(5,746 Views)

I have attached my latest version of the VI block diagram.  For simplicity it only allows one input configuration for all channels on the module.

 

The part I do not understand is why the DAQmx read in the first loop returns null data.  I have had this problem earlier, but it didn't make sense.  The DAQmx read in the second loop should be identical, and it reads just fine.  The first loop is the first tab and allows me to select the proper device before proceeding to my regular data collection on the second tab (the second loop).

 

0 Kudos
Message 16 of 24
(5,740 Views)
Can you post an image of your block diagram. I don't have access to LabVIEW right now and your description is very confusing. I don't understand why you would have more than one DAQmx Reads. I also don't understand the reference to tabs. A simple design would have a single configure channel function inside a for loop and simply pass in an array of channel numbers and thermocouple types. This would pass the task via a shift register to a single DAQmx Read.
0 Kudos
Message 17 of 24
(5,733 Views)

My intention with the tabs was to have the user select the correct NI module among those connected to the computer before saving any data.  If I misunderstood how to assign a device name, then perhaps I don't need a loop for that part, but I am using this to build a self-executable and need the freedom to select a device name that I do not know a priori.  This also allows the user to determine all the proper settings before passing them to the main data acquisition part of the program.

 

The other thing I just realized after running on my lab computer is that the VI takes 50% of my available processor power.  I remember seeing code somewhere in the examples about limiting the frequency of file writes to every nth loop.  If you know where that example is, I would appreciate the direction.  Hopefully it is due to the file writing and not some other feature.

Download All
0 Kudos
Message 18 of 24
(5,726 Views)
That first loop appears to do nothing. It certainly does not allow for the selection of different types. All that you need in a loop that allows for the user to select before acquiring, is an event structure. If you follow my advice and have arrays for types and channel, then when you press 'go', acquiring can occur. This is the type of code that the DAQ Assistant generates with multiple channels of different types.

Also, be cautious of continuous supposition and the Write to Measurement File. It can cause errors if you don't read fast enough.
Message 19 of 24
(5,714 Views)
Solution
Accepted by topic author matthewcc

Hello,

 

Just wanted to make sure you know that you can assign different thermocouple types to each channel in a single Task, all you have to do is wire multiple DAQmx Create Virtual Channel VIs in sequence at the start of your code.  Place all your J type channels in one Create Virtual Channel and specify the type of TC to be J type:

 

tc types.PNG

Here is a KnowledgeBase article discussing how to do this:

 

http://digital.ni.com/public.nsf/allkb/3296BA2AEF586B7386256D6D00528E3D

 

 

 

 

Mason M
Applications Engineer
National Instruments
0 Kudos
Message 20 of 24
(5,545 Views)