Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ATU on November 20, 2018, 08:37:55 AM
-
I have a program that has a couple of for/Next loops in stages and and an MRX instruction in the same program, but not in the loops. I am getting this Information message
M331 Asynchronous instruction MRX used in code-block with 2 yielding instructions
Is that a real problem or only a problem if it was inside one of the loops?
-
When looping instructions yield, other instructions don't get executed for one or more scans. Multiscan instructions can hang if they don't execute. It's just letting you know that the conditions exist for that to occur. As long as your loops don't take forever to execute, it's probably fine. We alert you so you can consider whether it is an issue.
-
So if i did have a long loop it would be best to put it in a separate code block? Would that allow the MRX instruction in the initiating program to execute?
-
So if i did have a long loop it would be best to put it in a separate code block? Would that allow the MRX instruction in the initiating program to execute?
Yes. My general rule is that if I have a loop that can't (or shouldn't) complete in a single scan, I put it in a TASK. That allows you to tune the time slice and balance loop completion time and scan time hit.