Hello Austin,
Thanks for an extensive explanation on this topic. Idle task class and TcIdleFiller
I have a PLC system with Idle task class #2 (4ms) and task class idle time 2000 µs.
Now, If I change the idle task class to #6 (50ms) and task class idle time 6000 µs. Cyclic #6 has no tasks. I am keeping it only for Idle.
I see significant reduction in CPU usage on SDM (from ~60% to ~25%). I am running mappView for visualization and OPC fastest sampling is 100ms.
My questions:
- Is lower CPU loading with this configuration a better idea?
- Should it affect any other system tasks?
- Should the lower CPU loading be helpful for mappView performance?
Thanks in Advance…
Hello Viral,
The bullet points from the original post that address your questions are here:
- When the SDM displays CPU usage, the value is: 100% - [time spent at Priority 0, IDLE]. For example, if you spent 5% of the CPU time at priority 0, then the CPU usage is 95%.
- Even though TcIdleFiller is a no-op, it is still considered CPU usage in the SDM.
The key takeaway from these points is that the SDM relies on a simplified view that only takes into account ‘pure’ IDLE (priority 0). The excess idle time of the Task Class Idle Time is counted as CPU usage, despite the TcIdleFiller running the same no-op as IDLE.
(fun fact: answering this question is why I wrote this article)
To address your questions:
Is lower CPU loading with this configuration a better idea?
It has basically no effect on a system spending 85% of its time with idle time tasks. If the CPU usage increases as you continue in your development, then it becomes more of a tuning question as you trade off consistent system task operation for consistency in lower (priority) task classes.
Should it affect any other system tasks?
It will have no noticeable effect.
Should the lower CPU loading be helpful for mappView performance?
It will have no noticeable effect.
-Austin
1 Like