Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(EOD).Mechatronics.pdf
Скачиваний:
81
Добавлен:
23.08.2013
Размер:
5.07 Mб
Скачать

page 500

28. FUNCTION BLOCK PROGRAMMING

• This is a procedural programming language that resembles block diagrams. To date this has been primarily popularized by programs such as Labview.

28.1 INTRODUCTION

This graphical language is part of the IEC 1131-3 standard.

An example is given below.

N7:0 SIN

*

A < B

O:000/01

N7:1

LN

N7:2

There are different data types for the connection lines.

Inputs and outputs can be negated by adding a inverting input or output.

• The functions in the diagrams are based on the other functions available. The inputs to a function enter on the left of the block, and the outputs of the function emerge from the right.

page 501

Structural Text Function

Function Block Equivalent

 

 

 

 

 

 

 

 

 

A

 

 

 

O

O := ADD(A, B);

 

ADD

 

 

 

 

 

 

B

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• Some functions can have a variable number of arguments. Here there is a third value input to the add block. This is known as overloading.

Structural Text Function

Function Block Equivalent

 

 

 

 

 

 

 

 

 

A

 

 

 

O

O := ADD(A, B, C);

 

ADD

 

 

 

 

 

 

B

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• The ADD function in the example must always have the same inputs, other functions may have variable numbers of arguments.

Structural Text Function

Function Block Equivalent

 

 

 

 

 

 

 

 

 

A

 

 

 

 

 

 

MN

 

O

 

 

 

O := LIM(MN := A, IN := B, MX := C);

 

 

LIM

 

 

 

 

 

 

B

 

IN

 

 

 

 

 

 

 

C

 

MX

 

 

 

 

 

 

O

 

 

 

 

 

 

 

 

 

 

O := LIM(MN := A, IN := B);

A

 

MN LIM

 

 

 

 

 

 

 

B

 

IN

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• The tables of

28.2 PRACTICE PROBLEMS

page 502

1.

Соседние файлы в предмете Электротехника