Standard Function Blocks
IEC 61131-3 defines a comprehensive set of standard function blocks that provide essential timing, counting, and logic functions for industrial automation applications.
🚀 Enhance Your Development Experience
Get syntax highlighting, IntelliSense, and debugging support for Structured Text:
Install VS Code Extension →Timer Function Blocks
Timer Function Blocks (TON, TOF, TP)
TON - Timer On Delay
Members:
- • IN: Start input (BOOL)
- • PT: Preset time (TIME)
- • Q: Timer output (BOOL)
- • ET: Elapsed time (TIME)
Delays the TRUE signal by the preset time.
TOF - Timer Off Delay
Members:
- • IN: Input signal (BOOL)
- • PT: Preset time (TIME)
- • Q: Timer output (BOOL)
- • ET: Elapsed time (TIME)
Delays the FALSE signal by the preset time.
TP - Timer Pulse
Members:
- • IN: Trigger input (BOOL)
- • PT: Pulse duration (TIME)
- • Q: Pulse output (BOOL)
- • ET: Elapsed time (TIME)
Generates a pulse of fixed duration.
Counter Function Blocks
Counter Function Blocks (CTU, CTD, CTUD)
CTU - Count Up
Members:
- • CU: Count up input (BOOL)
- • R: Reset input (BOOL)
- • PV: Preset value (INT)
- • Q: Output (CV ≥ PV)
- • CV: Current value (INT)
CTD - Count Down
Members:
- • CD: Count down input (BOOL)
- • LD: Load input (BOOL)
- • PV: Preset value (INT)
- • Q: Output (CV ≤ 0)
- • CV: Current value (INT)
CTUD - Count Up/Down
Members:
- • CU: Count up input (BOOL)
- • CD: Count down input (BOOL)
- • R: Reset input (BOOL)
- • LD: Load input (BOOL)
- • PV: Preset value (INT)
- • QU: Up output (CV ≥ PV)
- • QD: Down output (CV ≤ 0)
- • CV: Current value (INT)
Edge Detection Function Blocks
Edge Detection Function Blocks (R_TRIG, F_TRIG)
R_TRIG - Rising Edge
Members:
- • CLK: Input signal (BOOL)
- • Q: Edge output (BOOL)
Q is TRUE for one scan when CLK changes from FALSE to TRUE.
F_TRIG - Falling Edge
Members:
- • CLK: Input signal (BOOL)
- • Q: Edge output (BOOL)
Q is TRUE for one scan when CLK changes from TRUE to FALSE.
Bistable Function Blocks
Bistable Function Blocks (RS, SR)
RS - Set Dominant
Members:
- • S: Set input (BOOL)
- • R1: Reset input (BOOL)
- • Q1: Output (BOOL)
When both S and R1 are TRUE, Q1 = TRUE (Set wins).
SR - Reset Dominant
Members:
- • S1: Set input (BOOL)
- • R: Reset input (BOOL)
- • Q1: Output (BOOL)
When both S1 and R are TRUE, Q1 = FALSE (Reset wins).
Practical Application Example
Complete Conveyor Control Example
🚀 Key Benefits of Standard Function Blocks
- • Standardization: Consistent behavior across different PLC platforms
- • Reliability: Well-tested implementations with predictable timing
- • Efficiency: Optimized performance for real-time control systems
- • Maintainability: Familiar interfaces for all automation engineers
- • Safety: Proven components for safety-critical applications
