Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage readings with 6034E card and CB-68LP board

I am using a PCI 6034E card with CB-68LP on a computer with Windows XP and LabVIEW 7.1.  My goal was to measure a voltage reading and a couple temperature readings on the CB-68LP.  Not being able to figure out how to write the LabVIEW program to read and save both temperature and voltage I decided to read them all as voltages.  This is where I seem to be having a problem.  My voltage readings for my type K thermocouple do not match up with the conversion data that I downloaded from NIST. (http://srdata.nist.gov/its90/download/download.html)  I keep getting that room temperature is about 0 deg C and that my body temperature is about 8 deg. C.  I have tried it using differential, RSE and NRSE and they have all given the same results.  If I can not read the voltage of a thermocouple correctly then how do I write a VI using DAQ Assistant and Write LabVIEW Measurement File correctly get obtain the data that I want.

Thank you.

William Gorman
0 Kudos
Message 1 of 15
(4,363 Views)
Unless you have a cold reference junction this is exactly as it should be. See (for example) http://www.omega.com/techref/thermoref.html for an explanation.

OTHERWISE you could make a perpetual motion machine...
0 Kudos
Message 2 of 15
(4,353 Views)
Thank you.  When I was measuring Temperature instead of Voltage it was smarter than me and I didn't have to worry about that.  Is there a way to measure temperature from one pinout (Ai0) and voltage from another (Ai1).  This would make things more simple.  The program that I have written right now uses the DAQ Assistant and the Write LabVIEW measurement file with a waveform in the middle so I can see what is going on.  It seems that I can only have the DAQ Assistant reading one particular thing, only voltage or only temperature.  If I add another DAQ Assistant they won't run simultaneously because of task errors.   I have learned that you can not run more than one task through the same card at once.  Is there a way to write the program so it will read temperature and voltage or is reading all voltages my only answer?
0 Kudos
Message 3 of 15
(4,349 Views)
The answer to your problem is to not use the DAQ Assistant. If you use the lower level DAQmx functions, all you need is two different DAQmx Create Channels. One for the voltage channels and one for the temperature. You would use the same task throughout and the DAQmx Read will get all three. Here's something slightly modified from the shipping example called Acq Thermocouple Sample.
Message 4 of 15
(4,346 Views)
Dennis,

Here is what I did and here is where I am having issues.  I created the block diagram that you gave me (much thanks) except I did not include the DAQmx Clear Task (do I need this?).  Instead I included the Write LabVIEW Measurement file and from the DAQmx Read I connected 'data' and 'error out' to 'signals' and 'error in' respectively.  Then the 'error out' of the Write L.M.F went to the error handler that the Clear Task was connected to.  Then I enclosed everything in a While Loop.  Here are the issues.  I don't know if it is a big deal but I could not find the pull down 'Ok message and warnings' box that is connected to the error handler.  The major issue that I am having involves the amount of data it is saving.  It writes a data point about every 0.00002 seconds.  Is there anyway to change this.  Nothing that I have done has seemed to work.

Attached should be the block diagram that I have created to clear up my confusing explanation.  Thank you again.

William Gorman
0 Kudos
Message 5 of 15
(4,327 Views)

There are a lot of options for saving data and many of them are in the shipping examples. It all depends on your needs. Do you want to run for a while and then save everything, save a snapshot periodically, acquire/average and then save?

p.s. It's a good idea to put the DAQmx Create Channel functions outside the loop because you don't need to do this every iteration. I don't see the timing or start task functions but they should be outside the loop as well. You should also put the Clear Task outside the loop as well so that this is done when the loop terminates.

0 Kudos
Message 6 of 15
(4,313 Views)
Dennis,

Thanks again for the advise.  I read through the examples and figured out how to get it to work.  You did mention that there was a way to average some acquired data and then save it.  I could not find anything about that in the examples.  The way I have it setup will work but if the answer is simple, how would I go about averaging the data before I saved it?  My idea would be to count at a higher rate and average the data to be displayed at a lower rate.  What I mean by this is I would acquire data every 0.001 second and then average 10 data points so that it was being saved for every 0.01 second.  Essentially a single data point saved would be 10 averaged.  The averaging examples didn't seem to be able to do that.

William Gorman
0 Kudos
Message 7 of 15
(4,294 Views)
William,

Thanks for posting to the NI Forums.  I also want to thank Dennis for being extremely helpful.  Dennis is a Proven Zealot for a reasonSmiley Very Happy  You are correct, the method you mentioned is one very common way to get averaged data.  In fact there is an express VI that does this very thing called the Sample Compression Express VI.  This VI will take your waveforms and reduce the number of samples by some specified factor using one of the methods available (i.e. Minimum values, maximum values, last, mean, or median).  Good luck with your application.

Regards,

Neil S.
Applications Engineer
National Instruments

Message Edited by Neil S. on 01-05-2007 02:23 PM

0 Kudos
Message 8 of 15
(4,282 Views)
Neil,

Thank you for pointing me in the direction of the Sample Compression.vi.  It does exactly what I want it to.  The one thing that I was trying to figure out how to change was the Reduction factor.  I know that if  you pop up on the Sample Compression.vi and go to properties that you can change it there, but is there any way to make it so that I can control it from the Front Panel.  I can get it as a control on the Front Panel of the Sample Compression.vi but I don't know how to save it so that I have a terminal to link to when I add it to my Block diagram.  Do I have to recreate the Sample Compression as a new sub vi or is there an easier way?  Should I just stick with the original and take the extra 20 seconds to go to my Block diagram to pop up on it?

William Gorman
0 Kudos
Message 9 of 15
(4,254 Views)
William,

You will need to convert the express VI into a normal sub VI and then add the size control to the new sub VI.  Use the following steps as a guide:

  1. Right click on the Sample Compression express Vi and select Open Front Panel
  2. Click Convert
  3. Open the block diagram
  4. Right click on the size constant and select Change to Control
  5. Go to the front panel
  6. Right click on the icon and select Show Connector
  7. Click a desired terminal and then click on the new size control
  8. Save the SubVI.  (preferrably in the same location as your main VI)
  9. The VI in your main VI should now have the size as one of the terminals and can be wired to a control on your main VI's front panel.
Let me know if you have any questions about taking this approach.

Regards,

Neil S.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 15
(4,247 Views)