Challenge - 5 Problems
POU Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediateOutput of a POU call sequence
Given the following PLC program organization units (POUs), what will be the final value of the variable
counter after execution?PLC Programming
FUNCTION_BLOCK FB1 VAR counter : INT := 0; END_VAR METHOD Increment counter := counter + 1; END_METHOD PROGRAM Main VAR fb1_inst : FB1; END_VAR fb1_inst.Increment(); fb1_inst.Increment(); fb1_inst.Increment();
Attempts:
2 left
💡 Hint
Think about how many times the Increment method is called and how it changes the counter.
✗ Incorrect
The Increment method increases the counter by 1 each time it is called. Since it is called three times, the final value is 3.
📝 Syntax
intermediateIdentify the correct POU declaration syntax
Which of the following is the correct way to declare a FUNCTION POU named
CalculateSum that takes two INT inputs and returns their sum as INT?Attempts:
2 left
💡 Hint
Remember that inputs must be declared in VAR_INPUT and the function name is assigned the return value.
✗ Incorrect
Option A correctly declares inputs in VAR_INPUT, specifies the return type, and assigns the sum to the function name.
🔧 Debug
advancedFind the error in this FUNCTION_BLOCK POU
What error will occur when compiling this FUNCTION_BLOCK POU code?
PLC Programming
FUNCTION_BLOCK FB_Timer VAR startTime : TIME; elapsed : TIME; END_VAR METHOD Start startTime := TIME(); END_METHOD METHOD GetElapsed : TIME GetElapsed := TIME() - startTime; END_METHOD
Attempts:
2 left
💡 Hint
Check the end of each statement carefully for punctuation.
✗ Incorrect
The line assigning GetElapsed is missing a semicolon at the end, causing a syntax error.
🚀 Application
advancedDetermine the number of instances created
In a PLC program, if you declare the following PROGRAM and FUNCTION_BLOCK instances, how many total instances of
FB_MotorControl exist during runtime?PLC Programming
FUNCTION_BLOCK FB_MotorControl VAR speed : INT; END_VAR PROGRAM Main VAR motor1 : FB_MotorControl; motor2 : FB_MotorControl; motor3 : FB_MotorControl; END_VAR PROGRAM Secondary VAR motorA : FB_MotorControl; END_VAR
Attempts:
2 left
💡 Hint
Count all declared instances across all programs.
✗ Incorrect
There are three instances in Main and one in Secondary, totaling four instances.
🧠 Conceptual
expertUnderstanding POU execution order in cyclic tasks
In a PLC cyclic task, if you have multiple PROGRAM POUs scheduled in the same task, which statement best describes their execution order?
Attempts:
2 left
💡 Hint
Think about how PLC tasks manage multiple programs in a cycle.
✗ Incorrect
PLC cyclic tasks execute PROGRAM POUs one after another in the configured order each cycle.
