03-10-2014 11:29 PM
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
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.
03-11-2014 01:21 PM
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.
03-11-2014 01:55 PM
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".
03-12-2014 05:25 PM
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.
Data Acquisition and Signal Conditioning
Regards
Esteban R.
03-13-2014 07:07 AM
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.
03-13-2014 10:26 AM
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).
03-13-2014 10:53 AM
03-13-2014 12:23 PM
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.
03-13-2014 02:17 PM
07-26-2014 10:27 AM
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:
Here is a KnowledgeBase article discussing how to do this:
http://digital.ni.com/public.nsf/allkb/3296BA2AEF586B7386256D6D00528E3D