The scan cycle

A PLC repeats three steps for as long as it runs: it reads every input, runs your rungs from the top down, then writes every output. One round is one scan.

One scan: read all inputs, run the rungs from top to bottom, write all outputs, then start again.1Read inputsAll inputs,all at once2Run rungsTop to bottom,left to right3Write outputsAll outputs,all at onceThen again. The Scan setting (20 ms) sets how often.

One scan, before and after

The sample project turns MotorRun on when StartPB is pressed. Green shows where the rung passes power.

The motor seal-in rung in the Labs editor

Motor Starter Practice: a parallel branch holds MotorRun after StartPB is released.

Try it

  1. Open the free sandbox. It starts with Motor Starter Practice.
  2. Click Click to toggle bits, then click the StartPB contact. Nothing turns green yet.
  3. Click Single Scan. MotorRun turns on at the end of the scan.
  4. Turn StartPB off and scan again. MotorRun stays on, because its own contact now holds the rung. This is a seal-in.

Why it matters

The logic reads a copy of the inputs taken at the start of the scan, so an input cannot change halfway through. Outputs change only at the end, all together. If two rungs write the same output, the lower rung wins.

Good to know

  • An input that changes during a scan is seen on the next scan.
  • Time in Labs is simulated. Each scan moves the clock by exactly the scan time.
  • System_Scan_Count counts scans. System_Scan_First is on during the first scan only.

Learn it in a lesson

Related