Hello,
1.What are the advantages and disadvantages of using freewheeling task?
2.What are the advantages and disadvantages of using cyclic task?
3.How to determine what task type(freewheeling or cyclic) to use?
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1.
Pros
Freewheel task length can be increased without much care
Gives the fastest treatment and I/O refresh if you only need a task
Cons
As next scan depends on previous scan time, scan time is inconsistent with jitter, depending on your code and the machine situation
Don't use it with any PID/PWM regulator, it's a bad idea (really bad)
2.
Pros
As scan times are more consistent, the machine tends to react the same, even if you have difference in scanned code from cycle to cycle
Tasks can be priorized to do critical stuff faster, thus giving more reactivity to important stuff you want and less to stuff that don't need it.
Only way to do motion or regulators
Decrease cpu usage with a lower schedule of some tasks (network stuff ? HMI ?)
Cons
Cycle time should be defined with care
Increasing scanned code may lead to a watchdog trigger
Priorization should be done correctly or some task may take very long to end
Priorization may lead to big time slice between two instructions
3.
Mostly if you need motion/regulators/safety, you will use cyclic tasks. Or to optimize some critical stuff and some less important.
Last edit: dFx 2021-12-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your response.
Regarding "Increasing scanned code may lead to a watchdog trigger" , it is relevant only if watchdog is enabled. Am I correct?
What happens if some scans take more time than Interval time?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Watchdog is a protection mecanism. I don't know the exact behavior, but scheduling a task shorter than its execution time usually leads to schedule kill by the OS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
1.What are the advantages and disadvantages of using freewheeling task?
2.What are the advantages and disadvantages of using cyclic task?
3.How to determine what task type(freewheeling or cyclic) to use?
Thanks in advance.
1.
Pros
Freewheel task length can be increased without much care
Gives the fastest treatment and I/O refresh if you only need a task
Cons
As next scan depends on previous scan time, scan time is inconsistent with jitter, depending on your code and the machine situation
Don't use it with any PID/PWM regulator, it's a bad idea (really bad)
2.
Pros
As scan times are more consistent, the machine tends to react the same, even if you have difference in scanned code from cycle to cycle
Tasks can be priorized to do critical stuff faster, thus giving more reactivity to important stuff you want and less to stuff that don't need it.
Only way to do motion or regulators
Decrease cpu usage with a lower schedule of some tasks (network stuff ? HMI ?)
Cons
Cycle time should be defined with care
Increasing scanned code may lead to a watchdog trigger
Priorization should be done correctly or some task may take very long to end
Priorization may lead to big time slice between two instructions
3.
Mostly if you need motion/regulators/safety, you will use cyclic tasks. Or to optimize some critical stuff and some less important.
Last edit: dFx 2021-12-15
Thanks for your response.
Regarding "Increasing scanned code may lead to a watchdog trigger" , it is relevant only if watchdog is enabled. Am I correct?
What happens if some scans take more time than Interval time?
Maybe you could have a read of Online Help - Task configuration
Watchdog is a protection mecanism. I don't know the exact behavior, but scheduling a task shorter than its execution time usually leads to schedule kill by the OS.