Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare a function block instance named 'Motor1'.
PLC Programming
VAR
Motor1 : [1];
END_VARAttempts:
3 left
💡 Hint
Common Mistakes
Using PROGRAM instead of the function block type.
Using VAR keyword incorrectly.
✗ Incorrect
In PLC programming, a function block instance is declared by specifying the function block type (Motor) after the colon in the VAR section.
2fill in blank
mediumComplete the code to call the 'Start' method of the function block instance 'Motor1'.
PLC Programming
Motor1.[1]();Attempts:
3 left
💡 Hint
Common Mistakes
Calling 'Stop' instead of 'Start'.
Using 'Init' which might initialize but not start.
✗ Incorrect
To start the motor, you call the 'Start' method on the Motor1 instance.
3fill in blank
hardFix the error in the code to correctly assign a value to the 'Speed' property of 'Motor1'.
PLC Programming
Motor1.[1] := 1500;
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'speed' instead of 'Speed'.
Trying to assign to a method name like 'SetSpeed'.
✗ Incorrect
Property names are case sensitive; 'Speed' with capital S is correct.
4fill in blank
hardFill both blanks to declare two instances 'Pump1' and 'Pump2' of the function block 'PumpControl'.
PLC Programming
VAR [1] : PumpControl; [2] : PumpControl; END_VAR
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping instance names with type names.
Using incorrect type name 'ControlPump'.
✗ Incorrect
Instance names are 'Pump1' and 'Pump2', both declared as type 'PumpControl'.
5fill in blank
hardFill all three blanks to create a function block instance 'Conveyor1', set its 'Speed' to 100, and call its 'Start' method.
PLC Programming
VAR [1] : Conveyor; END_VAR [1].[2] := 100; [1].[3]();
Attempts:
3 left
💡 Hint
Common Mistakes
Using type name instead of instance name in code lines.
Mixing up property and method names.
✗ Incorrect
Declare instance 'Conveyor1' of type 'Conveyor', set 'Speed' property, then call 'Start' method.
