Скачиваний:
16
Добавлен:
10.07.2023
Размер:
975.62 Кб
Скачать

plc il - 18.9

Program File 2:

 

 

 

 

Label

 

Opcode

 

Operand

 

Comment

 

 

 

 

 

 

 

 

 

 

START:

 

CAL

 

3

 

(* Jump to program file 3 *)

 

 

 

 

 

 

 

Program File 3:

 

 

 

 

 

Label

 

Opcode

 

Operand

 

Comment

 

 

 

 

 

 

 

 

 

 

 

TEST:

 

LD

 

%I:000

 

(* Load the word from input card 000 *)

 

 

BCD_TO_INT

 

 

 

(* Convert the BCD value to an integer *)

 

 

ST

 

%N7:0

 

(* Store the value in N7:0 *)

 

 

GT

 

100

 

(* Check for the stored value (N7:0) > 100 *)

 

 

JMPC

 

ON

 

(* If true jump to ON *)

 

 

CAL

 

RES(C5:0)

 

(* Reset the timer *)

ON:

 

LD

 

2

 

(* Load a value of 2 - for the preset *)

 

 

ST

 

%C5:0.PR

 

(* Store 2 in the preset value *)

 

 

 

 

 

 

CAL

 

TON(C5:0)

 

(* Update the timer *)

 

 

LD

 

%C5:0.DN

 

(* Get the timer done condition bit *)

 

 

ST

 

%O:001/00

 

(* Set the output bit *)

 

 

RET

 

 

 

(* Return from the subroutine *)

Figure 18.7 An Example of an IL Program

18.4SUMMARY

Ladder logic can be converted to IL programs, but IL programs cannot always be converted to ladder logic.

IL programs use a stack to delay operations indicated by parentheses.

plc il - 18.10

• The Allen Bradley version is similar, but not identical to the IEC 61131 version of IL.

18.5PRACTICE PROBLEMS

18.6PRACTICE PROBLEM SOLUTIONS

18.7ASSIGNMENT PROBLEMS

1.Explain the operation of the stack.

2.Convert the following ladder logic to IL programs.

 

A

 

C

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

 

C

D

 

 

 

 

 

 

 

 

 

Y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LD 001

LD 001

LD NOT 001

AND 002

AND 002

OR 003

LD 004

LD 004

LD 002

AND 005

OR 007

OR 004

OR LD

AND 005

AND LD

OR 007

OR LD

LD 005

LD 003

LD 003

OR 007

OR NOT 006

OR NOT 006

AND 006

AND LD

AND LD

OR LD

 

 

 

OR NOT 008

3. Write the ladder diagram programs that correspond to the following Boolean programs.

OUT 204

OUT 204

 

 

AND 009

 

OUT 206

 

AND NOT 010

 

OUT 201

Соседние файлы в папке PLC