El Plc_libro Programmable Logic Controllers _ Festo

Embed Size (px)

Citation preview

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    1/214

    093311

    Learning System for Automation and Technology

    Programmable logic

    controllers

    Basic level TP301 – Tetboo! 

    1A1

    S1 "

    TP#1$1

    TP

    1B1

    T%&s

    '( ) 1$1

    PT *T

    1$1

    1+1 , -

    & 31

    TP#1$1

    S1 1B1 1$1TP

    '( )

    T%&s PT *T

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    2/214

    B.''

    Authorised a//lications and liability

    The Learning System for Automation and Technology has  been devel.o/ed and  /re/ared eclusively for training in the field of automation The

    training organiation and2or trainee shall ensure that the safety  /recau.tions described in the accom/anying Technical documentation are fullyobserved

    esto 4idactic hereby ecludes any liability for in5ury to trainees6 to the

    training organiation and2or to third  /arties occurring as a result of theuse or a//lication of the station outside of a /ure training situation6 un.less caused  by  /remeditation or gross negligence on the /art of esto4idactic

    7rder (o8 0933114escri/tion8 SPS LB S4esignation8 4LB.TP301–1.B

    *dition8 0:2-00-

    Layout8 -:0:-00-6 7;ro

    Authors8 = Bliesener6 *bel6 ;L@ffler6 B Plagemann6=egber6 *vTeri6 A inter 

    C ;o/yright by esto 4idactic mb " ;o6 4.D3DD0 4en!endorf -00-

    The co/ying6 distribution and utiliation of this document as ?ell as thecommunication of its contents to others ?ithout e/ressed authoriationis  /rohibited 7ffenders ?ill be held liable for the  /ayment of damagesAll rights reserved6 in /articular the right to carry out  /atent6 utility modelor ornamental design registrations

    Parts of this training documentation may be du/licated6 solely for training

     /ur/oses6 by /ersons authorised in this sense

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    3/214

    B.'''

    TP301 E esto 4idactic

    Preface

    The  /rogrammable logic controller re/resents a !ey factor in industrial

    automation 'ts use /ermits fleible ada/tation to varying  /rocesses as?ell as ra/id fault finding and error elimination

    This tetboo! e/lains the design of a  /rogrammable logic controller andits interaction ?ith /eri/herals

    7ne of the main focal /oints of the tetboo! deals ?ith the ne? interna.

    tional standard for PL;  /rogramming6 the *( F1131.3 G'*;.F1131.3H

    This standard ta!es into account e/ansions and develo/ments6 for 

    ?hich no standardised language elements eisted hitherto

    The aim of this ne? standard is to standardise the design6 functionality

    and the  /rogramming of a PL; in such a ?ay as to enable the user toeasily o/erate ?ith different systems

    'n the interest of continual further im/rovement6 all readers of this  boo! are invited to ma!e contributions  by ?ay suggestions6 ideas and con.

    structive criticism

    August -00- The authors

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    4/214

    TP301 E esto 4idactic

    B.'+

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    5/214

    TP301 E esto 4idactic

    B.+

    Table of ;ontents

    ;ha/ter 1 Automating ?ith a PL; B.1

    11 'ntroduction B.1

    1- Areas of a//lication of a PL; B.-

    13 Basic design of a PL; B.&

    1, The ne? PL; standard *( F1131 G'*; F1131H B.:

    ;ha/ter - undamentals B.11

    -1 The decimal number system B.11

    -- The binary number system B.11

    -3 The B;4 code B.13

    -, The headecimal number system B.13

    -& Signed binary numbers B.1,

    -F =eal numbers B.1,

    -D eneration of binary and digital signals B.1&

    ;ha/ter 3 Boolean o/erations B.19

    31 Basic logic functions B.19

    3- urther logic o/erations B.-3

    33 *stablishing s?itching functions B.-&

    3, Sim/lification of logic functions B.-:

    3&

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    6/214

    TP301 E esto 4idactic

    B.+'

    ;ha/ter , 4esign and mode of o/eration of a PL; B.33

    ,1 Structure of a PL; B.33

    ,- ;entral control unit of a PL; B.3&

    ,3 unction mode of a PL; B.3D

    ,, A//lication  /rogram memory B.39

    ,& 'n/ut module B.,1

    ,F 7ut/ut module B.,3

    ,D Programming device2Personal com/uter B.,&

    ;ha/ter & Programming of a PL; B.,D

    &1 Systematic solution finding B.,D

    &- *( F1131.3 G'*; F1131.3H structuring resources B.&0

    &3 Programming languages B.&,

    ;ha/ter F ;ommon elements of /rogramming languages B.&D

    F1 =esources of a PL; B.&D

    F- +ariables and data ty/es B.F0

    F3 Program B.D0

    ;ha/ter D unction bloc! diagram B.:&

    D1 *lements of function bloc! diagram B.:&

    D- *valuation of net?or!s B.:&

    D3 Loo/ structures B.:D

    ;ha/ter : Ladder diagram B.:9

    :1 *lements of ladder diagram B.:9

    :- unctions and function bloc!s B.9-

    :3 *valuation of current rungs B.93

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    7/214

    B.+''

    TP301 E esto 4idactic

    ;ha/ter 9 'nstruction list B.9&

    91 'nstructions B.9&

    9- 7/erators B.9F

    93 unctions and function bloc!s B.9D

    ;ha/ter 10 Structured tet B.99

    101 */ressions B.99

    10- Statements B.101

    103 Selection statements B.103

    10, 'teration statements B.10F

    ;ha/ter 11 SeIuential function chart B.111

    111 'ntroduction B.111

    11- *lements of seIuential function chart B.111

    113 Transitions B.1-011, Ste/s B.1-3

    11& *am/le B.13&

    ;ha/ter 1- Logic control systems B.139

    1-1 hat is a logic control system B.139

    1-- Logic control systems ?ithout latching  /ro/erties B.139

    1-3 Logic control systems ?ith memory function B.1,&

    1-, *dge evaluation B.1,:

    ;ha/ter 13 Timers B.1&3

    131 'ntroduction B.1&3

    13- Pulse timer  B.1&,

    133 S?itch.on signal delay B.1&F

    13, S?itch.off signal delay B.1&:

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    8/214

    TP301 E esto 4idactic

    B.+'''

    ;ha/ter 1, ;ounter B.1F1

    1,1 ;ounter functions B.1F1

    1,- 'ncremental counter   B.1F1

    1,3 4ecremental counter   B.1F&

    1,, 'ncremental2decremental counter  B.1FD

    ;ha/ter 1& SeIuence control systems B.1F9

    1&1 hat is a seIuence control system B.1F9

    1&- unction chart to '*; F0:,: B.1F9

    ;ha/ter 1F ;ommissioning ando/erational safety of a PL; B.1D&

    1F1 ;ommissioning B.1D&

    1F- 7/erational safety of a PL; B.1DD

    ;ha/ter 1D ;ommunication B.1:3

    1D1 The need for communication B.1:3

    1D- 4ata transmission B.1:3

    1D3 'nterfaces B.1:,

    1D, ;ommunication in the field area B.1:&

    A//endi

    A Bibliogra/hy of illustrations B.1:D

    B Bibliogra/hy of literature B.1:9

    ; uidelines and standards B.191

    4 lossary B.193

    * 'nde B.199

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    9/214

    B.1

    TP301 E esto 4idactic

    ;ha/ter 1

    The PL; in automation technology

    11 'ntroduction

    The first Programmable Logic ;ontroller GPL;H ?as develo/ed  by agrou/ of engineers at eneral Jotors in 19F:6 ?hen the com/any ?ereloo!ing for an alternative to re/lace com/le relay control systems

    The ne? control system had to meet the follo?ing reIuirements8

    E Sim/le  /rogramming

    E Program changes ?ithout system interventionGno internal re?iringH

    E Smaller6 chea/er and more reliable than corres/onding relay controlsystems

    E Sim/le6 lo? cost maintenance

    SubseIuent develo/ment resulted in a system6 ?hich enabled the sim. /le connection of binary signals The reIuirements as to ho? these sig.nals ?ere to be connected ?ere s/ecified in the control  /rogram ith

    the ne? systems it became /ossible for the first time to /lot signals on ascreen and to file these in electronic memories

    Since then6 three decades have  /assed6 during ?hich the enormous /rogress made in the develo/ment of microelectronics did not sto/ shortof  /rogrammable logic controllers or instance6 even if /rogram o/timi.sation and thus a reduction of reIuired memory ca/acity initially still re/.

    resented an im/ortant !ey tas! for the  /rogrammer6 no?adays this ishardly of any significance

    Joreover6 the range of functions has gro?n considerably 1& years ago6

     /rocess visualisation6 analogue /rocessing or even the use of a PL; asa controller6 ?ere considered as Kto/ian  (o?adays6 the su//ort of these functions forms an integral /art of many PL;s

    The follo?ing /ages in this introductory cha/ter outline the basic design

    of a PL; together ?ith the currently most im/ortant tas!s and a//lica.tions

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    10/214

    TP301 E esto 4idactic

    B.-;ha/ter 1

    1- Areas of a//lication of a PL;

    *very system or machine has a controller 4e/ending on the ty/e of technology used6 controllers can be divided into  /neumatic6 hydraulic6electrical and electronic controllers reIuently6 a combination of differ.

    ent technologies is used urthermore6 differentiation is made bet?eenhard.?ired /rogrammable Geg ?iring of electro.mechanical or electronic

    com/onentsH and  /rogrammable logic controllers The first is used  /ri.marily in cases6 ?here any re/rogramming  by the user is out of theIuestion and the 5ob sie ?arrants the develo/ment of a s/ecial control.ler Ty/ical a//lications for such controllers can be found in automatic

    ?ashing machines6 video cameras6 and cars

    o?ever6 if the 5ob sie does not ?arrant the develo/ment of a s/ecialcontroller or if the user is to have the facility of ma!ing sim/le or inde.

     /endent /rogram changes6 or of setting timers and counters6 then theuse of a universal controller6 ?here the  /rogram is ?ritten to an elec.tronic memory6 is the  /referred o/tion The PL; re/resents such a uni.

    versal controller 't can be used for different a//lications and6 via the

     /rogram installed in its memory6  /rovides the user ?ith a sim/le means

    of changing6 etending and o/timising control  /rocesses

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    11/214

    TP301 E esto 4idactic

    B.3;ha/ter 1

    ig B118*am/le of aPL; a//lication

    The original tas! of a PL; involved the interconnection of in/ut signalsaccording to a s/ecified /rogram and6 if true6 to s?itch the corres/ond.ing out/ut Boolean algebra forms the mathematical basis for this o/era.tion6 ?hich recognises /recisely t?o defined statuses of one variable8 0and 1 Gsee also cha/ter 3H Accordingly6 an out/ut can only assumethese t?o statuses or instance6 a connected motor could therefore beeither s?itched on or off6 ie controlled

    This function has coined the name PL;8 Programmable logic control.

    ler6 ie the in/ut2out/ut behaviour is similar to that of an electro.magnetic relay or  /neumatic s?itching valve controllerM the  /rogram is

    stored in an electronic memory

    o?ever6 the tas!s of a PL; have ra/idly multi/lied8 Timer and counter functions6 memory setting and resetting6 mathematical com/uting o/era.tions all re/resent functions6 ?hich can be eecuted by /ractically any of todayNs PL;s

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    12/214

    TP301 E esto 4idactic

    B.,;ha/ter 1

    The demands to be met by PL;Ns continued to gro? in line ?ith their 

    ra/idly s/reading usage and the develo/ment in automation technology

    +isualisation6 ie the re/resentation of machine statuses such as thecontrol  /rogram being eecuted6 via dis/lay or monitor Also controlling6

    ie the facility to intervene in control  /rocesses or6 alternatively6 to ma!esuch intervention by unauthorised /ersons im/ossible +ery soon6 it also

     became necessary to interconnect and harmonise individual systemscontrolled via PL; by means of automation technology ence a master 

    com/uter facilitates the means to issue higher.level commands for  /ro.gram  /rocessing to several PL; systems

    The net?or!ing of several PL;s as ?ell as that of a PL; and master com/uter is effected via s/ecial communication interfaces To this effect6

    many of the more recent PL;s are com/atible ?ith o/en6 standardised

     bus systems6 such as Profibus to *( &01D0 Than!s to the enormouslyincreased /erformance ca/acity of advanced PL;s6 these can even di.rectly assume the function of a master com/uter

    At the end of the seventies6  binary in/uts and out/uts ?ere finally e. /anded ?ith the addition of analogue in/uts and out/uts6 since many of todayNs technical a//lications reIuire analogue /rocessing Gforce meas.urement6 s/eed setting6 servo./neumatic  /ositioning systemsH At thesame time6 the acIuisition or out/ut of analogue signals  /ermits an ac.tual2set/oint value com/arison and as a result the realisation of auto.matic control engineering functions6 a tas!6 ?hich ?idely eceeds the

    sco/e suggested by the name G/rogrammable logic controllerH

    The PL;s currently on offer in the mar!et /lace have  been ada/ted tocustomer reIuirements to such an etent that it has  become /ossible to

     /urchase an eminently suitable PL; for virtually any a//lication Assuch6 miniature PL;s are no? available ?ith a minimum number of in.

     /uts2out/uts starting from 5ust a fe? hundred Pounds Also available arelarger PL;s ?ith -: or -&F in/uts2out/uts

    Jany PL;s can be e/anded  by means of additional in/ut2out/ut6 ana.

    logue6 /ositioning and communication modules S/ecial PL;s are avail.

    able for safety technology6 shi//ing or mining tas!s $et further PL;sare able to  /rocess several /rograms simultaneously  – Gmultitas!ingHinally6 PL;s are cou/led ?ith other automation com/onents6 thus cre.ating considerably ?ider areas of a//lication

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    13/214

    TP301 E esto 4idactic

    B.&;ha/ter 1

    13 Basic design of a PL;

    The term N/rogrammable logic controllerN is defined as follo?s  by*( F1131.1 G'*; F1131.1H8

    O A digitally o/erating electronic system6 designed for use in an industrialenvironment6 ?hich uses a  /rogrammable memory for the internal stor.age of user.oriented instructions for im/lementing s/ecific functions

    such as logic6 seIuencing6 timing6 counting and arithmetic6 to control6through digital or analogue in/uts and out/uts6 various ty/es of ma.

    chines or /rocesses

    Both the P; and its associated /eri/herals are designed so that theycan be easily integrated into an industrial control system and easily usedin all their intended functions

    A /rogrammable logic controller is therefore nothing more than a com. /uter6 tailored s/ecifically for certain control tas!s

    ig B1-8*am/le of a PL;8esto 'P; PS1 Professional

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    14/214

    ;ha/ter 1

    ig B13 illustrates the system com/onents of a PL;

    ig B138System com/onents

    of a PL;PL;./rogram

    'n/ut module

    Sensors

    ;entral control unit 7ut/ut module

    Actuators

    The function of an in/ut module is to convert incoming signals into sig.nals6 ?hich can be  /rocessed by the PL;6 and to /ass these to the cen.tral control unit The reverse tas! is /erformed by an out/ut module This

    converts the PL; signal into signals suitable for the actuators

    The actual  /rocessing of the signals is effected in the central control unitin accordance ?ith the  /rogram stored in the memory

    The  /rogram of a PL; can be created in various ?ays8 via assembler.

    ty/e commands in Nstatement listN6 in higher.level6 /roblem.oriented lan.guages such as structured tet or in the form of a flo? chart such asre/resented  by a seIuential function chart 'n *uro/e6 the use of func.tion bloc! diagrams based on function charts ?ith gra/hic symbols for 

    logic gates is ?idely used 'n America6 the Nladder diagramN is the  /re.ferred language by users

    4e/ending on ho? the central control unit is connected to the in/ut and

    out/ut modules6 differentiation can be made bet?een com/act PL;sGin/ut module6 central control unit and out/ut module in one housingH or 

    modular PL;s

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    15/214

    ;ha/ter 1

    ig B1, sho?s the 0 controller by Jitsubishi and the 'P; *; Stan.dard controller by esto as an *am/le

    ig B1,8;om/act.PL;

    GJitsubishi 06esto 'P; *; StandardH6modular PL;GSiemens SD.300H

    Jodular PL;s may be configured individually The modules reIuired for 

    the /ractical a//lication – a/art from digital in/ut2out/ut modules6 ?hich

    can6 for instance6 include analogue6  /ositioning and communicationmodules – are inserted in a rac!6 ?here individual modules are lin!ed viaa bus system This ty/e of design is also !no?n as series technologyT?o eam/les of modular PL;s are sho?n in figs B1- and B1, Thesere/resent the modular system 'P; PS1 Professional  by esto and thene? SD.300 series  by Siemens

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    16/214

    ;ha/ter 1

    A ?ide range of variants eists6  /articularly in the case of more recentPL;s These include both modular as ?ell as com/act characteristicsand im/ortant features such as s/acing saving6 fleibility and sco/e for e/ansion

    The card format PL; is a s/ecial ty/e of modular PL;6 develo/ed duringthe last fe? years ith this ty/e6 individual or a number of /rinted circuit

     board modules are in a standardised housing

    The hard?are design for a  /rogrammable logic controller is such that itis able to ?ithstand ty/ical industrial environments as regard signal lev.els6 heat6 humidity6 and fluctuations in current su//ly and mechanical

    im/act

    1, The ne? PL; standard *( F1131 G'*; F1131H

    Previously valid PL; standards focussing mainly on PL;  /rogramming?ere generally geared to current state of the art technology in *uro/e atthe end of the seventies This too! into account non.net?or!ed PL;

    systems6 ?hich /rimarily eecute logic o/erations on binary signals

    Previously6 no eIuivalent6 standardised language elements eisted for the PL; develo/ments and system e/ansions made in the eighties6

    such as /rocessing of analogue signals6 interconnection of intelligentmodules6 net?or!ed PL; systems etc ;onseIuently6 PL; systems bydifferent manufacturers reIuired entirely different  /rogramming

    Since 199-6 an international standard no? eists for /rogrammable logic

    controllers and associated /eri/heral devices G/rogramming and diag.nostic tools6 testing eIui/ment6 man.to.machine interfaces etcH 'n this

    contet6 a device configured  by the user and consisting of the above

    com/onents is !no?n as a PL; system

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    17/214

    ;ha/ter 1

    The ne? *( F1131 G'*; F1131H standard consists of five /arts8

    E Part 18 eneral information

    E Part -8 *Iui/ment reIuirements and tests

    E Part 38 Programming languages

    E Part ,8 Kser guidelines Gin /re/aration ?ith '*;H

    E Part &8 Jessaging service s/ecification Gin /re/aration ?ith '*;H

    Parts 1 to 3 of this standard ?ere ado/ted unamended as *uro/eanStandard *( F1 1316 Parts 1 to 3

    The  /ur/ose of the ne? standard ?as to define and standardise the de.sign and functionality of a PL; and the languages reIuired for  /ro.gramming to the etent ?here users ?ere able to o/erate using differentPL; systems ?ithout any /articular difficulties

    The net cha/ters ?ill be dealing ?ith this standard in greater detailo?ever6 for the moment the follo?ing information should suffice8

    E The ne? standard ta!es into account as many as/ects as /ossibleregarding the design6 a//lication and use of PL; systems

    E The etensive s/ecifications serve to define o/en6 standardised PL;systems

    E Janufacturers must conform to the s/ecifications of this standard

     both ?ith regard to /urely technical reIuirements for the PL; as ?ellas the  /rogramming of controllers

    E Any variations must be fully documented for the user

    After initial reservations6 a large grou/ of interested /eo/le GPL;o/enHhas  been formed to su//ort this standard A large number of ma5or PL;su//liers are members of the association6 ie ABB6 * anuc6 Jitsubi.shi *lectric6 Joeller6 7J=7(6 Schneider *lectric6 Siemens

    A large number of the members of the association offer control and  /ro.gramming systems conforming to *( F1131 G'*; F1131H

    'n the future6 languages in accordance ?ith '*; F1131 ?ill not only

    dominate PL;  /rogramming6  but rather industrial automation in its en.tirety

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    18/214

    B.10;ha/ter 1

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    19/214

    B.11;ha/ter -

    undamentals

    -1 The decimal number system

    ;haracteristic of the decimal number system used in general is the lin.ear array of digits and their significant /lacing The number ,3,,6 for 

    instance6 can be re/resented as follo?s8

    ,3,, Q , 1000 R 3 100 R , 10 R , 1

     (umber , on the far left is of differing significance to that of number , onthe far right

    The  basis of the decimal number system is the availability of 10 differentdigits Gdecimal8 originating from the Latin NdecemN Q 10 H These 10 dif.

    ferent digits /ermit counting from 0 to 9 'f counting is to eceed the

    number 96 this constitutes a carry over to the net /lace digit The sig.nificance of this /lace is 106 and the net carry over ta!es /lace ?hen 99is reached

    The number D1D1:D11 is to be used as an eam/le8

    D F &10 10 10 , 3 -10 10 10

    1 010 10 *am/le

    D 1 D 1 : D 1 1

    As can be seen from the above6 the significance of the D on the far leftis D0000000 Q D0 million6 ?hereas the significance of the D in the third

     /lace from the right is D00

    The digit on the far right is referred to as the least significant digit6 andthe digit on the far left as the most significant digit

    Any number system can be configured on the  basis of this eam/le6 thefundamental structure can be a//lied to number systems of any number of digits ;onseIuently6 any com/uting o/erations and com/uting meth.ods ?hich use the decimal number system can be a//lied ?ith other 

    number systems

    -- The  binary number system

    e are indebted to Leibnit6 ?ho a//lied the structures of the decimalnumber system to t?o.digit calculation As long ago as 1FD96 this cre.ated the  /remises essential for the develo/ment of the com/uter6 since

    electrical voltage or electrical current only /ermits a calculation using

     5ust t?o values8 eg current on6 current off These t?o values arere/resented in the form of digits8 1 and 0

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    20/214

    :

    ;ha/ter -

    'f one ?ere to be limited to eactly - digits /er /lace of a number6 then anumber system ?ould be configured as follo?s8

    *am/leD F

    - Q 1-: -&

    Q F, -,

    Q 3- -3

    Q 1F --

    Q : -1

    Q , -0

    Q - - Q 1

    1 0 1 1 0 0 0 1

    The /rinci/le is eactly the same as that of the method used to create adecimal number o?ever6 only t?o digits are available6 ?hich is ?hy

    the significant /lace is not calculated to the  base 106 but to the  base -0

    ence the lo?est significant number on the far right is1 Q 16 and of thenet /lace - Q - etc Because of the eclusive use of t?o digits6 thisnumber system is !no?n as the binary or also the dual number system

    K/ to a maimum of 

    - – 1 Q -&F – 1 Q -&&

    can be calculated ?ith eight  /laces6 ?hich ?ould be thenumber 1111 1111-

    The individual  /laces of the binary number system can ado/t one of thet?o digits 0 or 1 This smallest /ossible unit of the binary system istermed 1 bit

    'n the above eam/le6 a number consisting of : bits6 ie one byte6 has been configured Gin a com/uter using : electrical signals re/resentingeither voltage available or voltage not available or current on or 

    current offH The number considered6 1011 0001-6 assumes the deci.mal value 1DD10

    *am/leD

    1 -F

    0 -&

    1 -,

    1 -3

    0 --

    0 -1

    0 -0

    1 -

    Q 1-: R 3- R 1F 1

    Q 1DD

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    21/214

    010 0000B;4

    110 0001B;4

    -10 0010B;4

    310 0011B;4

    ,10 0100B;4

    &10 0101B;4

    F10 0110B;4

    D10 0111B;4

    :10 1000B;4

    910 1001B;4

    ;ha/ter -

    -3 The B;4 code

    or  /eo/le used to dealing ?ith the decimal system6 binary numbers aredifficult to read or this reason6 a more easily readable numeral re/re.sentation ?as introducedM ie the binary coded decimal notation6 the so.called B;4 code Gbinary coded decimalH ith this B;4 code6 each indi.

    vidual digit of the decimal number system is re/resented  by a corre.s/onding binary number8

    Table B-18

    =e/resentation of decimalnumbers in B;4 code

    , digits in binary notation are therefore reIuired for the 10 digits in the

    decimal system The discarded  /lace Gin binary notation6 the numbers 0to 1& may be re/resented ?ith , digitsH is acce/ted for the sa!e of clar.ity

    The decimal number D133 is thus re/resented as follo?s in the B;4code8

    0111 0001 0011 0011B;4

    1F bits are therefore reIuired to re/resent a four digit decimal number in

    the B;4 code B;4 coded numbers are often used for seven segmentdis/lays and coding s?itches

    -, The headecimal number system

    The use of binary numbers is often difficult for the uninitiated and theuse of the B;4 code ta!es u/ a lot of s/ace This is ?hy the octal andthe headecimal system ?ere develo/ed Three digits are al?ays com.

     bined in the case of the octal number system This /ermits counting from0 to D6 ie counting in eights

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    22/214

    3 - 1 0

    'nteger  =ange of values

    unsigned 0 to F&&3&

    signed .3-DF: to R3-DFD

    ;ha/ter -

    Alternatively6 , bits are combined ?ith the headecimal number system, bits /ermit the re/resentation of the numbers 0 to 1&6 ie counting insiteens The digits 0 to 9 are used to re/resent these numbers in dig.

    its6 follo?ed by the letters A6 B6 ;6 46 * and ?here A Q 106 B Q 116 ; Q

    1-6 4 Q 136 * Q 1, and Q 1& The significant /lace of the individual

    digits is to the  base 1F

    *am/le3 -

    1F Q ,09F 1F1

    Q -&F 1F0

    Q 1F 1F Q 1

    : D B ;

    The number :DB;1F given as an eam/le therefore reads as follo?s8

    : 1F R D 1F R 11 1F R 1- 1F Q 3, D,:10

    -& Signed binary numbers

    K/ to no?6 ?e have dealt solely ?ith ?hole /ositive numbers6 not ta!inginto account negative numbers To enable ?or!ing ?ith these negative

    numbers6 it ?as decided that the most significant bit on the far left of a binary number is to be used to re/resent the  /receding sign8 0 thuscorres/onds to R and 1 corres/onds to –

    ence 1111 1111- Q .1-D10 and 0111 1111- Q R1-D10

    Since the most significant bit has  been used6 one bit less is available for 

    the re/resentation of a signed number 'n the field of data  /rocessing6the use of so.called com/liment re/resentation for the e/ression of negative numbers has /roven useful The follo?ing range of values is

    obtained for the re/resentation of a 1F digit binary number8

    *am/le

    -F =eal numbers

    Although it is no?  /ossible for ?hole /ositive and ?hole signed numbersto be re/resented ?ith 0 or 16 there is still the need for /oints or realnumbers

    'n order to re/resent a real number in com/uter  binary notation6 the

    number is s/lit into t?o grou/s6 a /o?er of ten and a multi/lication fac.tor This is also !no?n as the scientific re/resentation of digits

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    23/214

    ;ha/ter -

    The number -D633,1 is thus converted into -D3 3,1 10., T?o ?hole.signed numbers are therefore reIuired for a real number to be re/re.sented in a com/uter

    -D eneration of binary and digital signals

    As has already become clearly a//arent in the  /revious section6 allcom/uters and as such all PL;s o/erate using binary or digital signalsBy binary signal6 ?e understand a signal6 ?hich recognises only t?o

    defined values

    ig B-18

    1Binary signal

    0t

    These values are termed 0 or 16 the terms lo? and high are also

    used The signals can be very easily realised ?ith contacting com/o.nents An actuated normally o/en contact corres/onds to a logic 1.signal and an unactuated one to a logic 0.signal hen ?or!ing ?ith

    contactless com/onents6 this can give rise to certain tolerance bandsor this reason6 certain voltage ranges have  been defined as logic 0 or logic 1 ranges

    ig B--8+

    +oltage ranges

    30

    1 . range

    11

    &0 . range

    0

    .3t

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    24/214

    ;ha/ter -

    *( F1131.- G'*; F1131.-H defines a value range of .3 + to & + as logic

    0.signal6 and 11 + to 30 + as logic 1.signal Gfor contactless sensorsHThis is binding for PL;s6 ?hose device technology is to conform to *(F1131.- G'*; F1131.-H 'n current  /ractice6 ho?ever6 other voltage

    ranges can often be found for logic 0. and 1.signal idely used are8 .30

    + to R& + as logic 06 13 + to 30 + as logic 1

    Knli!e binary signals6 digital signals can assume any value These arealso referred to as value stages A digital signal is thus defined by anynumber of value stages The change bet?een these is non.seIuentialThe follo?ing illustration sho?s three  /ossible methods of converting an

    analogue signal into a digital signal

    ig B-38;onversion of an analogue

    signal into a digital signal+

    F 4igital Signal

    &4igital Signal

    on 1+ basis

    ,

    Analogues Signal on 06&+ basis

    3

    - 4igitalSignal on

    3+ basis

    1

    0t 

    4igital signals may be formed from analogue signals This method is for 

    instance used for analogue /rocessing via PL; Accordingly6 the ana.logue in/ut signal ?ithin a range of 0 to 10 + is reduced into a series of 

    ste/ values 4e/ending on the Iuality of the PL; and the  /ossible ste/height set6 the digital signal ?ould thus be able to o/erate in ste/s of value of 01 +6 001 + or 0001 + (aturally6 the smallest range is se.lected in this instance in order for the analogue signal to be re/roducedas accurately as /ossible

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    25/214

    Bit (o D F & , 3 - 1 0 4igital value

    *am/le 1 1 0 1 1 1 0 1 1 1:D

    *am/le - 0 0 1 1 0 0 1 1 &1

    *am/le 3 0 0 0 0 0 0 0 0 0

    ;ha/ter -

    7ne sim/le eam/le of an analogue signal is  /ressure6 ?hich is meas.ured and dis/layed  by a  /ressure gauge The  /ressure signal may as.sume any intermediate value  bet?een its minimum and maimumvalues Knli!e the digital signal6 it changes continually 'n the case of the /rocessing of analogue values via a PL;6 as described6 analogue volt.age signals are evaluated and converted

    7n the other hand6 digital signals can be formed by adding together acertain number of binary signals 'n this ?ay6 again as described in theabove /aragra/h6 it is also  /ossible to generate a digital signal ?ith -&Fste/ values

    *am/le

    This  /rocess is for instance used to im/lement timer and counter func.

    tions

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    26/214

    ;ha/ter -

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    27/214

    ' 7

    0 1

    1 0

    ;ha/ter 3

    Boolean o/erations

    31 Basic logic functions

    As described in the  /revious cha/ter6 any com/uter and eIually anyPL; o/erates using the number system to the  base - This also a//lies

    3 ,to the octal G- H and the headecimal systems G- H The individual vari.able can therefore assume only t?o values6 0 or 1 S/ecial algo.rithms have  been introduced to be able to lin! these variables – the so.called  boolean algebra This can be clearly re/resented  by means of electrical contacts

     (egation G(7T functionH

    The /ush button sho?n re/resents a normally closed contact hen thisis unactuated6 lam/ 1 is illuminated6 ?hereas in the actuated state6

    lam/ 1 goes off

    -,+

    ig B318;ircuit diagram

    S1

    G'H

    1

    G7H

    0+

    Push button S1 acts as signal in/ut6 the lam/ forms the out/ut The ac.tual status can be recorded in a truth table8

    ig B3-8

    Truth table

    The  boolean eIuation is therefore as follo?s8

     I Q 7 Gread8 (ot ' eIuals 7H

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    28/214

    1 ' 1

    ;ha/ter 3

    The logic symbol is8

    ig B338

     (7T function

    ' 1 7

    'f - negations are s?itched in succession6 then these cancel one an.other

    ig B3,8- logic

     (7T functions ' Q '

    ' '

    ;on5unction GA(4.functionH

    'f t?o normally o/en contacts are s?itched in series6 the actuated lam/is illuminated only if both /ush  buttons are actuated

    ig B3&8;ircuit diagram

    -,+

    S1

    G'1H

    S-

    G'-H

    0+

    1

    G7H

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    29/214

    '1 '- 7

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    ;ha/ter 3

    ig B3FTruth table

    The truth table assigns the con5unction The out/ut assumes 1 only if  both in/ut 1 and in/ut -  /roduce a 1.signal This is referred to as an

    A(4 o/eration6 ?hich is re/resented as follo?s as an eIuation8'1∧  '- =7

    '1"

    7

    '-

    ig B3DA(4 function

    'n addition6 the follo?ing algorithms a//ly for the con5unction8

    a ∧ 0 = 0

    a ∧ 1 = a

    a ∧ a = 0

    a ∧ a = a

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    30/214

    '1 '- 7

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    ;ha/ter 3

    4is5unction G7=.unctionH

    Another basic logic function is 7= 'f the - normally o/en contacts are

    s?itched in /arallel6 then the lam/ is illuminated ?henever a least one /ush button is /ressed

    ig B3:8

    ;ircuit diagram-,+

    S1

    G'1HS-

    G'-H

    1

    G7H

    0+

    ig B39Truth table

    ig B3108

    7= function'1

    Q1

    7

    '-

    The logic o/eration is ?ritten in the form of the follo?ing eIuation8

    '1  ∨  '- =

    7

    The follo?ing algorithms also a//ly for the 7=.o/eration8

     b ∨ 0 = b

     b ∨ 

    1 = 1

     b ∨ b = b

     b ∨ b = 1

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    31/214

          >

    ;ha/ter 3

    3- urther logico/erations

    The electrical realisation of a  (7T.2A(4.27=.o/eration has already been described in section B31 *ach of these o/erations can of coursealso be realised /neumatically or electronically Boolean algebra also

    recognises the follo?ing logic o/erations The follo?ing table  /rovidesan overvie? of these

    Table B318Logic connections

     (ame *Iuation Truth table

    '

    01

    log sym bols /neumatic r ealisation

    7

    ele!tr r ealisation

    '

    7

    ele!tron realisation

    '7

     (egation

    '

    1 7

    7'

    7

    7'

    ;on5uction '1 '- Q 7

    ' 1 ' - 7

    011

    ' 1' -

    7

    7

    4is 5unction '1 '- Q 7 001

    '-Q1

    '1 '-

    7

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    32/214

    ;ha/ter 3

    Table B318

    Logic connections

    GcontinuationH

     (ame *Iuation Truth table log symbols /neumatic realisation ele!tr realisation ele!tron realisation

    Antivalence

    Geclusive

    7= H

    *Iuivalence

    '1 '-  7

    '1 '- 7'1

    Q

    ' - 

    '- 7

    ' 1 '1

    '- 7

    7

     (A(4 '1'-

    O

    ' 1

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    33/214

    ;ha/ter 3

    33 *stablishing s?itching functions

    4eriving boolean eIuations from the truth table

    7ften6 the logic o/erations sho?n in the  /revious section are not enoughto adeIuately describe a status in control technology

    +ery often6 there is a combination of different logic o/erations The logicconnection in the form of a  boolean eIuation can be easily establishedfrom the truth table

    The eam/le belo? should clarify this8

    Sorting station tas! 

    +arious /arts for built.in !itchens are to be machined in a  /roductionsystem Gmilling and drilling machineH The ?all and door sections for 

    certain ty/es of !itchen are to be /rovided ?ith different drill holes Sen.

    sors B1 to B, are intended for the detection of the holes

    ig B3118Sorting station

    1A1B,

    B3

    B1B-

    Parts ?ith the follo?ing hole  /atterns are for the NStandardN !itchen ty/e

    These /arts are to be advanced via the double.acting cylinder 10

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    34/214

    d b d

    a

    d

    a c

    d

    a

     b d

    a

     b

    c

    d

    a  b c d y

    0 0 0 0 0

    0 0 0 1 1

    0 0 1 0 0

    0 0 1 1 0

    0 1 0 0 0

    0 1 0 1 1

    0 1 1 0 0

    0 1 1 1 0

    1 0 0 0 0

    1 0 0 1 1

    1 0 1 0 0

    1 0 1 1 1

    1 1 0 0 01 1 0 1 1

    1 1 1 0 0

    1 1 1 1 1

    ;ha/ter 3

    ig B31-8

    ole /attern /arts

    Assuming that a drilled hole is read as a 1.signal6 the follo?ing truth ta. ble results

    ig B313Truth table

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    35/214

    ;ha/ter 3

    T?o o/tions are available in order to derive the logic eIuation from thistable6 ?hich lead to t?o different e/ressions The same result is ob.tained6 of course6 since the same circumstances are described

    Standard form6 dis5unctive

    'n the dis5unctive standard form6 all con5unctions GA(4.o/erationsH of 

    in/ut variables ?ith the result 16 are carried out as a dis5unctive o/era.tion G7=.o/erationH ith signal status 06 the in/ut variable is carried out

    as a negated o/eration and ?ith signal status 1 as a non.negated o/era.

    tion

    'n the case of the eam/le given6 the logic o/eration is therefore as fol.lo?s8

    y Q Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧

    dH∨

    Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧ dH

    ;on5unctive standard form

    'n the con5unctive standard form6 all dis5unctions G7=.o/erationsH of thein/ut variable  /roducing the result 06 are carried out as a con5unctiveo/eration GA(4.o/erationH 'n contrast ?ith the dis5unctive standardform6 in this instance6 the in/ut variable is negated ?ith signal status 1and a non.negated o/eration carried out ?ith signal status 0

    y Q Ga ∨ b ∨ c ∨ dH ∧ Ga ∨ b ∨ c ∨ dH∧ Ga ∨ b ∨ c ∨ dH∧

    Ga ∨ b ∨ c ∨ dH∧ Ga ∨ b ∨ c ∨ dH∧ Ga ∨ b ∨ c ∨ dH∧

    Ga ∨ b ∨ c ∨ dH∧ Ga ∨ b ∨ c ∨ dH∧

    Ga ∨ b ∨ c ∨ dH∧ Ga ∨ b ∨ c ∨ dH

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    36/214

    ;ha/ter 3

    3, Sim/lification of logic functions

    Both eIuations for the eam/le given are rather etensive6 ?ith that of the con5unctive standard form being even longer still This defines thecriteria for using the dis5unctive or con5unctive standard from8 The deci.sion is made in favour of the shorter form of the eIuation 'n this case6the dis5unctive standard form

    y Q Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧

    dH∨

    Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧ dH∨ Ga ∧  b ∧ c ∧ dH

    This e/ression may be sim/lified ?ith the hel/ of a  boolean algorithm

    The most im/ortant rules in boolean algebra are sho?n  belo?8

    a ∨ 0 = a a ∧ 0 = 0

    a ∨ 1 = 1 a ∧ 

    1 = a

    a ∨ a = a a ∧ a = a

    a ∨ a = 1 a ∧ a = 0

    ;ommutative la?

    a ∨  b = b ∨ a a ∧  b = b ∧ a

    Associative la?

    a ∨  b ∨ c = a ∨ G b ∨ c H = Ga ∨  bH ∨

    c a ∧  b ∧ c = a ∧ G b ∧ c H = Ga ∧ 

     bH ∧ c

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    37/214

    ;ha/ter 3

    4istributive la?

    a ∧ G b ∨ c H = Ga ∧  bH ∨ Ga ∧ 

    c Ha ∨ G b ∧ c H = Ga ∨  bH ∧ Ga ∨ c H

    4e JorganNs rule

    a ∨  b = a ∧  b a ∧  b = a ∨  b

    =eduction rule

    a ∨ a ∧  b = a ∨  b

    A//lied to the above eam/le6 the follo?ing result is obtained8

    y Q abcd ∨ abcd ∨ abcd ∨ abcd ∨ abcd ∨ abcd

    Q abcd ∨ abcd ∨ abcd ∨ abcd ∨ abdGc ∨ c H

    Q acdG b ∨ bH∨ a bdGc ∨ c H ∨ abd

    Q acd ∨ abd ∨ abd

    Q acd ∨ adG b ∨  bH

    Q Gac ∨ aHd

    Q Gc ∨ aHd

    Q cd ∨ ad

    or reasons of clarity6 the A(4.o/eration symbol O∧has been omitted inthe individual e/ressions

    The basic /rinci/le of sim/lification is in the factoring out of variablesand reducing to defined e/ressions o?ever6 this method does reIuirea sound !no?ledge of boolean algorithms /lus a certain amount of /rac.tice Another o/tion for sim/lification ?ill be introduced in the follo?ing

    section

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    38/214

    a  b c d y  (o

    0 0 0 0 0 1

    0 0 0 1 1 -

    0 0 1 0 0 3

    0 0 1 1 0 ,

    0 1 0 0 0 &

    0 1 0 1 1 F

    0 1 1 0 0 D

    0 1 1 1 0 :

    1 0 0 0 0 9

    1 0 0 1 1 10

    1 0 1 0 0 11

    1 0 1 1 1 1-

    1 1 0 0 0 13

    1 1 0 1 1 1,

    1 1 1 0 0 1&

    1 1 1 1 1 1F

    cd cd cd cd

    ab 1 - 3 ,

    a b & F D :

    a b 9 10 11 1-

    ab 13 1, 1& 1F

    ;ha/ter 3

    3&

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    39/214

    cd cd cd cd

    ab 0 1 0 0

    a b 0 1 0 0

    a b 0 1 0 1

    ab 0 1 0 1

    ;ha/ter 3

    The results of the value table are transferred to the

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    40/214

    ;ha/ter 3

    The variable values are selected for the established  bloc! and these inturn combined dis5unctively

    y1 Q cd

    y- Q acd

     y Q cd ∨ acd

    Q Gc ∨ ac H∧ d

    Q Gc ∨ aH∧ d

    Q cd ∨ ad

     (aturally6 the

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    41/214

    ;ha/ter ,

    4esign and mode of o/eration of a PL;

    ,1 Structure of a PL;

    ith com/uter systems6 differentiation is generally made bet?een hard.?are6 firm?are and soft?are The same a//lies for a PL;6 ?hich is es.sentially  based on a microcom/uter

    The hard?are consists of the actual device technology6 ie the  /rinted

    circuit boards6 integrated modules6 ?ires6  battery6 housing6 etc

    irm?are is the soft?are  /art6 ?hich is  /ermanently installed and su/.

     /lied by the PL; manufacturer This includes fundamental system rou.tines6 used for starting the  /rocessor after the /o?er has  been s?itchedon Additionally6 there is the o/erating system in the case of  /rogram.mable logic controllers6 ?hich is generally stored in a =7J6 a read.onlymemory6 or in the *P=7J

    inally6 there is the soft?are6 ?hich is the user  /rogram ?ritten by the

    PL; user Kser  /rograms are usually installed in the =AJ6 a randomaccess memory6 ?here they can be easily modified

    4ata  busig B,18

    undamental designof a microcom/uter 

    Jicro.

     /ro.

    cessor 

    G;PKH

    =7J

    7/erating.

    system

    =AJ

    Pr ogram

    and data

    'n /ut.

    module

    7ut/ut.

    module

    Address bus

    ;ontr ol  bus

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    42/214

    ;ha/ter ,

    ig B,1 illustrates the fundamental design of a microcom/uter PL;hard?are  – as in the case of almost all of todayNs microcom/uter sys.tems – is based on a bus system A bus system is a number of electricallines divided into address6 data and control lines The address line is

    used to select the address of a connected  bus station and the data line

    to transmit the reIuired information The control lines are necessary toactivate the correct bus station either as a transmitter or sender

    The ma5or bus stations connected to the bus system are the micro/roc.essor and the memory The memory can be divided into memory for thefirm?are and memory for the user  /rogram and data

    4e/ending on the structure of the PL;6 the in/ut and out/ut modulesare connected to a single common  bus or – ?ith the hel/ of a bus inter.

    face – to an eternal '27 bus Particularly in the case of larger modular PL; systems6 an eternal '27 bus ?ould be more usual

    inally6 a connection is reIuired for a  /rogramming device or a P;6no?adays mostly in the form of a serial interface

    ig B,- illustrates the esto P; 101 as an eam/le

    ig B,-8

    Programmable logic control.

    ler esto P; 101

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    43/214

    ;ha/ter ,

    ,- ;entral control unit of a PL;

    'n essence6 the central control unit of a PL; consists of a microcom. /uter The o/erating system of the PL; manufacturer ma!es the univer.sal com/uter into a PL;6 o/timised s/ecifically for control technology

    tas!s

    4esign of the central control unit

    ig B,3 illustrates a sim/lified version of a micro/rocessor6 ?hich

    re/resents the heart of a microcom/uter

    4ata  bus

    ig B,384esign of amicro/rocessor 

    ALK

    Accumulator 

    ;ontrol  bus;ommand register 

    Program counter 

    ;ontrol  bus

    Arithmetic unit ;ontrol unit

    Address  bus

    A micro/rocessor consists in the main of an arithmetic unit6 control unitand a small number of internal memory units6 so.called registers

    The tas! of the arithmetic unit – the ALK Garithmetic logic unitH – is to

    eecute arithmetic and logic o/erations ?ith the data transmitted

    The accumulator6 A; for short6 is a s/ecial register assigned directly tothe ALK This stores  both data to be  /rocessed as ?ell as the result of an o/eration

    The instruction register stores a command called from the  /rogrammemory until this is decoded and eecuted

    A command consists of an o/eration  /art and an address /art The o/.

    eration /art indicates ?hich logic o/eration is to be carried out The ad.dress  /art defines the o/erands Gin/ut signals6 flags etcH6 ?ith ?hich alogic o/eration is to be eecuted

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    44/214

    ;ha/ter ,

    The  /rogram counter is a register6 ?hich contains the address of thenet command to be  /rocessed The follo?ing section ?ill be dealing?ith this in greater detail

    The control unit regulates and controls the entire logic seIuence of theo/erations reIuired for the eecution of a command

    'nstruction cycle ?ithin central control unit

    TodayNs conventional microcom/uter systems o/erate according to the

    so.called von.(eumann /rinci/le According to this /rinci/le6 the com. /uter  /rocesses the  /rogram line by line 'n sim/le terms6 you could saythat each /rogram line of the PL; user  /rogram is  /rocessed in se.Iuence

    This a//lies ?holly irres/ective of the  /rogramming language6 in ?hichthe PL;  /rogram is ?ritten6 be it in the form of a tet  /rogram GstatementlistH or a gra/hic  /rogram Gladder diagram6 seIuential function chartHSince these various forms of re/resentation al?ays result in a series of 

     /rogram lines ?ithin the com/uter6 they are subseIuently /rocessed one

    after the other

    'n  /rinci/le6 a  /rogram line6 ie generally a command6 is  /rocessed in

    t?o ste/s8E fetching the command from the  /rogram memory

    E eecuting the command

    ig B,,8;ommand seIuence

    Jicro/rocessor 

    4ata  bus

    Jemory

    ;ommand ;ommand

    register 

    ;ontr ol signals

    Pr ogram.

    counter 

    R1

    ;ommand

    Address bus

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    45/214

    ;ha/ter ,

    The contents of the  /rogram counter are transferred to the address busThe control unit then causes the command at a s/ecified address in the

     /rogram memory6 to be relayed to the data bus rom there6 the com.mand is read to the instruction register 7nce the command has  beendecoded6 the control unit generates a seIuence of control signals for eecution

    4uring the eecution of a  /rogram6 the commands are fetched in se.Iuence A mechanism6 ?hich /ermits this seIuence6 is therefore re.Iuired This tas! is  /erformed  by a sim/le incrementer6 ie a ste/

    enabling facility in the  /rogram counter

    ,3 unction mode of a PL;

    Programs for conventional data  /rocessing are  /rocessed once onlyfrom to/ to bottom and then terminated 'n contrast ?ith this6 the  /ro.gram of a PL; is continually  /rocessed cyclically

    'mage table'n /uts

    PL;  /rogr am

    'n/uts

    ig B,&8;yclical /rocessing of a PL;  /rogram

    'mage table7ut/uts

    7ut/uts

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    46/214

    ;ha/ter ,

    The characteristics of cyclical  /rocessing are8

    E As soon as the  /rogram has  been eecuted once6 it automatically 5um/s bac! to the  beginning and  /rocessing is re/eated

    E Prior to first /rogram line being  /rocessed6 ie at the  beginning of the

    cycle6 the status of the in/uts is stored in the image table The  /roc.ess image is a se/arate memory area accessed during a cycle Thestatus of an in/ut thus remains constant during a cycle even if it has

     /hysically changed

    E Similar to in/uts6 out/uts are not immediately set or reset during a

    cycle6 but the status stored intermediately in the  /rocess out/ut im.age 7nly at the end of a cycle are all the out/uts  /hysically s?itchedaccording to the logic status stored in the memory

    The  /rocessing of a  /rogram line via the central control unit of a PL;ta!es time ?hich6 de/ending on PL; and o/eration can vary  bet?een afe? microseconds and a fe? milliseconds

    The time reIuired by the PL; for a single eecution of a  /rogram includ.

    ing the actualisation and out/ut of the  /rocess image6 is termed the cy.cle time The longer the  /rogram is and the longer the res/ective PL;

    reIuires to  /rocess an individual  /rogram line6 the longer the cycle =e.alistic time  /eriods for this are  bet?een a//roimately 1 and 100 milli.

    seconds

    The conseIuences of cyclical  /rocessing of a PL;  /rogram using a /rocess image are as follo?s8

    E 'n/ut signals shorter than the cycle time may /ossibly not be recog.nised

    E 'n some cases6 there may be a delay of t?o cycle times  bet?een the

    occurrence of an in/ut signal and the desired reaction of an out/ut tothis signal

    E Since the commands are  /rocessed seIuentially6 the s/ecific  behav.iour seIuence of a PL;  /rogram may be crucial

    ith some a//lications it is essential for in/uts or out/uts to be ac.cessed directly during a cycle This ty/e of  /rogram /rocessing6 by/ass.ing of the  /rocess image6 is therefore also su//orted  by some PL;systems

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    47/214

    ;ha/ter ,

    ,, A//lication /rogram memory

    Programs s/ecifically develo/ed for /articular a//lications reIuire a /rogram memory6 from ?hich these can be read cyclically by the centralcontrol unit The reIuirements for such a  /rogram memory are relativelysim/le to formulate8

    E 't should be as sim/le as /ossible to modify or to ne?ly create andstore the  /rogram ?ith the hel/ of a  /rogramming device or a P;

    E Safeguards should be in /lace to ensure that the  /rogram cannot  be

    lost – either during /o?er failure or through interference voltage

    E The  /rogram memory should be cost effective

    E The  /rogram memory should be sufficiently fast in order not to delay

    the o/eration of the central control unit

     (o?adays6 three different ty/es of memory are used in /ractice8

    E =AJ

    E *P=7J

    E **P=7J

    =AJ

    The =AJ Grandom access memoryH is a fast and highly cost effective

    memory Since the main memory of com/uters Gie PL;sH consist of =AJs6 they are  /roduced in such high Iuantities that they are readilyavailable at lo? cost ?ithout com/etition

    =AJs are read2?rite memories and can be easily  /rogrammed and

    modified

    The disadvantage of a =AJ is that it is volatile6 ie the  /rogram stored inthe =AJ is lost in the event of /o?er failure This is ?hy =AJs are

     bac!ed u/ by battery or accumulator Since the service life and ca/acity

    of modern batteries are rated for several years6 =AJ bac!.u/ is rela.tively sim/le 4es/ite the fact that these are high  /erformance batteriesit is nevertheless essential to re/lace the  batteries in good time

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    48/214

    ;ha/ter ,

    *P=7J

    The *P=7J Gerasable /rogrammable read.only memoryH is also a fastand lo? cost memory6 ?hich6 in com/arison ?ith =AJ6 has the addedadvantage of being non.volatile6 ie remanent The memory contentstherefore remain intact even in the event of /o?er failure

    ig B,F8*am/le of an *P=7J

    or the  /ur/ose of a  /rogram modification6 ho?ever6 the entire memory

    must first be erased and6 after a cooling /eriod6 com/letely re/ro.grammed *rasing generally reIuires an erasing device6 and a s/ecial

     /rogramming unit is used for /rogramming

    4es/ite this relatively com/le  /rocess of erasing6  – cooling – re/ro.gramming *P=7Js are very freIuently used in PL;s6 since these re/.

    resent reliable and cost effective memories 'n  /ractice6 a =AJ is oftenused during the  /rogramming and commissioning /hase of a machine7n com/letion of the commissioning6 the  /rogram is then transferred to

    an *P=7J

    **P=7J

    The **P=7J Gelectrically erasable /rogrammable =7JH6 **=7JGelectrically erasable =7JH and *A=7J Gelectrically alterable =7JH or also flash.*P=7J have  been available for some time The **P=7J in

     /articular6 is used ?idely as an a//lication memory in PL;s The**P=7J is an electrically erasable memory6 ?hich can be subse.

    Iuently ?ritten to

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    49/214

    *rrorvoltagedetection

    Signaldelay

    7 /tocou/ler 

    ;ha/ter ,

    ,& 'n/ut module

    The in/ut module of a PL; is the module6 ?hich sensors are connectedto The sensor signals are to be  /assed on to the central control unitThe im/ortant functions of an in/ut module Gfor the a//licationH are asfollo?s8

    E =eliable signal detection

    E +oltage ad5ustment of control voltage to logic voltage

    E Protection of sensitive electronics from eternal voltages

    E Screening of signals

    'n /ut.signal

    Signal tothecontr ol unit

    ig B,D8Bloc! diagram of an

    in/ut module

    The main com/onent of todayNs in/ut modules ?hich meets these re.Iuirements is the o/tocou/ler

    The o/tocou/ler transmits the sensor information ?ith the hel/ of light6

    thereby creating an electrical isolation  bet?een the control and logiccircuits6 thereby /rotecting the sensitive electronics from s/urious e.

    ternal voltages (o?adays6 advanced o/tocou/lers guarantee /rotectionfor u/ to a//roimately &

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    50/214

    ;ha/ter ,

    The screening of the signal emitted by the sensor is critical in industrialautomation 'n industry6 electrical lines are generally loaded heavily due

    to inductive interference voltages6 ?hich leads to a multitude of interfer.

    ence im/ulses on every signal line Signal lines can be screened either via shielding6 discrete cable ducts etc6 or alternatively the in/ut module

    of the PL; assumes the screening via an in/ut signal delay

    This therefore reIuires the in/ut signal to be a//lied for a sufficientlylong /eriod6 before it is even recognised as an in/ut signal Since6 due

    to their inductive nature6 interference im/ulses are /rimarily transientsignals6 a relatively short in/ut signal delay of a fe? milliseconds is suffi.

    cient to filter out most of the interference im/ulses'n/ut signal delay is effected mainly via the hard?are6 ie via connectionof the in/ut to an =; module 'n isolated cases6 ho?ever6 it is also  /os.sible to /roduce an ad5ustable signal delay via the soft?are

    The duration of an in/ut signal delay is a//roimately 1 to -0 millisec.

    onds – de/ending on manufacturer and ty/e Jost manufacturers offer es/ecially fast in/uts for tas!s6 ?here the in/ut signal delay is then too

    long to recognise the reIuired signal

    4ifferentiation is made bet?een /ositive and negative s?itching connec.tions ?hen connecting sensors to PL; in/uts 'n other ?ords6 differentia.tion is made bet?een in/uts re/resenting a current sin! or a currentsource 'n ermany for instance  /ositive s?itching connections are

    mainly used6 since this /ermits the use of  /rotective grounding Positives?itching means that the PL; in/ut re/resents a current sin! The sen.

    sor su//lies the o/erating voltage or control voltage to the in/ut in theform of a 1.signal

    'f  /rotective grounding is em/loyed6 the out/ut voltage of the sensor isshort.circuited to?ards 0 volts or the fuse s?itched off in the event of ashort.circuit in the signal line This means that a logic 0 is a//lied at the

    in/ut of the PL;

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    51/214

    7 /tocou /ler 

    Am/lifier Short.cir cuitmonitoring

    ;ha/ter ,

    'n a number of countries6 the use of negative s?itching sensors is com.mon/lace6 ie the PL; in/uts o/erate as a /o?er source 'n thesecases6 a different  /rotective measure must be used to  /revent a 1.signalfrom being a//lied to the in/ut of the PL; in the event of a shortcircuit

    on the signal line Possible methods are the earthing of the /ositive con.trol voltage or insulation monitoring6 ie  /rotective grounding as a  /ro.

    tective measure

    ,F 7ut/ut module

    7ut/ut modules conduct the signals of the central control unit to finalcontrol elements6 ?hich are actuated according to the tas! 'n the main6the function of an out/ut – as seen from the a//lication of the PL;  – therefore includes the follo?ing8

    E +oltage ad5ustment of logic voltage to control voltage

    E Protection of sensitive electronics from s/urious voltages from thecontroller 

    E Po?er am/lification sufficient for the actuation of ma5or final controlelements

    E Short.circuit and overload /rotection of out/ut modules

    'n the case of out/ut modules6 t?o fundamentally different methods areavailable to achieve the above8 *ither the use of a relay or /o?er elec.tronics

    Signal fromthecontrol unit

    7ut/ut

    signal

    ig B,:8Bloc! diagram of an

    out/ut module

    The o/tocou/ler once again forms the  basis for /o?er electronics and

    ensures the  /rotection of the electronics and /ossibly also the voltage

    ad5ustment

    A /rotective circuit consisting of diodes must /rotect the integral  /o?er transistor from voltage surges

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    52/214

    ;ha/ter ,

     (o?adays short.circuit /rotection6 overload /rotection and  /o?er 

    am/lification are often ensured ?ith fully integral modules Standard

    short.circuit  /rotection measures the current flo? via a /o?er resistor soas to s?itch off in the event of short.circuitM a tem/erature sensors /ro.vides overload /rotectionM a 4arlington stage or alternative  /o?er tran.sistor stages /rovide the necessary /o?er

    The  /ermissible /o?er of an out/ut module is usually s/ecified in a ?ay6

    ?hich /ermits differentiation to be made bet?een the  /ermissible /o?er 

    of an out/ut and the  /ermissible cumulative /o?er of an out/ut module

    The cumulative /o?er of a module is almost al?ays considerably lo?er 

    than the total of individual  /ermissible ratings6 since /o?er transistorstransmit heat to one another

    'f relays are used for the out/uts6 then the relay can assume /racticallyall the functions of an out/ut module8 The relay contact and relay coil areelectrically isolated from one anotherM the relay re/resents an ecellent

     /o?er am/lifier and is /articularly overload./roof6 only short.circuit  /ro.

    tection must be ensured via an additional fuse 'n  /ractice6 ho?ever6

    o/tocou/lers are nevertheless connected in series ?ith relays6 since thisrenders the actuation of relays easier and sim/ler relays can be used

    =elay out/uts have the advantage that they can be used for differentout/ut voltages By contrast6 electronic out/uts have considerably higher 

    s?itching s/eeds and a longer service life than relays 'n most cases6the /o?er of the very small relays used in PL;s corres/onds to that of 

    the /o?er stages of electronic out/uts

    'n ermany for eam/le6 out/uts are also connected /ositive s?itching6ie the out/ut re/resents a /o?er source and su//lies the o/eratingvoltage to the consuming device

    'n the case of a short circuit of the out/ut signal line to earth6 the out/utis short.circuited6 if normal  /rotective grounding measures are used Theelectronics s?itch to short circuit  /rotection or the fuse s?itches off6 iethe consuming device cannot dra? any current and is therefore uncon.nected and rendered safe G'n accordance ?ith *( F0-0,6 the deener.

    gised status must al?ays be the safe statusH

    'f negative s?itching out/uts are used6 ie the out/ut re/resents a cur.rent sin!6 the  /rotective measure must be ada/ted in such a ?ay6 thatthe consuming device is rendered safe in the event of a short circuit onthe signal line Again6  /rotective grounding ?ith isolation monitoring or 

    the neutralising of the /ositive control voltage are standard /ractice inthis case

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    53/214

    ;ha/ter ,

    ,D Programming device2Personal com/uter 

    *ach PL; has a  /rogramming and diagnostic tool in su//ort of the PL;a//lication

    E Programming

    E Testing

    E ;ommissioning

    E ault finding

    E Program documentation

    E Program storage

    These /rogramming and diagnostic tools are either vendor s/ecific  /ro.gramming devices or  /ersonal com/uters ?ith corres/onding soft?are

     (o?adays6 the latter is almost eclusively the  /referred variant6 since

    the enormous ca/acity of modern P;s6 combined ?ith their com/ara.tively lo? initial cost and high fleibility6 re/resent crucial advantages

    Also available and being develo/ed are so.called hand.held /rogram.mers for mini control systems and for maintenance /ur/oses ith the

    increasing use of la/to/  /ersonal com/uters6 ie  /ortable6  battery o/er.ated P;s6 the im/ortance of hand.held /rogrammers is steadily decreas.ing

    *ssential soft?are system functions forming /art of the  /rogram.

    ming and diagnostic tool

    Any  /rogramming soft?are conforming to *( F1131.1 G'*; F1131.1H

    should /rovide the user ?ith a series of functions ence the  /rogram.ming soft?are com/rises soft?are modules for8

    E Program in/ut

    ;reating and modifying  /rograms in one of the  /rogramming lan.guages via a PL;

    E Synta test

    ;hec!ing the in/ut  /rogram and the in/ut data for synta accuracy6thus minimiing the in/ut of faulty  /rograms

    E Translator 

    Translating the in/ut  /rogram into a  /rogram6 ?hich can be read and

     /rocessed by the P;6 ie the generation of the machine code of thecorres/onding P;

    E ;onnection bet?een PL; and P;

    This data circuit effects the loading of a  /rogram to the PL; and theeecution of test functions

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    54/214

    ;ha/ter ,

    E Test functions

    Su//orting the user during ?riting and fault elimination and chec!ing

    the user  /rogram via

     – a status chec! of in/uts and out/uts6 timers6 counters etc

     – testing of /rogram seIuences  by means of single.ste/ o/erations6ST7P commands etc

     – simulation by means of manual setting of in/uts2out/uts6 settingconstants etc

    E Status dis/lay of control systems

    7ut/ut of information regarding machine6 /rocess and status of thePL; system

     – Status dis/lay of in/ut and out/ut signals

     – 4is/lay2recording of status changes in eternal signals and inter.nal data

     – Jonitoring of eecution times

     – =eal.time format of /rogram eecution

    E 4ocumentation4ra?ing u/ a descri/tion of the PL; system and the user  /rogram

    This consists of  – 4escri/tion of the hard?are configuration

     – Printout of the user  /rogram ?ith corres/onding data and identifi.

    ers for signals and comments

     – ;ross.reference list for all /rocessed data such as in/uts6 out/uts6timers etc

     – 4escri/tion of modifications

    E Archiving of user  /rogram

    Protection of the user  /rogram in nonvolatile memories such as*P=7J etc

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    55/214

    ;ha/ter &

    Programming of a PL;

    &1 Systematic solution finding

    ;ontrol  /rograms re/resent an im/ortant com/onent of an automationsystem

    ;ontrol  /rograms must be systematically designed6 ?ell structured andfully documented in order to be as

    E error.free

    E lo?.maintenanceE cost effective

    as /ossible

    Phase model of PL; soft?are generation

    The  /rocedure for the develo/ment of a soft?are /rogram illustrated infig B&1 has  been tried and tested The division into defined sections

    leads to targeted6 systematic o/eration and  /rovides clearly set out re.sults6 ?hich can be chec!ed against the tas!

    The  /hase model consisting of the follo?ing sections

    E S/ecification8 4escri/tion of the tas! 

    E 4esign8 4escri/tion of the solution

    E =ealisation8 'm/lementation of the solution

    E 'ntegration2commissioning8 'ncor/orating into environment and testing

    the solution

    can be a//lied to basically all technical /ro5ects 4ifferences occur in the

    methods and tools used in the individual  /hases

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    56/214

    ;ha/ter &

    ig B&18Phase model for the

    generation of PL; soft?are1 S /ecif ication  – +erbal descri/tion of control tas! 

     – Technology6  /ositional s! etch

     – Jacrostructure of control  /r ogram

    - 4esign  – unction chart to '*; F0:,:

     – Logic chart ?ith symbols of the

    *( F0F1D.1- G'*; F0F1DH

     – unction table

     – 4efinition of soft?are modules – Part list and circuit diagram

    3 =ealisation  – Programming in L46 B46 'L6

    ST and S;

     – Simulation of sub/rograms and

    overall  /rogr am

    , ;ommissioning  – 4esign of system

     – Testing of sub/rograms

     – Testing of overall  /rogram

    The  /hase model can be a//lied to control  /rograms of varying com. /leityM for com/le control tas!s the use of such a model is absolutely

    essential

    The individual  /hases of the model are described belo?

    Phase 18 S/ecification GProblem formulationH

    'n this  /hase6 a  /recise and detailed descri/tion of the control tas! isformulated The s/ecific descri/tion of the control system function6 for.malised as much as /ossible6 reveals any conflicting reIuirements6

    mis. leading or incom/lete s/ecifications

    The follo?ing are available at the end of this  /hase8

    E +erbal descri/tion of the control tas! 

    E Structure2layout

    E Jacrostructuring of the system or /rocess and thus rough structuring

    of the solution

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    57/214

    ;ha/ter &

    Phase -8 4esign G;oncrete form of solution conce/tH

    A solution conce/t is develo/ed on the  basis of the definitions estab.lished in  /hase 1 The method used to describe the solution must  /ro.vide both a gra/hic and  /rocess oriented descri/tion of the function and

     behaviour of the control system and be inde/endent of the technicalrealisation

    These reIuirements are fulfilled by the function chart G;H as definedin '*; F0:,: Starting ?ith a re/resentation of the overall vie? of thecontroller Grough structure of the solutionH6 the solution can be refinedste/ by ste/ until a level of descri/tion is

    obtained6?hich

    containsall the

    details of the solution Grefinement of rough structureH

    'n the case of com/le control tas!s6 the solution is structured into indi.vidual soft?are modules in /arallel ?ith this These soft?are modulesim/lement the 5ob ste/s of the control system These can be s/ecialfunctions such as the realisation of an interface for visualisation or com.munications systems6 or eIually  /ermanently recurring 5ob ste/s

    Phase 38 =ealisation GProgramming of solution conce/tH

    The translation of the solution conce/t into a control  /rogram is effected

    via the  /rogramming languages defined in *( F1131.3 G'*; F1131.3HThese are8 seIuential function chart6 function bloc! diagram6 ladder dia.gram6 statement list and structured tet

    ;ontrol systems o/erating in a time2logic  /rocess and available in func.tion chart to '*; F0:,:6 can be clearly and easily  /rogrammed in a se.Iuential function chart A seIuential function chart6 in as far as /ossible6uses the same com/onents for  /rogramming as those used for the de.scri/tion in the function chart to '*; F0:,:

    Ladder diagram6 function bloc! diagram and statement list are the  /ro.

    gramming languages suitable for the formulation of basic o/erations andfor control systems ?hich can be described  by sim/le o/erations logic

    o/erations or boolean signals

    The high.level language structured tet is mainly used to create soft?aremodules of mathematical content6 such as modules for the descri/tion of control algorithms

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    58/214

    ;ha/ter &

    'n so far as PL;  /rogramming systems su//ort this6 the control  /ro.grams or /arts of a  /rogram created should be simulated  /rior to com.missioning This /ermits the detection and elimination of errors right atthe initial stage

    Phase ,8

    ;ommissioning G;onstruction and testing of the controltas!H

    This  /hase tests the interaction of the automation system and the con.

    nected /lant 'n the case of com/le tas!s6 it is advisable to commissionthe system systematically6 ste/ by ste/ aults6 both in the system andin the control  /rogram6 can be easily found and eliminated using this

    method

    4ocumentation

    7ne im/ortant and crucial com/onent of a system is documentation6?hich is an essential reIuirement for the maintenance and e/ansion of a system 4ocumentation6 including the control  /rograms6 should  beavailable both on  /a/er and on a data storage medium

    The documentation consists of the document of the individual  /hases6 /rintouts of the control  /rograms and of any  /ossible additional descri/.tions concerning the control  /rogram 'ndividually these are8

    E Problem descri/tion

    E Positional s!etch or technology /attern

    E ;ircuit diagram

    E Terminal diagram

    E Printouts of control  /rograms in S;6 B4 etc

    E Allocation list of in/uts and out/uts Gthis also forms /art of the control /rogram /rintoutsH

    E Additional documentation

    &- *( F1131.3 G'*; F1131.3H structuring resources

    *( F1131.3 G'*; F1131.3H is a standard for the  /rogramming of not  5ust

    one individual PL;6 but /rimarily also of com/le automation systems

    ;ontrol  /rograms for etensive a//lications must be clearly structured inorder to be intelligible6 maintainable and /ossibly also  /ortable6 ie

    transferable to another PL; system

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    59/214

    ;ha/ter &

    4efinitions are reIuired not only for elementary language commands6 but also for the language elements for structuring Structuring resources

    Gfig B&-H relate to the control  /rograms and the configuration of theautomation system

    ;7 ('K= AT'7(=*S7K=;*

    TAS<+A=#L7BAL

    A;;*SS # PAT

    SeIuential functionchart

    P=7=AJ

    K(;T'7(#BL7;

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    60/214

    ;ha/ter &

    Structuring resources at configuration level

    The language elements for configuration describe the incor/oration of 

    control  /rograms in the automation system and their time.related control

    The automation system re/resents a configuration G;7('K=AT'7(language elementH ithin the configuration6 there are global variables+A=#L7BAL language elementH

    A resource G=*S7K=;* language elementH corres/onds to the  /roces.sor of a multi/rocessor system6 to ?hich one or several /rograms areassigned 'n addition6 it com/rises control elements6 ?hich include the

    time.related control of  /rograms This control element is a tas! GTAS

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    61/214

    ;ha/ter &

    A PL; multi/rocessor ?ith three  /rocessor cards has  been designated

    for the valve assembly The  /rocessor cards are assigned to thevalve#assembly6 the conveyor control and Iuality#control

    The  /rograms Statistics and 4ata#save are associated ?ith differenttas!s As such they  /ossess different eecution characteristics The /rogram Statistics evaluates and com/resses the Iuality data at regular intervals The /riority of this  /rogram is lo? 't is started regularly6 eg

    every -0 minutes6  by the tas! Tas!#cyclical 'n the event of an

    *J*=*(;$. ST7P6 the  /rogram 4ata#save is to transmit all availabledata to a higher.order cell com/uter in order to  /revent any  /otential

    data loss The  /rogram is started event.driven of the highest  /riority viathe *J*=*(;$.ST7P signal

    *( F1131.3 G'*; F1131.3H /rovides defined and thus standardised inter.

    faces for the echange of data ?ithin a configuration 'f s/ecific informa.

    tion such as a read variable6 is reIuired in different  /rogram organisationunits6 this variable is designated as a global variable 4ata can then  beechanged via a variable designated as such lobal variables can only

     be accessed in /rograms and function  bloc!s

    hat is of interest for net?or!ed systems is communication beyond aconfiguration S/ecial standard communication function bloc!s are

    available to the user for this These are defined in *( F1131.& G'*;

    F1131.&H and are used in *( F1131.3 G'*; F1131.3H Another  /ossibilityis the definition of access /aths Glanguage resource A;;*SS#PATH to

    s/ecific variables These can then also be read or ?ritten from other  /ositions

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    62/214

    Part # 

    ;ha/ter &

    &3 Programming languages

    *( F1131.3 G'*; F1131.3H defines five  /rogramming languages Al.though the functionality and structure of these languages is very differ.ent6 these are treated as one language family by *( F1131.3 G'*;F1131.3H ?ith overla//ing structure elements Gvariable declaration6 or.ganisation /arts such as function and function bloc!6 etcH and configura.tion elements

    The languages can be mied in any ?ay ?ithin a PL; /ro5ect The unifi.

    cation and standardisation of these five languages re/resent a com/ro.mise of historical6 regional and  branch.s/ecific reIuirements Provision

    has  been made for future e/ansion6 Gsuch as the function bloc!  /rinci. /le or the language Structured TetH /lus necessary information tech.nology details Gdata ty/e etcH have  been incor/orated

    The language elements are e/lained ?ith the hel/ of a machining /roc.

    ess involved in valve  /roduction T?o sensors are used to establish?hether a ?or!/iece ?ith correctly drilled holes is available at the ma.

    chining /osition 'f the valve to be machined is of ty/e A or ty/e B – thisis set via t?o selector s?itches  – the cylinder advances and  /resses thesleeve into the drilled hole

    Ladder diagram GL4H

    Ladder diagram is a gra/hic  /rogramming language derived from thecircuit diagram of directly ?ired relay controls The ladder diagram con.

    tains contact rails to the left and the right of the diagramM these contactrails are connected to s?itching elements Gnormally o/en2normally

    closed contactsH via current  /aths and coil elements

    ig B&,8*am/le of ladder diagram language Part#Ty/eA Part#/resent 4rill#o!  Sleeve # in

    Ty /eB

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    63/214

    ;ha/ter &

    unction bloc! diagram GB4H

    'n the function bloc! diagram6 the functions and function bloc!s are re/.

    resented gra/hically and interconnected into net?or!s The function bloc! diagram originates from the logic diagram for the design of elec.tronic circuits

    Part#Ty/eA 7=   A(4 Sleeve # in

    ig B&&8*am/le of function  bloc!diagram language

    Part#Ty /eB

    Par t #/r esent

    4r ill #o! 

    'nstruction list G'LH

    'nstruction list is a tetual assembler.ty/e language characterised  by a

    sim/le machine model G/rocessor ?ith only one registerH 'nstruction listis formulated from control instructions consisting of an o/erator and ano/erand

    L4 Part#Ty/eA 7= 

    Part#Ty/eB

    A(4 Part#/resent

    A(4 4rill#o! 

    ST Sleeve#in

    ig B&F8*am/le of instructionlist language

    ith regard to language /hiloso/hy6 the ladder diagram6 the function

     bloc! diagram and instruction list have  been defined in the ?ay they areused in todayNs PL; technology They are ho?ever limited to basic func.

    tions as far as their elements are concerned This se/arates them es.sentially from the com/any dialects used today The com/etitiveness of these languages is maintained due to the use of functions and function

     bloc!s

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    64/214

    ;ha/ter &

    Structured tet GSTH

    Structured tet is high.level language based on Pascal6 ?hich consists

    of e/ressions and instructions 'nstructions can be defined in the main

    as8 Selection instructions such as 'T*(*LS* etc6 re/etition in.structions such as 7=6 'L* etc and function bloc! invocations

    ig B&D8*am/le of structured tet

    languageSleeve#in 8Q GPart#Ty/eA 7= Part#Ty/eBH A(4 Part#/resent A(4 4rill#o!M

    Structured tet enables the formulation of numerous a//lications6 be.yond /ure function technology6 such as algorithmic  /roblems Ghigh order control algorithms etcH and data handling Gdata analysis6 /rocessing of com/le data structures etcH

    SeIuential function chart GS;H

    The seIuential function chart is a language resource for the structuringof seIuence.oriented control  /rograms

    The elements of the seIuential function chart are ste/s6 transitions6 al.

    ternative and /arallel  branching*ach ste/ re/resents a  /rocessing status of a control  /rogram6 ?hich is

    active or inactive A ste/ consists of actions ?hich6 identical to the tran.sitions6 are formulated in the *( F1131.3 G'*; F1131.3H languages Ac.tions themselves can again contain seIuence structures This feature

     /ermits the hierarchical structure of a control  /rogram The seIuentialfunction chart is therefore an ecellent tool for the design and structuringof control  /rograms

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    65/214

    'n/uts '

    7ut/uts )

    Jemory J

    ;ha/ter F

    ;ommon elements of  /rogramming languages

    F1 =esources of a PL;

    According to *( F1131.3 G'*; F1131.3H6 only in/uts and out/uts and thecontroller memory can be addressed directly by a control  /rogram 4i.

    rect addressing in this instance means that in the  /rogram an in/ut6 out.

     /ut or memory element of the controller is affected immediately and notindirectly via a defined symbolic variable  (aturally6 *( F1131.3 G'*;

    F1131.3H recognises numerous other resources6 eg timers and count.ers o?ever6 these are integrated into functions and function bloc!s in

    order to ensure the highest /ossible degree of control  /rogram /ortabil.ity bet?een different control systems

    'n/uts6 out/uts and the memory

    The most im/ortant controller constituents include the in/uts6 out/utsand the memory 7nly via its in/uts can a controller receive information

    from the connected /rocesses Similarly it can only influence these viaits out/uts or store information for subseIuent continued /rocessing

    The designations for the resources in/uts6 out/uts and memory ele.

    ments are defined by *( F1131.3 G'*; F1131.3H and mandatory

    ig BF184esignations for in/uts6 out/utsand memory

    ithout further reference6 these designate only binary in/uts or out/utsand single bit memory elements6 designated as a flag

    The standard generally s/ea!s of directly re/resented variables These

    are variables6 ?hich are referred directly to the hard?are.related avail.able in/uts6 out/uts and memory elements of the controller The alloca.tion of in/uts6 out/uts and flags and their /hysical or logical /osition inthe control system is defined by the res/ective controller manufacturer

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    66/214

    B77L Bit seIuence of length 1

    B$T* Bit seIuence of length :

    7=4 Bit seIuence of length 1F

    '6 )6 J or '6 )6 J

    'n/ut bit6 out/ut bit6 memory bit 1 Bit

    'B6 )B6 JB 'n/ut byte6 out/ut byte6 memory  byte : Bit

    '6 )6 J 'n/ut ?ord6 out/ut ?ord6 memory ?ord 1F Bit

    ;ha/ter F

    'nsofar as the controller su//orts this6 resources can be addressed6?hich are defined in ecess of one bit *( F1131.3 G'*; F1131.3H em.

     /loys a further letter to describe this6 ?hich follo?s the abbreviation '6 )or J and6 for instance6 designates  bytes and ?ords

    *( F1131.3 G'*; F1131.3H designates the data ty/es sho?n in fig BF-in con5unction ?ith in/uts6 out/uts and flags

    ig BF-8

    4ata ty/es

    1.Bit sies6 such as defined by the data ty/e B77L GbooleanH6 may onlyassume the values 0 or 1 ;onseIuently6 the range of values for B77Lty/e data consists of the t?o values 0 and 1

    'n contrast ?ith this6 one should observe that in the case of bit seIuencedata ty/es consisting of more than one bit6 there is no immediate con.

    nected range of values All  bit seIuence data ty/es such as for instanceB$T* and 7=4 are merely a combination of several  bits *ach of 

    these  bits has the value 0 or 16 but their combination does not have its

    o?n value

    The mandatory designation methods for in/uts6 out/uts and flags of dif.ferent bit length are re/resented in fig BF3

    ig BF34esignations for in/uts6

    out/uts and memory

    An individual bit of an in/ut6 out/ut or flag may also be addressed ?ith.out the additional abbreviation for the data ty/e

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    67/214

    ;ha/ter F

    Since a controller al?ays has a relatively large number of in/uts6 out/utsand flags available6 these must be s/ecially identified for the  /ur/ose of differentiation  (umbering is used in *( F1131.3 G1*; F1131.3H to this

    end6 such as in the follo?ing eam/le8

    '1 'n/ut 1

    '9 'n/ut 9

    '1& 'n/ut 1&

    )3 7ut/ut ?ord3

    JB& Jemory byte &

    J- Jemory -

    *( F1131.3 G1*; F1131.3H does not s/ecify the number range6 ?hich is /ermissible for this numbering and ?hether it should start ?ith 0 or 1This is s/ecified by the controller manufacturer

    A hierarchical number of in/uts6 out/uts and flags may also be used6 if the controller in use has  been suitably configured

    A /oint is used to se/arate the individual levels of the hierarchy The

    number of hierarchy levels has not  been defined

    1n the case of hierarchical numbering6 the highest /osition in the number on the left must be coded6 the numbers further to the right re/resentconsecutive lo?er  /ositions

    E 13:&

    The s/ecified in/ut 13:& can therefore be be made u/ as follo?s8

    *am/le

    'n/ut

    in insert (o 3

    on /lug.in card (o :

    as in/ut (o &

    ig BF,8 Structure of ahierarchical designation

    ' 3 : &

  • 8/20/2019 El Plc_libro Programmable Logic Controllers _ Festo

    68/214

    ;ha/ter F

    *( F1131.3 G1*; F1131.3H does not ma!e any comment regarding theassignment of individual bits in a B$T* or 7=4 ;ontroller manufac.turers freIuently choose hierarchical designation methods to assign in.dividual bits as  /arts of ?ords As such6 F- could for instancere/resent the bit number - of flag ?ord number F o?ever6 this does

    not necessarily have to be so6 since flag bit F- and flag ?ord Fneed not be in any ?ay connected Joreover6 no definition has  beenmade as to ?hether the numbering of individual bits in one ?ord is tostart on the left or the right Gbit number 0 on the far right has  been the

    most freIuently used so farH

    4irectly addressed variables

    1f resources in a control  /rogram are to be addressed directly6 the re.

    source designation must be /refied ?ith the sign U

    *am/les of directly addressable variables8

    U'1- or U'1- 'n/ut bit 1-

    U'& 'n/ut ?ord &

    U)B: 7ut/ut byte :

    UJ-D Jemory ?ord -D

    The use of d