Create the sequence
In this chapter, we will create the sequence for the process and test it both manually and using the physics simulation.
Create and manually test the first part of the sequence
In the first step, we switch on the conveyor belt continuously and retract the cylinder. Then, we wait until the cylinder is fully retracted. Next, we wait until the front light barrier is triggered.
We create a variable and link its value to a wait block. We want to wait for a certain period of time — in this case, 300 ms — and then check whether the light barrier is still triggered. If it is, this indicates that the part is a long one.
We test this process manually by temporarily removing the light barrier input and setting the input manually. We observe that the sequence runs through to the end and then starts over again repeatedly.
Create the second part of the sequence
In the next step, we check whether the light barrier is still triggered after the defined time. If this is the case, the cylinder should extend. To improve the readability of the block arrangement, comment blocks can be added. After that, we wait until the cylinder is fully extended, and then the sequence starts over from the beginning.
Next
In the next chapter, we automatically generate the workpieces at defined intervals, adjust the frequency to generate them, and clean up the simulation components to keep the project organized.