
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 "
There may be a better way to do this, but I would do it like this. I assume you don't always want the scripts to each run in sequence, so I would use a variable to turn on "demo mode". At the end of each script, I would check if that variable is on or off, and if it is on, I could execute the next script.
So for example, in the init script, you set the variable to off so that other scripts that look at it don't error.
Then, at the end of each script:
Were "NextScript" is actually the name of the script that should execute after this one.
Finally, you need one more script that turns on demo mode, and starts the first script:
Alan
The easiest and more effecient way is to use the built-in ScriptStartWait command..
Load ARC
Press EXAMPLE PROJECTS from the Bookmarks window
Enter the EZ-Scripts Examples folder
Either locate "Procedural 3" project or search for "ScriptStart"
For more information about example EZ-Script projects, visit this activity: https://synthiam.com/Tutorials/Lesson/22?courseId=6
Well... That is certainly better, and I looked for something like that in the script manual in ARC before answering because I was sure I had seen it, but the command is not documented......
Alan
ControlCommands() are not documented in the script manual because they are specific to the controls loaded. To find out what ControlCommands() are available per control, use the Cheat Sheet or right click on the EZ-Script editor. More information about EZ-Script and Cheat Sheet can be found in this activity: https://synthiam.com/Tutorials/Lesson/23?courseId=6
But how would I know what "ScriptStartWait does if it is not documented without looking at every tutorial and sample? Like I said, I knew I had seen something like this. I probably looked at that sample a couple of years ago, but without a document to reference, it is very difficult to remember every thing that ARC can do.
I'll drop it since we have answered the original question, and the solution is elegant, but this is a recurring theme...
Alan
The command is assembled using 3 words, Script Start and Wait. The purpose of using descriptive commands is to identify what they do with words, much like a short sentence.
ControlCommand() is how controls speak to other controls. Each control has it's own ControlCommand, this includes 3rd party plugins as well. ControlCommands() are Control specific and not part of the EZ-Script language. ControlCommands() are documented by their respective control using the Cheat Sheet or Right-Click in the editor to display.
The recurring theme only applies to those who forget to use the CheatSheet tab or Right-Click in the editor - neither of which you had done when answering the question.
The recommended first point of action to identify the capabilities of a Control is to look in the CheatSheet tab or Right-Click in the editor, each of which will return the same results.
That is insulting, and innacurate.
We clearly are never going to agree on how software should be documented, so subject dropped.
Alan
I would never want to insult you or come off that way. My response may sound mechanical because i'm juggling a few other tasks while responding to this.
The ControlCommand() uses self documenting descriptions for commands. If your suggestion is to add another layer of documentation to the ControlCommand() Cheat Sheet display, then that's duly noted. However, keep in mind that the CheatSheet and all uses of it would increase in length/size exponentially with paragraph of description per self-documented command... and be even more difficult to read, considering the CheatSheet is already being skipped as a source for available commands.