Hi 10baseT
The main issue I was trying to impress on mhmtfthnl (have I spelled that correctly?) was that of timing. Given the entry level of his initial question I must admit I gave him a method without explaining in detail why.
There is no point in attempting to execute the FB41 PID block when the intervals between calling it are not regular. If the timebase for each succesive execution varies then how can the integration calculation be accurate, among other things? If he just calls it from OB1 then, almost by definition, the execution interval will vary. Calling it from within a timed interrupt like OB35 removes that problem entirely.
Of course, mhmtfthnl could write additional code in OB1 based on some time source to call his block at intervals. Again, I wasn't sure that recommending "oh, just write some code to do ... " was the appropriate answer for someone whose PID understanding appeared low. Anyway, since the feature exists already in the CPU I didn't see any need to re-invent the wheel.
Finally, what do you mean by STI operation and fixed time operation? I think I understand the latter (is this what I'm recommending?) but I'm not sure about the former. Have I missed something along the way in my handling of PID FBs?
Regards
Ken