godfrey said:But isn't OB35 called on a regular timed basis regardless of the variation in scan time?
Originally posted by Combo:
Indeed, that's my problem too. Prev_Cycle changes ???
OB35 doesn't, so OB35 is much better, isn't it ?
kamenges said:This doesn't directly answer your original question. However, it doesn't matter so much that the value changes as long as you knbow what the value is. I haven't worked with FB41 before. As long as FB41 allows one to change the update rate every time it is called and it uses the latest update rate as part of the I & D calculations then using Prev_Cycle as the time should be OK. I have done something similar with other processors.
As for your original question I'm not sure why someone would choose to do this as opposed to using OB35. By using scan counters and selective FB calls several different update rates could be used out of a single OB35 update rate.
Keith
FrancisL said:Could the answer be that they just got it wrong?
Clearly using a time interrupt is better.
I have used OB35 for PID before - but not just by running all the PID's each time. Most PID's do not need to run every 100mSec, so use a little scheduler in OB35 so (a simple example) if you have 4 PID's then each will run once every 400mSec, but only one will run each 100mSec.
Combo said:Can anyone explain why some people use the Prev_Cycle Time instead of OB35 for PID block FB41 ???
L D[AR2 said:Going back to the original question:-
How do you know that some people do - or am I misinterpreting the question ?
RMA said:You can modify the OB35 interrupt period by right-clicking on the CPU in HW-Config -> object properties -> cyclic interrupts.
Don't make the time any shorter than you really need it, or you could end up unecessarily extending the cycle time.