LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to file every hour

Hello All,
I am acquiring the data from 3 counters every second and I would like to write this data to a file every hour (append to file). This vi is going to run for days continuously and I would like the file to be changed every day (at midnight). So I create a file at midnight and append data to it every hour till the next day where the file is closed and a new one opened for writing. I searched the discussion forums and found there were other questions like mine, but I cannot figure out (as yet) how to intergrate those with my data acquisition vi.
I am attaching my vi with this message. I would appreciate any help. Thank you.

KB
0 Kudos
Message 1 of 2
(3,307 Views)
Hi,

There are different ways to save your data. The easiest is to save the data as ASCII data (strings) so you can open it in Excel or in a text editor for review. To do that, you will have to convert the data to spreadsheet data with fx. the "Array to Spreadsheet String" function. Then you can just append the hourly data with the "Write File" function.

If you only need to review your data in LabVIEW, then I will recommend to use the Datalog file type. The Datalog filetype is a more efficient way of storing lots of data, but you cannot open the file in other programs than LabVIEW. It's a little bit more tricky than to use ASCII files, so I attached two VIs to show you the concept. You should also refer to the shipping examples "Read/Write Datalog
File Example.vi".

Best regards,
Philip C.
National Instruments
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Download All
0 Kudos
Message 2 of 2
(3,307 Views)