LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording Data from each time interval into a spreadsheet (Using Labview 8.21)

Hello ,

    I'm  using a 9211A with DAQmx for temperature measurements...  I only use one K type thermocouple. My question  is... How do I set up the 9211A so it only reads and writes data  from each time interval of fifteen minutes to a spreadsheet? I have a DAQmx set to Analog Wfm 1 Chan NSamp and set some parameters within the Polymorphic vi selector by selecting/checking the following:


* Analog
* Single Channel
* Multiple Samples
*Waveform

When it writes to the "Write to spreadsheet file.vi" it only records one reading (The last measurement when the VI stops)...... How can I write data every fifteen minutes? In other words, after a time interval of fifteen minutes I want the data from each interval to be recorded on the spreadsheet. Do you have any Ideas? I've attached the Subvi and collected data to be look at. Thank you so very much in advance for your time and consideration regarding this matter.

Best regards,

Ludwig.

0 Kudos
Message 1 of 9
(9,811 Views)

Hello Spiegel,

I think you missed to attach your subVI so if I wel understand what you want to do, I think this little example below will help you to solve your problem. All the data aquired are registered due to the indexation enabled at the output tunnel of the while loop. The subVI makes only the aquisition of one sample.

Regards,

 

Jérémy M. | LinkedIn - Contact
Don't forget to give Kudos to good answers.

Download All
Message 2 of 9
(9,789 Views)
Mr. Marliot,

Thank you so very much for your prompt response. Thanks for teaching me about the enabing the Indexation. Once enabled it does collect every piece of data. My apologies for not sending the attachments, I was convinced that I did send them. Anyways I'll resend them again. Now that the Vi is able to collect every piece of data how could I make it to gather data every fifteen minutes? Al so I'll like to include atime stamp for each data collected  (i.e., 03/05/2008  50
                         03/05/2008  200
                         03/05/2008  225
                                .
                                .
                                .
                               etc.)

Once again Thank you for all your help regarding this matter

Best regards,

Ludwig
0 Kudos
Message 3 of 9
(9,780 Views)
Mr. Marliot,
 Here it is the Subvi and recorded data. (I'm having problems with my browser... Sorry!)

0 Kudos
Message 4 of 9
(9,773 Views)

In your subVI, you've stripped all time information from the signal when you convert to a dbl. Keep the waveform data type if you want to record the timestamps. Instead of writing when the main VI finishes, you could simply put an Export Waveforms to Spreadsheet File or Write to Measurement File inside the main loop. If you want to save every 15 minutes, use an elapsed time function and wire the 'time has elapsed' output to a case statement. Put your file write inside the case statement. Use a shift register and a build array and pass this to your write function. After the write is complete, clear the array.

p.s. Your subVI is pretty inefficient because you are starting and stopping the task with each iteration. Start the task before the main while loop begins (outside the while loop) and stop the task when the main loop finishes (again, outside the loop).

0 Kudos
Message 5 of 9
(9,762 Views)
Hello,
 
I think this may illustrate what Dennis said. If you want to make more than one aquisition during 15 minutes, you'll need to build an array before writing to a file.
 
Regards,
 
Jérémy M. | LinkedIn - Contact
Don't forget to give Kudos to good answers.

Message 6 of 9
(9,735 Views)
Mr. Marlot,

Thank you so very much for all your help. The illustration helps a lot.. I'll give it a try.

Best regards,

Ludwig
0 Kudos
Message 7 of 9
(9,725 Views)
Be aware that the example only saves a single acquisition at the specified duration. All other acquisitions are lost unless you do what I recomended.
0 Kudos
Message 8 of 9
(9,719 Views)
Dennis,

    Thank you very much for your suggestions. It helps a lot, I'm new to the LABview and as you could see I can barely manage a "General. Vi architecture" as I have a lot to learn about all the options in Labview. It is pretty intuitive but it also requires a lot of practice to figure out how does it work, what works and what doesn't.... I've seen people in the forum coming up with amazing things which I cannot comprehend yet.... at times, prior to posting a question into the forum I get embarrassed because If I have to show what I have had done  to very experienced LABview users it would obviously show very limited or inefficient programming techniques. Nonetheless, Thanks to people like yourself and Mr. Marliot , I can learn from my mistakes and be exposed to what is possible to do with LABview. Once again, thank you very much for all your time and consideration regarding this matter.


Best regards,

Ludwig

0 Kudos
Message 9 of 9
(9,711 Views)