LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

record measurements in an Excel file

Hello, I want to record measurements in an Excel file using the " write in measurement file" of  labview , my problem is that in the time column of the excel file  I find 01/01/1904 00: 00:00 as date,  here is a screen capture of the code .

when I replace the registers lags of the FOR loop by tunnels, time becomes good but the headers are no longer displayed .

could you help me please .

thank you in advance )

Download All
0 Kudos
Message 1 of 12
(5,229 Views)

The date you are seeing is the date that LabVIEW uses for an uninitialized TimeStamp, which defaults to 0 = midnight on 1 Jan 1904 (slightly different from Excel's "zero" date).

 

Some suggestions.  When posting code, do not post "pictures" of your code, but post the actual code, either by appending a VI or using Snippets (which are pictures, but also "executable").  This allows us to "play" with your code without having to print out the picture, then (by hand) build it ourselves.

 

Second suggestion is to post complete VIs, not little pieces (unless you are certain that you have included the piece causing the problem).

 

Third is if you really want to write to Excel, I would recommend using the Report Generation Toolkit, which is pretty explicit in writing to Excel, rather than Write to Measurement File (which "hides" all of the details from you).

 

Bob Schor

0 Kudos
Message 2 of 12
(5,190 Views)

Thank you for your reply, as you told me I used the Toolkit report, How can I add a time column to the Excel table , and I want to save the Excel file automatically with the name ( the date and time of execution ) I do not know how to do it with the toolkit report,

cordially

0 Kudos
Message 3 of 12
(5,178 Views)

Here's one way ...

Date and Time Example.png

The first bit of code uses the Get Date/Time String to get Date and Time.  I use Excel Easy Table, as I find it "easier" than Append Table to Report.  I've brought the two outputs on "Where to put the next Table" out with a Choice switch so you can see how you want to place the Numeric Table.

 

For the Numeric Table, I first generate the Num1 .. Num10 Headers using a For Loop and Format Into String, writing it out as a single row.  I then enter the While loop and generate a single row, adding it at the bottom of the existing Numeric Table until the Stop button is pushed.

 

Bob Schor

0 Kudos
Message 4 of 12
(5,152 Views)

Thank you, 

have you an idea how to rename and save the report

cordially

🙂

0 Kudos
Message 5 of 12
(5,129 Views)

Refer this snippet to save this report.

 

Excel Save.png

Munna
0 Kudos
Message 6 of 12
(5,114 Views)

to be clearer I want every time I stop the execution I find that my file was saved and named with the date and time of execution,the function " save the report" does not allow me to define the report name and uses the same path to save.

 

0 Kudos
Message 7 of 12
(5,106 Views)

I'm not getting how want to save the report. give me example of your file name.

 

By the way, you can build your own file name & pass it "Save the report.vi".

Munna
0 Kudos
Message 8 of 12
(5,096 Views)

Here is a screen capture of the records that I did with the function ( save in a measurement file ) it did that automatically, this  is what I want but I don't  know how to do it with the report toolkit

0 Kudos
Message 9 of 12
(5,088 Views)

as I told, you can build your file path. Refer this snippet.

 

Excel Save_3.png

 

Excel Save_2.png

Munna
0 Kudos
Message 10 of 12
(5,075 Views)