LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to measurement file

Solved!
Go to solution

Spanish:

Hola! Estoy teniendo un problema cuando intento crear un archivo de excel con los niveles de un sistema de 4 tanques por medio del "Write to measurement file", específicamente con la columna del tiempo. Cuando se crea el archivo de excel aparece correctamente el nivel de los tanques, sin embargo, la primera columna "time" aparece en la primera fila una fecha y hora dada y el resto de filas aparece 00:00:00:00. Lo que me gustaría es que cada fila contenga la fecha y hora a la cual el dato fue tomado.

Gracias por su ayuda.

 

English:

 

Hello! I am having a problem when I try to create an excel file with the levels of a 4 tank system by  "Write to measurement file", specifically with the time column. When the excel file is created, the level of the tanks appears correctly, however, the first column "time" appears in the first row, a given date and time and the remaining rows appear 00: 00: 00: 00. What I would like is that each row contains the date and time at which the data was taken.

 

Thanks for your help.

 

 

Download All
0 Kudos
Message 1 of 6
(3,613 Views)

Hi Juanma,

 

When the excel file is created, the level of the tanks appears correctly, however, the first column "time" appears in the first row, a given date and time and the remaining rows appear 00: 00: 00: 00. What I would like is that each row contains the date and time at which the data was taken.

You seem to like ExpressVIs a lot! 😄

Those ExpressVIs offer several options to configure them. Unfortunately there is no option in the WriteMeasurementFile ExpressVI to set the formatting of the timestamps. But hey: LabVIEW is a programming language and so you can actually program your requirements using "plain" (aka non-express) functions!

 

I recommend to write your data into a CSV file using your own formatting rules…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,604 Views)

Hi friends, 

 

I am trying to save the level information of 4 tanks in a excel file. I need the first row contains the headers: Time-T1-T2-T3-T4-T5 and then all the data. How could be the easy way to do that with NO VI's. I have tryed but i had some problems. I am new in LabVIEW.

 

Thanks.

0 Kudos
Message 3 of 6
(3,588 Views)

Hi JuanMa,

 

why do you think creating a new thread for the same old topic would be a good idea?

Please stick with your original thread for the same topic!

 

How could be the easy way to do that with NO VI's.

So you want to create a program without the need to do some actual programming?

 

I have tryed but i had some problems. I am new in LabVIEW.

What have you tried?

Did you take the beginner courses offered in the header of the LabVIEW board?

 

I am trying to save the level information of 4 tanks in a excel file.

Pleae define the word "excel file"! Do you really insist on XLS(x) files (a file format created especially for use with Microsoft Excel)?

Or wouldn't it be much easier to go with simple CSV files, readable with every texteditor - and Excel too?

(As I already suggested before!)

 

I need the first row contains the headers: Time-T1-T2-T3-T4-T5 and then all the data.

Use WriteToSpreadsheetFile (or WriteToDelimitedTextfile in recent LabVIEW version).

Create an array consiting of timestamp in the first column and your measurement values in the following columns. As you want to save differently formatted values in the file I suggest to go with a 2D array of string and do the formatting on your own…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(3,547 Views)
Solution
Accepted by topic author Juanma96

So you want to create a program without the need to do some actual programming?

What do you mean? Like you said me before, VI's are simple but the omit a lot of details.

 

What have you tried?

Did you take the beginner courses offered in the header of the LabVIEW board?

I just tried saving data with de VI's like the image. The problem is the next one: when i configure the DAQ with the option "one sample (ON DEMAND) " the header on the .xls file appears like untitled. So i tried to solve this problem whit a VI called "Set Dynamic Data", this solve the problem of the header, but the time  column was not good. 

 

When i configured the DAQ with the option "N Samples " the header looked ok, but then i cant configured the time column to just one sample per second.

 

I am trying to save the level information of 4 tanks in a excel file.

You are right, i dont know why i am insisting whit .xls file, i will read more about a CVS file.

 

 

Use WriteToSpreadsheetFile (or WriteToDelimitedTextfile in recent LabVIEW version).

Create an array consiting of timestamp in the first column and your measurement values in the following columns. As you want to save differently formatted values in the file I suggest to go with a 2D array of string and do the formatting on your own…

 

Thank you so much, i will try it.

 

Regards Smiley Happy.

0 Kudos
Message 5 of 6
(3,520 Views)

This is an old thread, but for the benefit of future readers:

 

I think you misunderstood Juanma's question. When you use the "Write To Measurement File" express vi, there is an option to automatically add a timestamp column (image attached). The expected behavior would be an individual timestamp for each entry in the file; however, what I get is this:

IncorrectTimeColumn2.PNG

A single row with a correct timestamp, and all further rows stamped with the epoch. I think this is what Juanma was describing. 

0 Kudos
Message 6 of 6
(1,495 Views)