LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

24 hour textfile

Solved!
Go to solution
Hi, I have a textfile vi here which will log the date & time once when the input changes to 1. However, i wish to modify the vi to the following requirements. After the textfile reaches a certain number of lines or after 24 hours, it will close the current textfile and create another textfile with the date as the file name. I've tried to use 'get number of records' but found that it will only get the number of characters in my textfile instead of the number of lines. if anyone have any example related to my requirements or knows the way to do it, please kindly help me. Thanks.
0 Kudos
Message 1 of 31
(3,779 Views)

Hi labviewproject,

if you write the data to the file, then you can count the number of lines in your code instead of reading it from the file.

 

Mike

Message 2 of 31
(3,765 Views)

Hi mike

may i know what function i should use to count the number of lines?

0 Kudos
Message 3 of 31
(3,751 Views)

Hi labviewproject,

i can't open your vi at the moment, but if you write the data to the file, then you know how many lines you write, so you can count them. Store this value in a shiftregister to work with it.

 

Mike

Message 4 of 31
(3,747 Views)
Mike is right. Just use a separate wire as a counter for number of lines. Increment it everytime you write a line to the file.
Message 5 of 31
(3,728 Views)
Thanks alot mike & nitin. I will try it out & see if i can get the required result.
0 Kudos
Message 6 of 31
(3,698 Views)

Hi,

 

I have decided to stop reading lines of record in my vi. Is there a function that can set a specific time such as 00:00:00 and not the date so i can that i could compare it with the current time. When the specfic time matches the current time, my textfile will be recreated and the name is set as the current date. I have look through the labview examples & the threads but found that most of it is about time elapsed. If anyone have done this before or knows how to set the specific time, please help me by telling me what function i could use. Thanks. 

 

0 Kudos
Message 7 of 31
(3,650 Views)

Hi

If you want to create new file after say 24 hrs why dont you use timer?  You can even try Timestamp to get current time.

 

Best of luck

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 8 of 31
(3,645 Views)
Here is my solution. Decide on a set format for date. If the file already exists, then append to that file, else create a new file.Log Based on Date.JPG
Message Edited by NitinD on 08-25-2009 03:16 PM
Message 9 of 31
(3,638 Views)

NitinD wrote:
Here is my solution. Decide on a set format for date. If the file already exists, then append to that file, else create a new file.Log Based on Date.JPG
Message Edited by NitinD on 08-25-2009 03:16 PM

ooops sorry... In the false section, the operation should not be default (open) but create... My bad... please let me know if its not clear...

 

False Case

Message 10 of 31
(3,632 Views)