5.4 Ladder Logic Programming
Key Concepts
- Rungs
- Contacts
- Coils
- Timers
- Counters
Rungs
Rungs are the horizontal lines in ladder logic diagrams that represent individual control circuits. Each rung typically represents a single logic operation or a sequence of operations. The left vertical rail represents the power supply, and the right vertical rail represents the return path.
Example: In a simple motor control circuit, one rung might represent the start button, another might represent the stop button, and a third might represent the motor relay.
Contacts
Contacts are the symbols in ladder logic that represent the state of a device (e.g., a switch or sensor). There are two types of contacts: normally open (NO) and normally closed (NC). Normally open contacts are open when the device is off and close when the device is on. Normally closed contacts are closed when the device is off and open when the device is on.
Example: In a safety circuit, a normally closed contact from an emergency stop button ensures that the circuit is broken when the button is pressed, immediately stopping the motor.
Coils
Coils are the output elements in ladder logic that represent the action to be taken (e.g., turning on a motor or activating a relay). When the conditions in a rung are met, the coil energizes, causing the corresponding action to occur. Coils can also be used to set or reset internal memory bits.
Example: In a lighting control system, a coil might represent the relay that turns on the lights. When the switch is activated, the coil energizes, closing the relay and turning on the lights.
Timers
Timers are special elements in ladder logic that introduce time delays into the control sequence. There are different types of timers, such as on-delay timers and off-delay timers. On-delay timers start timing when the input is activated and produce an output after the specified delay. Off-delay timers continue to produce an output for a specified time after the input is deactivated.
Example: In a traffic light control system, an on-delay timer might be used to keep the green light on for a specified duration before switching to the yellow light.
Counters
Counters are elements in ladder logic that count the number of times an event occurs. They can be used to trigger an action after a certain number of events have been detected. Counters can be set to count up or down and can be reset to zero when a specified condition is met.
Example: In a packaging machine, a counter might be used to count the number of products that have been packed. When the counter reaches a preset value, it triggers the machine to stop and change the packaging material.