190
5-21
Block Programming Instructions
Block programming facilitates coding operations which are difficult to write
with normal ladder diagrams, i.e. ladder diagrams which include sequential
arithmetic operations or conditional branching. It also reduces the overall
cycle time. Up to 100 block programs may be defined in a given main pro-
gram.
5-21-1
Overview
Block programming instructions are not part of the ‘ladder’ section of a lad-
der-diagram program. Rather, they are written in sequence down the right
side of the ladder diagram. Block programming instructions still require ex-
ecution conditions, and most of them require operands.
Instructions dedicated for use within block programs are distinguished by
pointed parentheses <like these>. For example, FUN<02> is IF, whereas
IL(02) is IL. BPRG(96), which is used to start a section of block programming
instructions, is a normal ladder-diagram program instructions. Block program-
ming instructions are treated as NOP(00) if programmed outside a block pro-
gram.
None of the following instructions can be used within a block program:
OUT
OUT NOT
TIM
CNT
END(01)
IL(02)
ILC(03)
JMP(04)
JME(05)
STEP(08)
SNXT(09)
SFT(10)
KEEP(11)
CNTR(12)
DIFU(13)
DIFD(14)
TIMH(15)
SBN(92)
RET(93)
All Differentiated Instructions (i.e., those preceded by @)
If these instructions are included with in block programs, they will be treated
as NOP(00). Other instructions may be used within a block program. Instruc-
tions such as LD, AND, and OR are still used to create execution conditions.
In a block program, however, these are written in their mnemonic form, rather
than in the normal ladder-diagram form.
5-21-2
BLOCK PROGRAM BEGIN – BPRG(96) and
BLOCK PROGRAM END – BEND<01>
N
: Block program number
# (00 to 99)
Ladder Symbols
Definer Data Areas
BPRG(96) N
BEND<01>
BPRG(96) is used to switch to block programming and BEND<01> is used to
switch back to ladder-diagram programming. For every BPRG(96) there must
be a corresponding BEND<01>.
00500
BPRG(96)
99
Block program.
00600
BEND<01>
BPRG(96) 99
BEND<01>
Block program
Address
Instruction
Operands
Instructions Not Available
for Use Within Block
Programs
Description
Block Programming Instructions
Section 5-21