
kamaroman68
USA
Asked
— Edited
Hey again everyone. Happy New Year!
New question... without using sleep commands is there a way to start another script when another finishes? Reasoning for this is.. I'd like to showcase all functions of my machine. So basically when I say" robot what can you do" it would start with " I can move my head" followed with head movement, when this script is done it is followed by " I can move my arms" and the arms move etc etc. All of my movements have been made in the script manager being easily linked via control command. Just thought it would be a neat idea. Script done go to next script. Thanks guys!
Chris
In the Allen Bradley plc programming world we'd call it "step programming "
Oh - Adding to @kamaroman68's question... because the question asks about movement, i suspect this is using the Auto Position Control? Or at least the secondary scripts are. So the answer of ScriptStartWait won't actually work because the question may actually be regarding how to wait for an Auto Position to finish.
In which case, remember that the documentation of ControlCommand() states that that is "sends a command to another control". So, if you tell the Auto Position Control to execute an action, it will do so and continue to the next command. This means it does not wait for the Auto Position Action to finish. The ControlCommand() to start an action simply tells the Auto Position to begin executing that action, and does not wait for it to complete.
There is a variable in Auto Position called $AutoPositionStatus, that can be viewed in the Auto Position Config screen -or- in the Variable List Tab when editing scripts.
That variable, as the blue question mark next to it describes, will change from 0 to 1 based on the status of the Auto Position control (is it running or not). So, you can launch an Auto Position and wait for it to finish like such...
This can be taught using either RoboScratch or Blockly, both of which present this as a lesson by using the Auto Position (Wait) functions.
For example in RoboScratch...
Creates the following code....
And in Blockly...
Which generates...
The issue is not that the Cheat Sheet doesn't work, but there is nowhere to find documentation for some of the functions this just being one example.
I did in fact attempt to use cheatsheet and didn't see anything that looked useful, so wrote up the way I knew would work.
Scriptstartwait doesn't sound like it does what it does. If it was scriptstopwait, I might have tried it even without documentation since the name looked like what I was looking for. Now that you have defined it, imakes perfect sense, just not intuitively clear without that definition.
I also looked at getControlValue to see if there was anything useful, but it is also poorly documented (the document says to see below for all values, then the only documented value is "pause").
Alan
Auto position is Not being used. I script all positions manually. Thanks again guys!
Not siding with anyone here but to me ControlCommand("Script", ScriptStartWait) worked exactly how I assumed it would when I first starting using the command... I admit I am guilty of not reading manuals or "how to" documentation as much as I should.... I usually start messing with stuff first then if I get stuck I look for a video and if I have to, read documentation... I have a hard time keeping focus while reading...
I prefer videos over documentation.... I learn much faster and better visually... For instance I learned how to change my own motorcycle tires with simple tools (tire irons) by watching an youtube video.... I would have never been able to do that by reading an "how to" manual on changing your own tires... Unless it had a lot of pictures that is