Menu
CoddyTech

Steps as a Number

Part of the Analog and Sequences section of Coddy's PLC Programming journey. Lesson 7 of 17.

Many machines work in steps: fill, then mix, then drain. A tidy way to program that is a step number, an INT tag that says which step the machine is in:

  • 0: idle, waiting for Start
  • 1: filling
  • 2: mixing
  • 3: draining

Two kinds of rungs use it. A transition moves to the next step: a compare box checks the step it is in, a contact checks the condition, and MOVE writes the new number. An output rung turns an output on in its own step.

The machine is always in exactly one step, so the steps can never fight over an output.

challenge icon

Challenge

Medium
  • create an INT tag Step
  • in step 0, Start moves 1 into Step
  • in step 1, Fill is on, and High moves 0 into Step

Try it yourself

{"v":1,"lang":"ld","tags":[],"rungs":[{"els":[]}]}

All lessons in Analog and Sequences

Practice on your own: PLC playground