From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save integer with particular time in excel at fixed time

Dear all

I want to save no of container moves in every one hour.container are three different size like 20/40/45 feet. 

I code can count no of moves. 

I want to save all these data in excel sheet at any fixed time like 8am.

The excel sheet should have header showing container size and in row time duration like from 7am to 8am .

Please help me about this as I don't know about data saving 

 

Thanks in advance 

0 Kudos
Message 1 of 4
(2,255 Views)

Experiment with the Report Generation Toolkit >>> Excel easy table.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,249 Views)

Hi Asif,

 

before saving "in Excel" you should start by creating a 2D string array containing:

- a header row with your header labels

- other rows containing your data

When you have achieved this part of the exercise you simply save this array using WriteToSpreadsheetFile (or with recent LabVIEW versions "WriteDelimitedSpreadsheet")!

 

(After (or even while) doing this you can read the help for the Write… function: it also accepts 1D arrays. This way you can separate writing the header line from writing the data lines making the file creation even easier!)

Best regards,
GerdW


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

Asif,

     The key question is "What do you mean by Excel"?  You got two very different (but also "correct") suggestions -- Ben described saving the data in the .xlsx Format that is proprietary to (and uses) Microsoft's Excel software, while Gerdw described saving data as a Comma-Separated-Value (.csv) file, a pure Text file that Excel can also open (and may even "brand" as its own by creating an Excel-like Icon for this file type).

     If you want to save in .xlsx format (which allows doing "Excel-like" things such as creating Excel Graphs, coloring cells, changing text formats, etc.), use the Report Generation Toolkit (if you have it).  If you just need numbers (possibly with headers) in a 2-D text format, with columns separated by tabs or commas, and rows separated by New-Lines, you can Write Delimited Spreadsheet.

 

Bob Schor 

0 Kudos
Message 4 of 4
(2,197 Views)