Conditional Block Run; Program Branching If..then..else..endif - HEIDENHAIN MANUALPLUS 620 User Manual

Smart.turn and iso programming
Hide thumbs Also See for MANUALPLUS 620:
Table of Contents

Advertisement

4.32 Conditional Block Run

Program branching IF..THEN..ELSE..ENDIF

A conditional branch consists of the elements:
IF, followed by a condition. The condition includes a variable or
mathematical expression on either side of the relational operator.
THEN. If the condition is fulfilled, the THEN branch is executed.
ELSE. If the condition is not fulfilled, the ELSE branch is executed.
ENDIF concludes the conditional program branch.
Interrogate bitset: You can also use the BITSET function as
condition. The function returns 1 if the numerical value contains the
requested bit. The function returns 0 if the numerical value does not
contain the requested bit.
Syntax: BITSET (x,y)
x: Bit number (0 to 15)
y: Numerical value (0 to 65535)
The relationship between bit number and numerical value is shown in
the table at right. You can also use variables for x, y.
Programming:
U
Select "Extras > DINplus word...". The MANUALplus opens the
"Insert DIN PLUS word" selection list.
U
Select IF.
U
Enter the condition.
U
Insert NC blocks of the THEN branch.
U
If required: Insert NC blocks of the ELSE branch.
NC blocks with IF, THEN, ELSE, ENDIF can have no
further commands.
You can combine up to two conditions.
364
Relational operators
<
Less than
<=
Less than or equal to
<>
Not equal to
>
Greater than
>=
Greater than or equal to
==
Equal to
Combining conditions:
AND
Logical AND operation
OR
Logical OR operation
which means
Bit
numerical
value
0
1
1
2
2
4
3
8
4
16
5
32
6
64
7
128
Example: IF..THEN..ELSE..ENDIF
N.. IF (#l1==1) AND (#g250>50)
N.. THEN
N..
G0 X100 Z100
N.. ELSE
N..
G0 X0 Z0
N.. ENDIF
. . .
N.. IF 1==BITSET(0,#l1)
N.. THEN
N..
PRINT("bit 0: OK")
. . .
which means
Bit
numerical
value
8
256
9
512
10
1024
11
2048
12
4096
13
8192
14
16384
15
32768
ISO Programming

Advertisement

Table of Contents
loading

Table of Contents