Scan order and a retained request
At Cedar Packing, one task reads a fixed input image, runs top to bottom, then transfers its output image. Its first statement assigns Motor from RunMemory. Its second sets RunMemory from Start. Start changes from false to true before scan 1, and both stored values begin false. Reason through the first two scans without changing the program.
Rubric and preparationWhat a mid answer covers · 1 lesson to prepare
Mid standard
- Motor reads the prior memory value before the second statement updates it, so a Start drop before scan 2 leaves Motor true for that scan and clears RunMemory.
- I check every writer and cross-reference before reordering because another routine or task can change the value; the last assignment here only explains this specified sequence.
- I compare false, true, held true and false requests with explicit expected rows because a slow trend can miss a one-scan pulse or retained output.