SMB MAT-LC-C Series User Manual page 58

Plc based motion controller
Table of Contents

Advertisement

Calling function blocks in structured text
A function block is called by writing the instance name of the function block and then assigning
values to the parameters in parentheses. In the following example, a timer is called by assigning
values to two parameters IN and PT, and then the value of the resulting variable Q is assigned to
variable A.
RETURN instruction
The return instruction can be used to conditionally leave a POU ( POU ).
IF instruction
The IF instruction can check a condition and, according to this condition, execute the instruction.
Grammar:
IF <Boolean_expression1> THEN
<IF_instructions>
{ELSIF <Boolean_expression2> THEN
<ELSIF_instructions1>
.
.
ELSIF <Boolean_expression n> THEN
<ELSIF_instructions n-1>
ELSE <ELSE_instructions>}
END_IF;
Parts within {} are optional.
If the Boolean operation expression <Boolean expression> returns TRUE, only the part of the if
instruction is executed, and the other parts are not executed. Otherwise, the Boolean expression
starts with <Boolean expression 2> and is evaluated one by one until a Boolean expression
returns TRUE. Then, after this Boolean operation expression 2, the part before ELSE or ELSE IF
is calculated.
If none of the boolean expressions return TRUE, then only the instructions under ELSE are
evaluated. E.g:
IF temp<17
THEN heating_on := TRUE;
ELSE heating_on := FALSE;
END_IF;
Here the heating starts when the temperature drops below 17 degrees, otherwise it remains off.
CASE Instruction
Using the CASE instruction, you can combine multiple conditional judgment instructions with the
same condition variable in one structure. Sentence:
CASE <Var1> OF
<Value1>: <Instruction 1>
Languages...
58

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MAT-LC-C Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Mat-lc-c0 seriesMat-lc-c06Mat-lc-c07

Table of Contents