05-18-2015 06:36 AM
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 )
05-18-2015 07:44 AM
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
05-18-2015 09:28 AM - edited 05-18-2015 09:54 AM
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
05-18-2015 01:22 PM
Here's one way ...
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
05-19-2015 03:48 AM
Thank you,
have you an idea how to rename and save the report
cordially
🙂
05-19-2015 04:23 AM
Refer this snippet to save this report.
05-19-2015 04:34 AM
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.
05-19-2015 04:46 AM
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".
05-19-2015 05:03 AM - edited 05-19-2015 05:11 AM
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
05-19-2015 05:18 AM
as I told, you can build your file path. Refer this snippet.