LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem of create file

Hello everyone.

I want to create file ,and the content of the file can refurbish in a two days.

What should I do ?

Thanks.
0 Kudos
Message 1 of 15
(3,624 Views)
Hi,
"""""Hello everyone.

I want to create file ,and the content of the file can refurbish in a two days.

What should I do ?""""

Hey you just need to make use of the File I/O functions and write it into a file and then you can append to file or create a New file.
You must be able to see a lot of examples in the LV to help you in this.

cheers
vicky
0 Kudos
Message 2 of 15
(3,615 Views)
Hi Vicky.

Thanks in advance.

Yes, I make use of the File I/O functions and write it into a file .And the program can create file,But I want to

the created file can refurbish in a few days(for example:two days).I don't know in the module of File I/O

functions what should I setting?
0 Kudos
Message 3 of 15
(3,602 Views)
Hi liying,

I'm not sure I understand what you mean by "refurbish", so please let me know if misunderstood the question.

Do you want to keep appending to a file in the beginning of the period and then after a specified time (you say two days) start overwriting the file from the beginning? This is basically a circular buffer using a file as the memory. All you have to do is control where in the fle you want to write to. For that purpose, use the "pos mode" and "pos offset" inputs of the Write Fi;e function. As you can see below, the help for this function describes how to use these inputs:



Have fun!

Message Edited by Philip C. on 06-02-2005 09:53 PM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 4 of 15
(3,603 Views)
Hi Philip C.

Yes. I want to keep appending to a file in the beginning of the period and then after a specified time (two days) start overwriting the file from the beginning.And in the two days,the data saving to the file continuously.

In the program, I use the "pos mode" input of the Write Fi;e function,in the "pos mode",I select "end",But the problem is I want to overwriting the file from the beginning two days after.What should I setting of the "pos mode"
and "pos offset"?

I don't know what I said if you understand? And you said"This is basically a circular buffer using a file as the memory. All you have to do is control where in the fle you want to write to" I don't understand what means?

Can you give me a example?

Thanks.
0 Kudos
Message 5 of 15
(3,594 Views)
Hi ,
If your appeninding is happening perfectly and you need to only make sure that after 2 days you want to rewrite the file,you can be checking for the time for checking the days,once 2 days are over then you can simpily delete that file and recreate a file with the same name.
Hope it helps
vicky
0 Kudos
Message 6 of 15
(3,590 Views)
Hi Liying,

I think that you are halfway there!

It sounds like you are having a CONSTANT value connected to "pos mode" and "pos offset". What you need to do, is create some code that calculates "pos mode" and "pos offset" depending on how long you have been acquiring data. In the first two days, "pos mode" and "pos offset" should be "1 (end)" and "0". Then after two days, when you want to start overwriting the file from the start, "pos mode" and "pos offset" has to be changed to point to the beginning of the file. You can for example choose "0 (start)" and "0" and then increase "pos offset" so you don't keep overwriting the very beginning of the file. You will have to calculate "pos offset" by knowing how many bytes you write to the file at a time.

The Circular Buffer is simply a technique used when accessing a buffer. 'Circular' simply refers to the fact that when the end is reached, it continues from start again. It is basically the same functionality you are referring to - only difference is that you wish to use File I/O and not RAM.

Let me know if you have any questions, thanks.
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 7 of 15
(3,569 Views)
Hi PhilipC.

Thanks in advance.

I am having a CONSTANT value connected to "pos mode" and "pos offset". I have been acquiring data three hours a time.the "pos mode" and "pos offset" is used "1 (end)" and "0". Then after two days, I want to start overwriting the file from the start,and the data can save one by one.
You said:" You can for example choose "0 (start)" and "0" and then increase "pos offset" so you don't keep overwriting the very beginning of the file. " But the program can not change it automatic. If the program build application,how choose"0(start)"and"0" ?

"The Circular Buffer is simply a technique used when accessing a buffer. 'Circular' simply refers to the fact that when the end is reached, it continues from start again. It is basically the same functionality you are referring to - only difference is that you wish to use File I/O and not RAM."which you said I don't understand cleraly? Can you give me a example.

Thanks.
0 Kudos
Message 8 of 15
(3,567 Views)
Hi liying,

To change the "pos mode" programatically, use a Case Structure or a Select function to pass on the correct choice of "pos mode". In the example below, we are writing to the file relative to the start or end, dependant on whether the Boolean value coming from left is TRUE or FALSE. What you have to do is create the code that determines when to pass a Boolean TRUE and when to pass FALSE.

Message Edited by Philip C. on 06-07-2005 02:28 AM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 9 of 15
(3,554 Views)
Hi philipC.

Thank you very much.I think I understand what you said.

I have another problem:How I setting the time which occur after the today.
For example:in the "Functions-Time&Dialog"-there is a module:"Format date/Time string"
It can setting the systemic time,But How I can get the time two days after use the mudule?
The module has the function?

Thanks.
0 Kudos
Message 10 of 15
(3,549 Views)