LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Log temperature data to Excel every 4 hours

Solved!
Go to solution

 

Another seemingly simple question, I have four thermal couples attached to a NI 9211 4ch Module.  I would like to be able to monitor the temperature real time on the front panel and then every 4 hours write the current values to Excel with a time and date stamp.  Just like a data logger would do at a set time interval.  This seems so simple but after hours of reading and tutorial videos I can’t seem to get anything to work the way I want.  Any guidance would be greatly appreciated.

 I have pressure gauges and a switch counter in my VI also attached to a NI9205.

Thank you,

Chad

 

 

 

Temp recorder.jpg

0 Kudos
Message 1 of 13
(4,316 Views)
The placement of the Write to Measurement File makes no sense. You would only write when the inner loop is stopped and you aren't even passing it any of your signals. Have you tried using an Elapsed Time function connected to a case statement with the file write inside of that?

You are using the evil dynamic data type. Are you only taking a single sample with the DAQ Assistant?

p.s. Absolutely no need for multiple stop buttons.
0 Kudos
Message 2 of 13
(4,309 Views)

As you can probably tell I’m pretty new to Labview programing.  The write to file VI I have in the outer loop just counts how many times a reed switch is actuated.  I found that code in an example online, there is probably a more efficient way of doing it but it works for what I want it to do.  Not sure how I would wire it differently without Dynamic data I’m taking continuous samples with the DAQ Assistant.  If I could figure out a way to also write my temperature readings to that same file that would be great but not sure if that’s an option.  Thank you for your help.

0 Kudos
Message 3 of 13
(4,292 Views)

As far as the mutiple stop buttons.  I want only one but every time I tried to wire them together in differnt ways or remove either one  it would give me an error.

0 Kudos
Message 4 of 13
(4,291 Views)
Delete stop 2. Wire the other to where you had the second wired. Or, wire the stopped output of the DAQ Assistant to that place.

If your assistant is configured to multiple samples, it seems silly to discard most of the samples by writing the dynamic data to scalar indicators. Why don't you take advantage of multiple samples and take the Mean?
0 Kudos
Message 5 of 13
(4,275 Views)
I guess I'm not sure what your saying by just taking the mean of the mutiple samples. Each channel is from a differnt sensor when I think of taking the mean I think of it being like taking the average. I want to know what value each sensor is putting out. Am I misunderstanding the word "Mean"?
0 Kudos
Message 6 of 13
(4,253 Views)
The mean is the average. What I'm getting at is in your DAQ Assistant, you set an acquisition mode (continuous, n samples, or single sample) and if anything other than single sample, you set a rate and number of samples. If you are requesting multiple samples, then take the Mean of each channel. Your settings are all hidden in the assistant and I can't see them.
0 Kudos
Message 7 of 13
(4,245 Views)
Solution
Accepted by topic author cdteo

Hi cdteo,

 

You can probably incorporate part of this code to your program  for logging data to excel on a timed basis. The link shows an example that uses the "Elapsed Time" Express VI to log data at a user-defined time interval

 

Continuous Acquisition with Timed Write to File

 

https://decibel.ni.com/content/docs/DOC-2432

 

Good luck with your project

 

Luis S
Application Engineer
National Instruments
0 Kudos
Message 8 of 13
(4,224 Views)
I removed the mutiple stop buttons as you suggested and everything works fine. I did some reading on differnt acquisition modes and understand it a bit better I had mine set up for continuous samples and changed it to n samples. I guess I don't see any change in the way the program runs but if it takes less system resources using it this way than that's a plus. I'm still back to my original question trying to figure out how to write the data to file. I sure appreciate all the help and learning.
0 Kudos
Message 9 of 13
(4,217 Views)

Hello cdteo,

 

I am sending you two examples that you might find useful for your application.

 

Regards

 

Ernesto
Application Engineer
National Instruments

0 Kudos
Message 10 of 13
(4,199 Views)