The desired output can be taken by changing program through software that is installed in computer your computer must be connected with plc through data cable.PLC programming can be done through:
ladder logic
stl(statement list)
fbd(functional block diagram)
Ladder logic is famous :We called it ladder because it appearence looks like a ladder .
Vertical lines in ladder logic shows a power supply normally in dc 12 v or etc.Coil shows output and two small vertical lines shows a switch or input.