If ... Else ... Endi Structure; Repeat ... Until Structure - HEIDENHAIN TNC 426 PB/M Technical Manual

Table of Contents

Advertisement

7.13.1 IF ... ELSE ... ENDI structure

7.13.2 REPEAT ... UNTIL structure

December 2001
The IF ... ELSE ... ENDI structure permits the alternative processing of two
program branches depending on the value in the logic accumulator. The ELSE
branch is not mandatory. The following commands are available:
n
IFT (IF LOGIC ACCU TRUE):
Following code only if logic accumulator = 1
n
IFF (IF LOGIC ACCU FALSE):
Following code only if logic accumulator = 0
n
ELSE (ELSE):
Following code only if IF is not fulfilled
n
ENDI (END OF IF STRUCTURE):
End of the IF structure
Function
Load input I0 into the logic accumulator
Run the following code if logic accumulator = 1
Program code for I0 = 1
Run the following code if logic accumulator = 0;
command can be omitted
Program code for I0 = 0, can be omitted
End of the conditional processing
The REPEAT ... UNTIL structure repeats a program sequence until a condition
is fulfilled. Under no circumstances can you wait with this structure in the
cyclic PLC program for the occurrence of an external event! The following
commands are available:
n
REPEAT (REPEAT):
Repeat the program sequence from here.
n
UNTILT (UNTIL TRUE):
Repeat the sequence until the logic accumulator = 1.
n
UNTILF (UNTIL FALSE):
Repeat the sequence until the logic accumulator = 0.
The TNC runs a REPEAT ... UNTIL loop at least once!
Function
Assign the content of the logic accumulator to
marker 100, conclusion of the previous commands
Repeat the following program code
Program code to be run
Load the index register
Check the index register
Repeat until X >= 100
Program Structures
STL
L I0
IFT
ELSE
ENDI
STL
= M100
REPEAT
L X
>= K100
UNTILT
7 – 171

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tnc 430 pa/mTnc 430 mTnc 426 cbTnc 430 caTnc 426 pbTnc 430 pa ... Show all

Table of Contents