Menu
CoddyTech

The Scan Cycle

Part of the First Rungs section of Coddy's PLC Programming journey. Lesson 2 of 20.

A PLC does not watch its inputs all the time. It works in scans, over and over, about every 10 ms here:

  1. read every input into memory (the input image)
  2. solve the rungs, top to bottom
  3. write every output

So a rung sees the button as it was at the start of the scan, and a lamp changes only at the end of one. Press Step one scan on the machine to run a single scan and watch it happen.

To keep a button pressed, hold it down for half a second: a pin shows it stays pressed. Click it again to let go.

challenge icon

Challenge

Easy

Rung 1 already lights Green from PB1. Add rung 2 so PB2 lights Red.

Then hold PB2, press Step one scan a few times and watch the I/O table, then Check.

Try it yourself

{"v":1,"lang":"ld","tags":[],"rungs":[{"els":[{"t":"no","tag":"PB1"},{"t":"coil","tag":"Green"}]},{"els":[]}]}

All lessons in First Rungs

Practice on your own: PLC playground