Asked — Edited
Resolved Resolved by DJ Sures!

Calling A Script From Another Script And Return To The Next Line

Hey eveyone. I have been off working on my summer projects, but been watching the form. So the winter is coming and its time to move back into the lab to play with my robots. I have to knock the rust off the little I know and reread everyone's notes.;)

I have build a little rover bot to run around and chase the cats. I am mostly using it for learning scripting.

My question is I would like to have one "script" is the main script and then all the other movements in sub scripts. I would like to nest a couple of scripts. I have looked at the "controlcommand" and what I can figure is that it will call the next script but how do I return from the script "controlcommand" called to the next line after the "controlcommand" line.

Thank you to everyone for the help.


ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

#9  

@ anyone , "scriptstartwait" - so does this pause the first script until the second script finishes? Or do you enter a time for it to wait?

#10  

I think @Rich is sort of around what I am meaning. Please forgive my thick headedness. I am thinking like how i program plc's and fanuc robots.

I think a better way of saying it would be subroutines. Sort of like this

Main program:

  1. code
  2. code
  3. code
  4. action to call subroutine.....
  5. code
  6. code

Subroutine:

  1. code
  2. code
  3. code
  4. end of subroutine code

What I am looking at, if possible is that I run the "main program" it gets to line/rung 4 then runs the subroutine/script, when done the subroutine it will return back to the "main program" and continue on from Line 5.

Is there a way to do that in scripting or do I have to come at this idea a different way. I am trying to avoid a lot of jumpto/goto lable and return type of thing.

Thank you for all the help.

PRO
Synthiam
#11  

ScriptWait

Look at the examples in ARC's Function Syntax folder. There is Procedure X projects with how it works.

ScriptStartWait will wait until the script you are calling has exited before continuing.

#13  

Ok I'll try that thank you for the help.