How to Coding the speed for conveyor belt system

I have a conveyor belt machine, it's speed now control manually. I want connect it to the beckhoff terminal, how do coding it to control the speed of the conveyor?
Assuming you have Twincat software and hardware to control the conveyor,
you have a choice of programmng languages defined under IEC 61131-3.
First you have to work out what speed control is needed.