LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save file weekly

Hello: 
I need to save some data to a spreadsheet. Currently I'm saving the data to the same file. But now I need to do a new file every week automatically.
I appreciate your help in solving my problem.
Thanks
 
0 Kudos
Message 1 of 6
(2,946 Views)
The two pieces you need to build this is first a way of telling when a new week has started. The built in function "Seconds to Date/Time" returns a number of values based on the timestamp input. Among those values are "day of the week". You can use this value to identify the time rolling over from day 7 of one week to day 1 of the next week. All you need to look for is the situation where the last time it was queried the day of the week was 7 and this time the day of the week is 1.

Second, you need to generate a new file name automatically whenever that shift is detected. Assuming the file name is being carried in a shift register, if the week has not changed, use the file name from the shift register. If the week has changed, generate a new file name and use it to update the shift register and save the data. There are numerous examples shipping with LV that show the automatic generation of unique file names.

The reason this works so well is due to the way the file IO VIs work. If you tell it to append data to a file that doesn't exist, it creates the file and then writes the data to it.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 6
(2,925 Views)


@mikeporter wrote:

The reason this works so well is due to the way the file IO VIs work. If you tell it to append data to a file that doesn't exist, it creates the file and then writes the data to it.

Mike...


Nice remembrance of funda, Mike...
- Partha ( CLD until Oct 2027 🙂 )
Message 3 of 6
(2,920 Views)
Hello Marisol,

Yesterday I've posted my reply to your question in the wrong place. 🙂

If you still wanna see my idea, it's posted in the following link.

http://forums.ni.com/ni/board/message?board.id=180&message.id=15274
Software developer
www.mcm-electronics.com





PORTUGAL
Message 4 of 6
(2,908 Views)
Can you post the VI here saved for 7.1?
- Partha ( CLD until Oct 2027 🙂 )
Message 5 of 6
(2,892 Views)
Hello,

I assume that the post saying to post in 7.1 it's for me.

Well... I can't. I'm working in 8.2.1 and I can only go to 8.0.

But what I've done it's very very simple. You can see the attached picture.


Software developer
www.mcm-electronics.com





PORTUGAL
Message 6 of 6
(2,887 Views)