Switch case
A “Switch Case” construction can make the robot change behavior based on sensor inputs or variable values.
Examples are valid for:
CB3 Software version: 3.2.18515
e-Series Software version: All versions
Note that older or newer software versions may behave differently.
From version 3.2 the command ”Switch” has been added to the PolyScope software. The “switch” is located under Structure tap, then Advanced tap.
A “Switch Case” construction can make the robot change behavior based on sensor inputs or variable values. Use the expression editor to describe the base condition and define the cases under which the robot should proceed to the sub-commands of this Switch. If the condition is evaluated to match one of the cases, the lines inside the Case are executed. If a Default Case has been specified, then the lines will be executed only if no other matching cases were found.
Each Switch can have several Case’s and one Default Case. Switches can only have one instance of any Case values defined. Cases can be added using the buttons on the screen. A Case command can be removed from the screen for that switch.
Below is a simple program showing how a Switch case can be used. One could also use a Modbus register for selecting a case where a particular program would be located.