Complete the code to declare a variable in Structured Text.
VAR myVar : [1]; END_VARIn Structured Text, variables are declared with a type like INT for integers.
Complete the code to assign a value to a variable in Structured Text.
myVar [1] 10;
In Structured Text, ':=' is used to assign values to variables.
Fix the error in the conditional statement syntax.
IF myVar [1] 5 THEN myVar := 0; END_IF;
The correct comparison operator for 'greater than' is '>'.
Fill both blanks to create a loop that counts from 1 to 5.
FOR i := [1] TO [2] DO myVar := i; END_FOR;
The loop starts at 1 and counts up to 5.
Fill all three blanks to create a conditional that checks if myVar is less than 10 and assigns 10 if true.
IF myVar [1] [2] THEN myVar [3] 10; END_IF;
The condition checks if myVar is less than 10, then assigns 10 to myVar.
