
Chapter
4
Reference Manual
IVC-2D
152
©
SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
Program
If
The 'If' tool is used together with an 'End' tool and optionally an 'Else' tool for enclosing
programs steps that should only be executed if a certain condition is fulfilled:
If the condition in the
Control expression
is true all program steps are executed bet-
ween this tool and the tool referred to by the
ELSE or END step
parameter.
If the tool referred to is an 'Else' tool, the steps following that tool are skipped and the
program continues with the program steps following the 'End' tool referred to by the 'El-
se' step.
If the condition in the
Control expression
is false the following program steps are skip-
ped and the program continues with the program steps following the tool referred to by
the
ELSE or END step
parameter.
A construction with an 'If'
tool must always end with an 'End' tool.
Input Parameters
01 = Control expression
Definition: 0 = false.
Boolean operations and mathematical expres-
sions are allowed, for example
= (v2 > v5)
02 = ELSE or END step
Step number that refers to the corresponding
'Else' or 'End' tool. .
Returned Values
None
Example
tool : If
01 =
Control expression
: (condition)
02 =
END step
:
4
Step
1
Program step
Program step
Program step
Step 2
Step 3
Step 5
tool : End
01 = Start step :
1
Step
4
tool : If
01 =
Control expression
: (condition)
02 =
END step
:
4
Step
1
Program step
Program step
Step 2
Step 3
tool : End
01 = Start step :
1
Step
6
tool : Else
01 = IF step :
1
02 =
END step
:
6
Step
4