Jump to content

PLC/Programming basics

From Wikiversity

Logic is integral to the programming of PLCs.

Logic gates

[edit | edit source]
  • And gate
  • Or gate
  • Nor gate
  • Nand gate

Programming types

[edit | edit source]
  • Ladder logic - simplified representation of electronic schematics

Common PLC functions

[edit | edit source]

Inputs

[edit | edit source]
  • I (Inputs) - These bits represent the connection to any external control input device wired to the PLC, including switches, buttons and motion sensors.

Outputs

[edit | edit source]
  • O (Output) - Each output bit can only be used as an output once.

Internal bits

[edit | edit source]

Internal bits make possible almost limitless necessary logical constructs to be made.

Latches

[edit | edit source]
Ladder logic symbol (normally closed)
Ladder logic symbol
(normally closed)

Holds an electrical function on. A momentary push-button, output (from a timer or counter) or an internal bit are capable of triggering a latch. Latches have the same reference as the output on the same rung. Ideally, a latch must be foolproof with an emergency stop from an input. Latches represent virtual relays.

Timers

[edit | edit source]
  • TON (Timer on) - once powered waits until its preset time to turn on the output.
  • TOF (Timer off) - turns on when powered, then turns off when the preset time is reached
  • RTF (Retaining timer) - are potentially dangerous as they keep count even if the PLC is reset.

Counters

[edit | edit source]
  • CTU (Counter up) - Every time this counter gets continuous power, this counter counts up. Once a function is reached it outputs.
  • CTD (Counter down) - Similar to CTU, except this counts down.

Sequencers

[edit | edit source]

Sequencers are capable of using internal (binary) logic bits to shortcut repetitive ladder logic.

See also

[edit | edit source]