LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

measuring time elapsed for file output.

Hello everybody I want to add a time constraint for a 'file output.vi'. I want to preset how long (time) should the vi write in my file. For eg. stop writing after 20 seconds. Please suggest an appropriate way for this. Am attaching my vi for your perusal. Thanks in advance
Download All
0 Kudos
Message 1 of 17
(3,939 Views)
Hi vaib,
how bi is your data you want to write? Do you need really 20 seconds? I think it is not possible with the express vi, because you can´t abort this vi. I think you should use the "normal" file I/O vi´s to do it. Therefore you has to split your data into little portions and write it in a loop to your file, then you can stop the loop if you are either ready or the 20 seconds are gone.

Hope it helps.
Mike
0 Kudos
Message 2 of 17
(3,935 Views)
You will need to better define what you want to do. Your loop is already set up to stop after a certain amount of time. Are you trying to control the writing separately? Or, are you asking how to make the numeric control have a default value of 20 seconds?
Message 3 of 17
(3,921 Views)
Thanks for replying Yes i am looking to control my write to file seperately. I want writing to stop after x time and program to stop after y time 'say' Vaib
0 Kudos
Message 4 of 17
(3,911 Views)
Well, you pretty much have everything you need right there. There's the "Enable" input on that Express VI, which you're already controlling, so all you need is an AND function:
0 Kudos
Message 5 of 17
(3,905 Views)
Thanks a lot the solution makes a lot of sense and has really helped me a lot Vaib
0 Kudos
Message 6 of 17
(3,900 Views)
Hello everybody: I am still having a small problem in this solution. It works when i start the file write immediately after hitting the start button. But it will not work when: I start writing to the file after a time x seconds after initiation of the while loop. Please help!! Vaib
0 Kudos
Message 7 of 17
(3,874 Views)
Please post your code.
0 Kudos
Message 8 of 17
(3,863 Views)
Sorry, I would not be able to post the modified codes today because my pen drive just got damaged and the work station with labview is a prehistoric one with no network connections. However it basically is the same as the one i posted above with modifications you mentioned. Please help!! Vaib
0 Kudos
Message 9 of 17
(3,859 Views)
Firstly sorry to post on two threads. Next, i got hold of a colleague's zip drive here's is the code with your modifications. But this is not functional in the following manner: 1.The programme treats time to write in file and execution time of while loop alike, which is not required. If i give 30s for execution of while loop and 20s for file write time. and start writing at the same time when i start the while loop it works file, even if i give 20s for both and start both fuctions at the same time it works fine. But when i mention 30s for execution of while loop and 20s for file write time, and start the write function after 10s of while loop execution. I dont get data worth 20s which i want in the file. SO please suggest proper modifications Thanks in advance. Vaib
0 Kudos
Message 10 of 17
(3,847 Views)