Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 01:55 02 May 2024 Privacy Policy
Jump to

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: Australia
Posts: 116
Posted: 08:29pm 12 Oct 2015
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 2794
Posted: 09:06pm 12 Oct 2015
Copy link to clipboard 
Print this post

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: Australia
Posts: 5907
Posted: 09:06pm 12 Oct 2015
Copy link to clipboard 
Print this post

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
Edited by TassyJim 2015-10-14
VK7JH
MMedit   MMBasic Help
 
Chrisk

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 116
Posted: 04:46pm 13 Oct 2015
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 153
Posted: 08:53am 14 Oct 2015
Copy link to clipboard 
Print this post

  Chrisk said  
It was those double quotation marks that were required.
Not sure why they are needed but it worked.


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


To reply to this topic, you need to log in.

© JAQ Software 2024