Note
Execute the PID instruction at constant intervals of the sampling time (preferably in a cyclic OB).
Because the PID loop needs a certain time to respond to changes of the control value, do not calculate the output value in every cycle. Do not execute the PID instruction in the main program cycle OB (such as OB 1).