Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CMM and watchdog
Author | Message | ||||
Chrisk Senior Member Joined: 21/12/2014 Location: AustraliaPosts: 116 |
Hi Guys I wish to use the watchdog command to restart a program should it get itself into a loop or some sort of program failure. I have the watchdog instruction in a section of the program which is named autorun.bas What what do I place in restart.bas I tried the one line: run autorun but it didn't seem to restart when it crashed. Have I got this correct. From what I can gather from The Back Shed forum that is all I need. I have a CMM running Ver 4.5 with both files on the b: drive (SD card) Regards Chrisk |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
Hi Chrisk, Not too sure on this one but does your one-line need to include quotes? So restart.bas contains: RUN "autorun.bas" No doubt someone will chime in here too to prove me wrong! WW For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5907 |
Start with a PRINT "OOPS!!!" in the restart.bas file so you know that you got that far. I think you need quotes around the file name for the RUN command run "autorun.bas" Jim VK7JH MMedit MMBasic Help |
||||
Chrisk Senior Member Joined: 21/12/2014 Location: AustraliaPosts: 116 |
Thanks WhiteWizard and TassyJim. It was those double quotation marks that were required. Not sure why they are needed but it worked. For future reference I should point out I was using TeraTerm and when restart.bas ran the USB communications no longer existed. So no "OOPS!!!" was viewed. The main thing is I saw that the main program restart. I gives me that confidence that it will restart should I not be in attendance. You where a great help. Regards Chrisk |
||||
Greg Fordyce Senior Member Joined: 16/09/2011 Location: United KingdomPosts: 153 |
The double quotes tell the MM that "autorun.bas" is a string and not a variable. You could also define a string variable to use instead. A$ = "autorun.bas" Run A$ |
||||
Print this page |