![]() |
Forum Index : Microcontroller and PC projects : CMM and watchdog
Author | Message | ||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
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: 2944 |
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 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
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 |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
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$ |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |