Program Organization Units (POU) in PLC Programming
📖 Scenario: You are working on a simple PLC program to control a conveyor belt system in a factory. The system needs to start and stop the conveyor based on sensor inputs.To keep the program organized and easy to maintain, you will use Program Organization Units (POUs) to separate different parts of the logic.
🎯 Goal: Build a PLC program using POUs: a main program and a function block to control the conveyor belt start and stop logic.
📋 What You'll Learn
Create a main program POU named MainProgram.
Create a function block POU named ConveyorControl with input and output variables.
Use the function block inside the main program to control the conveyor.
Print or display the conveyor status.
💡 Why This Matters
🌍 Real World
POUs help organize PLC programs into smaller, manageable parts, making it easier to build and maintain automation systems like conveyor belts.
💼 Career
Understanding POUs is essential for PLC programmers working in manufacturing, automation, and industrial control systems.
Progress0 / 4 steps
1
Create the main program POU
Create a program organization unit (POU) named MainProgram as a program type. Inside it, declare a variable conveyorStatus of type BOOL and set it to FALSE.
PLC Programming
Hint
Use PROGRAM MainProgram to start the main program POU and declare variables inside VAR ... END_VAR.
2
Create the ConveyorControl function block POU
Create a function block POU named ConveyorControl. Inside it, declare an input variable startSignal of type BOOL, an input variable stopSignal of type BOOL, and an output variable conveyorRunning of type BOOL.
PLC Programming
Hint
Use FUNCTION_BLOCK ConveyorControl to create the function block and declare inputs inside VAR_INPUT ... END_VAR and outputs inside VAR_OUTPUT ... END_VAR.
3
Add logic inside ConveyorControl function block
Inside the ConveyorControl function block, write logic so that conveyorRunning becomes TRUE when startSignal is TRUE, and becomes FALSE when stopSignal is TRUE.
PLC Programming
Hint
Use an IF ... ELSIF ... END_IF statement to set conveyorRunning based on startSignal and stopSignal.
4
Use ConveyorControl in MainProgram and display status
In the MainProgram, create an instance of ConveyorControl named conveyor. Set startSignal to TRUE and stopSignal to FALSE. Then assign conveyorStatus to conveyor.conveyorRunning. Finally, print the value of conveyorStatus.
PLC Programming
Hint
Create an instance of the function block, set its inputs, update the main variable from its output, and print or display the status.
Practice
(1/5)
1. Which of the following is NOT a type of Program Organization Unit (POU) in PLC programming?
easy
A. MODULE
B. PROGRAM
C. FUNCTION
D. FUNCTION_BLOCK
Solution
Step 1: Recall POU types
The three main POUs are PROGRAM, FUNCTION_BLOCK, and FUNCTION.
Step 2: Identify the incorrect option
MODULE is not a standard POU type in PLC programming.
Final Answer:
MODULE -> Option A
Quick Check:
POUs = PROGRAM, FUNCTION_BLOCK, FUNCTION [OK]
Hint: Remember only three POUs: PROGRAM, FUNCTION_BLOCK, FUNCTION [OK]
Common Mistakes:
Confusing MODULE with FUNCTION_BLOCK
Thinking FUNCTION_BLOCK is not a POU
Mixing hardware modules with POUs
2. Which syntax correctly declares a FUNCTION_BLOCK named MotorControl in IEC 61131-3 standard?
easy
A. PROGRAM MotorControl
END_PROGRAM
B. FUNCTION MotorControl
END_FUNCTION
C. FUNCTION_BLOCK MotorControl
END_FUNCTION_BLOCK
D. FUNCTION_BLOCK MotorControl() END_FUNCTION_BLOCK
Solution
Step 1: Identify correct POU declaration syntax
FUNCTION_BLOCK declaration starts with 'FUNCTION_BLOCK Name' and ends with 'END_FUNCTION_BLOCK'.
Step 2: Check each option
FUNCTION_BLOCK MotorControl
END_FUNCTION_BLOCK matches correct syntax; PROGRAM and FUNCTION declare different POUs; the version with parentheses is invalid.
Final Answer:
FUNCTION_BLOCK MotorControl\nEND_FUNCTION_BLOCK -> Option C
A. METHOD keyword is not allowed inside FUNCTION_BLOCK
B. TIME() is not a valid way to get current time
C. StartTime variable must be VAR_INPUT
D. FUNCTION_BLOCK must not have variables
Solution
Step 1: Check METHOD usage in FUNCTION_BLOCK
METHODs are allowed inside FUNCTION_BLOCKs to define actions.
Step 2: Verify TIME() usage
TIME() is not a standard function to get current time in PLC; this causes an error.
Final Answer:
TIME() is not a valid way to get current time -> Option B
Quick Check:
Invalid TIME() call = TIME() is not a valid way to get current time [OK]
Hint: Check if functions used are standard PLC functions [OK]
Common Mistakes:
Assuming METHODs are disallowed
Thinking all variables must be inputs
Believing FUNCTION_BLOCKs can't have variables
5. You want to create reusable code that holds internal state and can be called multiple times with different inputs. Which POU type should you choose and why?
hard
A. FUNCTION, because it can be called multiple times with different inputs
B. PROGRAM, because it organizes the entire PLC project
C. FUNCTION, because it returns a value and holds state internally
D. FUNCTION_BLOCK, because it can hold data and be reused with different instances
Solution
Step 1: Understand POU types and their features
FUNCTION_BLOCKs can hold internal data/state and be instantiated multiple times.
Step 2: Compare with other POUs
FUNCTIONs return values but do not hold state; PROGRAMs organize code but are not reusable units with state.
Final Answer:
FUNCTION_BLOCK, because it can hold data and be reused with different instances -> Option D
Quick Check:
Reusable with state = FUNCTION_BLOCK [OK]
Hint: Use FUNCTION_BLOCK for reusable code with internal state [OK]
Common Mistakes:
Choosing FUNCTION for holding state
Confusing PROGRAM with reusable unit
Ignoring difference between FUNCTION and FUNCTION_BLOCK
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.