05-09-2014 04:16 AM - edited 05-09-2014 04:17 AM
Hello, this is my Vi used for measuring temperature with 6 thermocouples. How do i save the measurment data to a text file or xml? Thank you.
05-09-2014 04:43 AM
Well If you dont know file I/O functions then I recommend you to study them all. It is very useful.
To write in to text file you need to create reference (create this outside of any loop) then use "write to text file.vi" in loop to write the data you want and close the reference outside the loop. find image for referece.
05-09-2014 06:51 AM
You should also learn to use the Format Into String and/or the Array To Spreadsheet String functions. They are great for formatting your data into a string to then write to your file.
05-12-2014
08:57 AM
- last edited on
12-09-2024
05:49 PM
by
Content Cleaner
Dear Blaze888,
First of all, let me Welcome You to the NI forums. We look forward to helping you out.
You could approach the question of Data Logging from multiple views. Please look around these hyperlinks:
http://www.ni.com/academic/students/learn-daq/data-logging/
http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/creating_tands_files/
What I would recommend you for using is a shift register, where you store the measurement values in an array, and after execution write them to a Spreadsheet file:
http://zone.ni.com/reference/en-XX/help/371361J-01/glang/write_to_spreadsheet_file/
If you specify for example "," (comma) as your delimeter, you will have a CSV file which could be read from excel easily.
Best regards,
Peter
05-13-2014 03:38 AM
This is how my block diagram look like. I need to know how to connect the 2 diagrams so i can get the temperature reading to a text file. How exactly do i make the connection between the 2?
05-13-2014 03:45 AM
Do you mean to say to read data of one while loop into another while loop?
If yes then you can use local variable of your indicator. Right clicking on indicator leads you to several option, there go to create and local variable.
@Blaze888 wrote:
This is how my block diagram look like. I need to know how to connect the 2 diagrams so i can get the temperature reading to a text file. How exactly do i make the connection between the 2?
05-13-2014
04:01 AM
- last edited on
12-09-2024
05:49 PM
by
Content Cleaner
For future reference, take a look at the Producer/Consumer methodology: https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...
Using this one could have an Acquisition and a Buffered logger loop running connected by a stream of data. Using Queues.
However if the sampling rate is low in you program, you could just merge the two loops, and put the write function to the actual loop where you gather the samples. (!! Only do this if you are not feeling confident with the other, more robust methods.)
Peter
05-19-2014 08:55 AM
Thanks a lot for the information. Howeever i am going to try somethign different. Can't i just use the Write to Measurment file vi and then connect it to the temperature indicators directly. I will save the file in binary format (TDMS) which i later plan to opel with Excel with the TDMS Lab View plugin that LabView atutomatically installs. Won't that work?
05-19-2014 08:58 AM - edited 05-19-2014 09:01 AM
@Blaze888 wrote:
Thanks a lot for the information. Howeever i am going to try somethign different. Can't i just use the Write to Measurment file vi and then connect it to the temperature indicators directly. I will save the file in binary format (TDMS) which i later plan to opel with Excel with the TDMS Lab View plugin that LabView atutomatically installs. Won't that work?
That's the way I'd do it! except fo one small change. Since the only thing you are logging is a DAQmx Read. just set the task up to log!
05-19-2014 09:20 AM
Whats the purpose of that image? I need to create that?!