News:

  • June 28, 2026, 11:45:46 AM

Login with username, password and session length

Author Topic: What happens to stage  (Read 11060 times)

cyounger

  • Jr. Member
  • **
  • Posts: 16
What happens to stage
« on: October 09, 2013, 12:42:28 PM »
Got a quick question guys what happens if I am running a stage program from a prgm called auto and it exits due to a fault and exits the program in the middle of say stage 5.  When the prgm. is called to run again will it start with stage 0 (ISG 0 ) or will the pgram start in stage 5 where it left off.
Thanks

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: What happens to stage
« Reply #1 on: October 09, 2013, 01:44:07 PM »
It will go to SG0.
You will have to monitor which stage(s) were active when you EXIT the Code block, and then use SGSET (or JMP) to re-activate them.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

cyounger

  • Jr. Member
  • **
  • Posts: 16
Re: What happens to stage
« Reply #2 on: October 09, 2013, 01:47:53 PM »
ok thanks I was just making sure that the stage would go back to zero.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: What happens to stage
« Reply #3 on: October 09, 2013, 02:37:43 PM »
If you ever want the alternative behavior (i.e. start where you left off), look at possibly using the SUSPEND instruction from the "supervisory" program (e.g. $Main would SUSPEND program Auto), instead of EXITing from within 2nd program and re-RUNning from the "supervisory" program which would restart Auto.

We originally wrote SUSPEND as a debugging feature, but it could be utilized for this alternative behavior.  (Note that Time does not accumulate within SUSPENDed code-blocks - so TMRs ALSO "suspend".  Yes, technically, "time stands still"  ;D)

rlp122

  • Sr. Member
  • ****
  • Posts: 91
Re: What happens to stage
« Reply #4 on: October 09, 2013, 04:21:46 PM »

cyounger

  • Jr. Member
  • **
  • Posts: 16
Re: What happens to stage
« Reply #5 on: October 10, 2013, 09:24:45 AM »
Thanks again the suspend looks interesting I might try it on a future project
Chris