Step References in "At..."

Under error handling you can choose various ways to proceed in case an error occurs. The three ways listed below require that you identify a previous step on the execution path (either a Try step or a loop step) where execution should proceed. Execution will proceed at or after the selected step depending on which one of the three you have chosen:

When identifying the desired step, you can either select the "nearest step" (of the appropriate kind) or you can select a specific step by name. Sometimes, however, the desired step does not appear in the selection list. This can happen for a number of reasons:

The last two rules support using error handling in an advanced way that is very similar to the try-catch constructs in Java or C#. See the Try-Catch section for more on this. In those programming languages, you "throw" a named "exception" at the point of error, and "catch" it (by name) somewhere in surrounding code. In robots, you can do something similar with Try steps. The correspondence between the Java/C# terms and the Design Studio terms is as follows:

Java/C# term What to use in Design Studio
try The first branch of a Try step
Name of an exception Name of a Try step
throw E Handling an error with "Try Next Alternative at E"
catch E The second branch of a Try step named "E"

This way of thinking about error handling probably is most useful in large robots. When using error handling like this, the names of the Try steps signal what kind of exceptional circumstances each Try step's second branch handles.