Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Jack H.Integration and automation of manufacturing systems.2001.pdf
Скачиваний:
86
Добавлен:
23.08.2013
Размер:
3.84 Mб
Скачать

page 206

PROGRAM 3

B

U STA

L STB

PROGRAM 4

C

U STB

L STC

A C

U STB

L STA

PROGRAM 5

D

U STC

L STB

MCR

7.21 DESIGN CASES

page 207

7.21.1 If-Then

• If-then can be implemented different ways, as a simple jump, or as a subroutine call.

A

JMP

LBL 01

IF (A) THEN GOTO (01)

01

LBL

A

JSR

FILE 3

IF (A) THEN {...... }

7.21.2 For-Next

• For-next can be implemented as shown below, but recall that PLC programs do not execute one line at a time.

page 208

LIM

 

N7:0

MCR

min 1

 

max 10

 

 

for i = 1 to 10

ADD

next i

 

source A: N7:0

 

source B: 1

 

Dest.: N7:0

 

 

MCR

A For/Next function is also available in the PLC.

A do-while can be done as a simple variation of this.

7.21.3 Conveyor

• Consider a conveyor where parts enter on one end. they will be checked to be in a left or

right orientation with a vision system. If neither left nor right is found, he part will be placed in a

reject bin. The conveyor layout is shown below.