Hi,
I want to be able to run a script continuously until i decide to terminate it. Right now, i have doing so but for reasons i am not sure of yet, the program terminates randomly. I want to somehow make it return to processing if such a thing occurs. I thought i could make my script into one big function, and at the very end i call that function again so it will re-run the program if it was to terminate. However, in my program, i am continuously reading from an external device and writing to test files. If i was to call the program again at the end, it would overwrite those test files.
How can i have it restart without overwriting the text files it started with? how can i just have it open those files and continue writing from where it left off?
|
|
0
|
|
|
|
Reply
|
Bilal
|
11/8/2010 5:07:05 PM |
|
"Bilal " <bilalhaider87@gmail.com> wrote in message <ib9anp$qts$1@fred.mathworks.com>...
> Hi,
>
> I want to be able to run a script continuously until i decide to terminate it. Right now, i have doing so but for reasons i am not sure of yet, the program terminates randomly. I want to somehow make it return to processing if such a thing occurs. I thought i could make my script into one big function, and at the very end i call that function again so it will re-run the program if it was to terminate. However, in my program, i am continuously reading from an external device and writing to test files. If i was to call the program again at the end, it would overwrite those test files.
>
> How can i have it restart without overwriting the text files it started with? how can i just have it open those files and continue writing from where it left off?
One way:
doc persistent
use persistent variables for your file name's index numbers.
|
|
0
|
|
|
|
Reply
|
Sean
|
11/8/2010 5:17:04 PM
|
|
Dear Bilal,
>Right now, i have doing so but for reasons i am not sure of yet, the program terminates randomly.
It is unlikely, that a program terminates randomly. It is most likely a good idea to find the underlying bug.
Jan
|
|
0
|
|
|
|
Reply
|
Jan
|
11/8/2010 5:34:03 PM
|
|
On 10-11-08 11:07 AM, Bilal wrote:
> I want to be able to run a script continuously until i decide to
> terminate it. Right now, i have doing so but for reasons i am not sure
> of yet, the program terminates randomly. I want to somehow make it
> return to processing if such a thing occurs. I thought i could make my
> script into one big function, and at the very end i call that function
> again so it will re-run the program if it was to terminate. However, in
> my program, i am continuously reading from an external device and
> writing to test files. If i was to call the program again at the end, it
> would overwrite those test files.
> How can i have it restart without overwriting the text files it started
> with? how can i just have it open those files and continue writing from
> where it left off?
The first step in this process would be to add a try / catch pair in order to
detect the termination and permit the restart.
The second step would be to open the text output files with 'at' permission
instead of with 'wt' permission: 'wt' permission clears the current contents
of the text file, but 'at' permission appends the data to the end of the text
file (creating it if it does not exist.)
|
|
0
|
|
|
|
Reply
|
Walter
|
11/8/2010 6:59:17 PM
|
|
"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <ib9cab$9kh$1@fred.mathworks.com>...
> Dear Bilal,
>
> >Right now, i have doing so but for reasons i am not sure of yet, the program terminates randomly.
>
> It is unlikely, that a program terminates randomly. It is most likely a good idea to find the underlying bug.
>
> Jan
I understand what you're trying to say. i chose that work incorrectly. It's just i have to leave the program running for a few days at a time and it will terminate over night, and since i have it running as an executable, i don't quite know where it terminates. I'm still working on that part.
|
|
0
|
|
|
|
Reply
|
Bilal
|
11/8/2010 8:44:04 PM
|
|
|
4 Replies
427 Views
(page loaded in 0.035 seconds)
Similiar Articles: continuously running a program - comp.soft-sys.matlabHi, I want to be able to run a script continuously until i decide to terminate it. Right now, i have doing so but for reasons i am not sure of yet, the program ... Running programs from Matlab - comp.soft-sys.matlabhow to force matlab to quit a running script - comp.soft-sys ... continuously running a program - comp.soft-sys.matlab how to force matlab to quit a running script - comp ... Howto retrieve who ran a program - comp.sys.ibm.as400.misc ...continuously running a program - comp.soft-sys.matlab Howto retrieve who ran a program - comp.sys.ibm.as400.misc ... continuously running a program - comp.soft-sys.matlab ... running simulink model in real time - comp.soft-sys.matlab ...run continuously? what do you mean? i knw that you can run the simulation in your program by using the function 'sim' . for e.g. if you have saved your model as ... how to force matlab to quit a running script - comp.soft-sys ...continuously running a program - comp.soft-sys.matlab how to force matlab to quit a running script - comp.soft-sys ... continuously running a program - comp.soft-sys ... How to run a m file without opening matlab? - comp.soft-sys.matlab ...continuously running a program - comp.soft-sys.matlab How can i have it restart without overwriting the text files it started with? how can i just have it open those files ... Script for a quizz - comp.lang.javascriptcontinuously running a program - comp.soft-sys.matlab Script for a quizz - comp.lang.javascript continuously running a program - comp.soft-sys.matlab Script for a quizz ... Anybody else running Sun StorageTek RAID Manager on x86? - comp ...After the reboot, java was > dumping core continuously until I disabled the ADPTstor ... Anybody else running Sun StorageTek RAID Manager on x86? - comp ... I have a 4-CPU ... exit a script, but don't exit matlab - comp.soft-sys.matlab ...Stopping user from exiting program - comp.databases.filemaker ... So, in your case, the close script doesn't run immediately when you close the ... current GUI - comp.soft ... How to execute my code over and over?? - comp.soft-sys.matlab ...continuously running a program - comp.soft-sys.matlab Hi, I want to be able to run a script continuously until i decide to terminate it. ... to leave the program running ... Visual Basic :: Running A Program ContinuouslyRunning A Program Continuously I have a program that i have made, that i would like it to start at start up and run, throughout the entire time that the computer is ... continuously running a program - comp.soft-sys.matlab | Computer GroupHi, I want to be able to run a script continuously until i decide to terminate it. Right now, i have doing so but for reasons i am not sure of yet, the program ... 7/25/2012 1:38:46 AM
|