Contr_Conn said:
If you set rate for each task little different they will not interfere:
Example: 500ms, 505ms, 510ms etc.
This arrangement will definitely lower the rate at which the programs conflict, but it won't eliminate them. Every once in a while all three of those programs are going to try to execute at the same time (kind of a grand alignment of the planets). When that happens, two of them are going to run late. How often this happens is impacted by how long each program executes. If it's more than 5ms, it happens often. Conflicts between just two of the programs happen more often.
My preference for this situation would be to put all three programs in the same periodic task but arrange as follows:
Execute first, any program that requires accurate timing and let the remaining programs jitter if they can tolerate it.
Or if all the programs require accurate timing, then first execute the program that has the most stable execution time. And execute the program with the least stable execution time last.
Or re-write the programs so the execution time is more stable. The programs would necessarily run slower, but take the same amount of time on every scan.
In reality, most programs don't have these requirements and you can arrange your programs within the task in whatever order looks nice. <g>
I do like your recommendation about using only periodic tasks and leaving the continuous task empty. I've played with that style but haven't put it on a plant floor yet. I agree that it's a carryover from the PLC5 "let it go as fast as it can" style.