Ladder diagram, variation of Latch and Lock
When output "Cylinder A" turns on, Cylinder A extends, and when the output turns off, Cylinder A retracts.  Limit switches "Sensor A_Max" and "Sensor A_Min" are on either end of the cylinder.

Cylinder B works the same way, and has an output and two limit switches.

When the START button is pressed, this program extends Cylinder A to the limit switch (Sensor_A_Max), then retracts Cylinder A.  When the retract limit switch (Sensor_A_Min) is hit, Cylinder B extends until it hits its extend limit switch, then retracts.  After Cylinder B is retracted, the system is reset.  When the START button is pressed again, the cycle repeats.

Here is the sequence:


START turns on and off (momentary).
Cyl_A_Fwd turns on.
Cylinder_A turns on, which causes Cylinder A to extend.
Motion causes Sensor_A_Min to turn off, then Sensor_A_Max to turn on.
Cyl_A_Backwd turns on.
Cylinder_A turns off, which causes Cylinder A to retract.
Motion causes Sensor_A_Max to turn off, then Sensor_A_Min to turn on.
Cyl_B_Fwd turns on.
Cylinder_B turns on, which causes Cylinder B to extend.
Motion causes Sensor_B_Min to turn off, then Sensor_B_Max to turn on.
Cyl_B_Backwd turns on.
Cylinder_B turns off, which causes Cylinder B to retract.
Motion causes Sensor_B_Max to turn off, then Sensor_B_Min to turn on.
RESET turns on, which causes the following:

Cyl_A_Fwd turns off
Cyl_A_Backwd turns off
Cyl_B_Fwd turns off
Cyl_B_Backwd turns off
RESET turns off



At this point, you are back to the beginning, and a push of the START button will begin a new cycle.

If you are looking for a beginner tutorial or simulator for PLCs, there are quite a few to choose from by searching Google:


plc tutorial
plc simulator