Exercise
This part will introduce the exercise for this tutorial, together with some handy tips to think about when developing the robot program. Remember that in order to take part in this section of the tutorial, you need to have completed the previous sections of this tutorial and have basic knowledge in how to program in RoboDK.
Exercise: Product sorting
In this exercise you should develop a robot program in RoboDK that sorts cans and wooden cylinders that arrives from a single conveyor in the Simumatik station. The UR3 robot should either place them in a box or second conveyor, according to the illustration shown below.

While running the simulation, you can spawn products using the button placed in the Simumatik station.

Keep the following tips in mind when developing the robot program in RoboDK:
In- and Outputs has been prepared for you in the Simumatik controller component and integrated with RoboDK through the IOMapping script. Find out which signals are connected to which sensor and gripper before you get started!
Sometimes one part of the system needs to wait for another, the Wait instruction could then be useful i.e. Wait in0=1
To control components in the Simumatik station use the Set instruction in RoboDK, i.e. Set out0=1
An advantage can be to divide your program into several subprograms and then use the Call instruction to run them, i.e. Call pickCan
To select what the robot should do depending on product, you could add a python script in your RoboDK program.