Introduction to Industrial Automation


   Structural  Programming



Download 43,9 Mb.
Pdf ko'rish
bet286/440
Sana01.01.2022
Hajmi43,9 Mb.
#294756
1   ...   282   283   284   285   286   287   288   289   ...   440
Bog'liq
Introduction to Industrial Automation by Stamatios Manesis, George

7.3   Structural  Programming

The IEC 61131-3 standard, in addition to the programming languages that have been presented, 

defines the concepts and components of structural programming further, which replaces the unus-

able and simple listing of instructions within a single unified program. The term structural pro-

gramming means that the automation program is characterized by components that are different 

from each other and with a different task, defined as program modules. In this way, the IEC 

61131-3 introduces a complete software model for the PLC. These structural components are 

referred to in this standard as program organization units (POUs), while the standard defines 

three types of POUs as (name and possible abbreviation):

 



Functions F, FC, FUN

 



Function Blocks FB

 



Programs P, PB, PROG, OB

Each POU, independently of the type, consists of three parts:

 



The variable declaration section



 

The section with the characteristics of the POU (e.g., the name, date, issue number, etc.)



 

The part of the code where the function that the POU will execute is programmed



In Figure 7.6 an example of the “mask” of two FB POUs that are calling an FC POU is pre-

sented with the corresponding data transfer in the Siemens STEP-7 programming environment. 

The POUs can be defined either by the user or by the manufacturer and cannot be iterative. This 

means that a POU cannot call itself. The three POUs are defined in the standard as follows:



 



FUNCTIONS. A FUNCTION is a program block that has one or more inputs but only 

a single output. For a FUNCTION to be executed, all the inputs should have a numeric 

value, while a FUNCTION cannot store any information about its current or previous sta-

tus. This means that the execution of a FUNCTION with the same input values, as many 

times as it is called, will always provide the same value to the output. The IEC 61131-3 has 

set the standard FUNCTIONS that are supplied by the manufacturer of the PLC and the 



Basic Programming Principles of PLCs 



 



279

user-defined FUNCTIONS. For example, typical FUNCTIONS are AND, OR, ADD, 

ABS, SQRT, SIN, etc., some of which are extensible, which means that the user can decide 

on the number of the FUNCTION’s inputs. The user-defined FUNCTIONS, once defined, 

can be called as many times in the program, while they can be programmed by the user in 

any of the standard languages.



 



FUNCTION BLOCKS (FB). A FUNCTION BLOCK is a program block that has one or 

more inputs and one or more outputs. In addition, FB can store information about its status 

in contrast to the FUNCTION. This means that the output values depend not only on the 

input values but also on the stored information. To achieve this, each FB is directly linked 

to a data block (DB) where the values are stored, while to execute an FB, all inputs should 

have a numeric value.

    FBs have an operation that is related more to the integrated circuits (ICs) that implement 

a specific function. FBs contain data, as well an algorithm, and therefore can have a memory. 

Also, they have a well-defined interface and an invisible content, such as an IC has, which 

allows for the introduction of programming levels of different priorities. A temperature con-

trol law or a PID controller is a representative example of a user-defined FB. Once defined, 

it can be used as many times as needed in either the same program, different programs, or 

even in different projects, which is a feature that makes FBs absolutely reusable.

    FBs, as in the case of FUNCTIONS, may be standard FBs developed by the manufac-

turer of the PLC or by the user. Counters, timers, and flip-flops are key examples of standard 

FBs. FBs can be programmed in any language from the IEC standard and, in many cases, 

in C language also.



 



PROGRAMS. PROGRAMS are program blocks that are constructed by POUs, such as 

FBs and FCs, as well as by simple instructions. They do not have inputs and outputs, all the 

utilized variables should be universal, and are programmed in all the standard languages. 

PROGRAMS can only exist within the PLC and not within an FB or an FC.

FB10


with DB10

Variable declaration

Variable declaration

STAT


Speed

INT


CALL FC100

in_par1 := #Speed

in_par2 := MW100

in_par3 := DB10,DB40

FC100

Variable declaration



IN

IN

IN



in_par1

in_par2


in_par3

ANY


ANY

ANY


FB11

mit DB20


TEMP

Thermo


ARRAY [1..3]

REAL


#Thermo

M 1.3


T 2

FC100


in_par1

in_par2


in_par3


Download 43,9 Mb.

Do'stlaringiz bilan baham:
1   ...   282   283   284   285   286   287   288   289   ...   440




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish