
CONFIGURATION
FUNCTION BLOCKS
4 - 4
I-E96-213A
®
c.
Calculate the total time used by the normal priority
function blocks during the available 2 seconds:
Normal priority blocks = 0.093 seconds used each time
they are executed.
Executed 8 times during the 2 second interval.
Therefore 8 x 0.088 = 0.704 CPU seconds used by the nor-
mal priority tasks every 2 seconds.
8. Calculate the amount of time required for high priority
function blocks to execute.
a. Multiply 5 PID blocks by 690 microseconds = 0.00345
seconds
b. Multiply 5 Square Root blocks by 240 microseconds =
0.00120 seconds.
c.
Add products:
0.00345
+ 0.00120
0.00465 seconds
The above sum represents CPU time used by one pass of
the high priority loop.
d. Multiply 20 times per second by 2 seconds = 40 times
in 2 seconds (number of times the high priority loops are
run within maximum CPU time allotted).
e.
Multiply 0.00465 by 40 = 0.186 seconds (the amount of
CPU time the high priority loops use within the 2 second
maximum).
9. Add the final products.
0.093 (CPU seconds used by low priority loops)
0.744 (CPU seconds used by normal priority loops)
+0.186 (CPU seconds used by high priority loops)
1.023 seconds = total CPU time used by this configuration
10. Finally, subtract the total CPU time from the maximum
amount of CPU time specified.
2.000 seconds available
-0.977 seconds used by the control blocks
1.023 seconds of CPU time still available.
The results of the previous calculations determine that the
selected configuration will run.