input and output mapping.
+1
input and output mapping.
...mark up the schematics accordingly.
Thanks to everyone, no exceptions, so far. This has been illuminating. Keep it coming if you have more, or sit back and enjoy.
Stay safe ... stay well ...
I will refer you to this youtube video.
Unrolling the Loops - Computerphile
https://www.youtube.com/watch?v=guXgBe2wvEA
It is a computerphile video of professor david brailsford reminiscing about john warnock unrolling the loops for a demonstration of the apple laserwriter.
#define pew ...
ct = n >>3;
for (i=0; i<ct; ++i) {
pew; pew; pew; pew; pew; pew; pew; pew;
}
ct = n - (ct<<3);
for (i=0; i<ct;++i) { pew; }
In motion control, loops are avoided. If the program gets stuck in an infinite loop there could be damage or death. I spoke with a customer that used mostly Delta Tau motion controllers at the time. We were comparing motion controllers. I told him we don't permits for or while loops. The customer said that even though the Delta Tau allows loops he doesn't permit them because of the risk of infinite loops.
Looping can be done but there must be a yield() function in the loop. The yield function will yield control of the processor and let other tasks run so that only the one task in an infinite loop is stuck. Actually, well make use of this feature a lot.
PLCs usually scan the whole program except when executing state machines like SFC. When executing SFCs the PLC just scans the active steps and not the whole program. Inside the SFC step one can use while or for loops but now the whole program can lock up. It is often better to put a looping condition in a transition. The transition functions like a yield function I mentioned above and will let other tasks or charts run.
SFCs don't get mentioned on this site very often but I think they are great for machine control because they make state machine programming easy.
Curious,
What would cause an infinite loop?
Most PLC's will not go into infinite loop as they have watchdog timers for safety (or at least should have).
Curious,
What would cause an infinite loop?