iec 1131.3 lenguajes de programacion plc

Upload: champarret-sosa

Post on 03-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Iec 1131.3 Lenguajes de Programacion Plc

    1/6

    PLC Standard Programming Languages: IEC 1131 3Mark MaslarRockwell Software Inc.Today, if you use prog rammable controllersfrom more than one vendor, you bear theburden of learning more than one method ofprogra mm ing and troubleshooting. If aprogramming standard provided greateruniformity between programm ablecontrollers, you co uld reuse work andpotentially reduce the amount of re training.Yet the p roblem for the would-be developerof standards is this: how to offer relevanceto todays market and still afford migra tionto future technologies. IEC 1131 3 theinternational standard for programmablecontro ller languages has achieved this byapplying modern software engineeringprinciples to the best existing prac tices and,at the same time, provid ing forextensibility, i.e., further enhancem ents byvendors.Historical backgroundThe development of IEC 1131 can be tracedto 1978, when a French standard, AFCET,was deve loped for documenting industrialprocesses. The following year saw theintroduction of GRAFCET, which p rovidedfor simple construc ts known as steps andtransitions. These make it possible toorganize a process by breaking t down intosimpler elements and defining sequentialrelationships between elements.t wasnt un til 1982 that European controlvendors began implem enting GRAFCET asa means of both organizing and controllingsequential processes. Disparateimplementationsof GRAFCET soonproliferated, however, caus ing users andvendors to identify the need for intern ationalstandards. In 1987, the IEC (InternationalElectrotechnicalCommission) announced ageneral standard for all control systems. IEC848, Preparation of Function Charts forCon trol Systems. In March, 1994, astandard specific to programmablecontrollers, IEC 1131-3, reach ed standardstatus.

    Scope of the standardDeveloped with the input of vendors, end-users and academics, IEC 1131 consists offive parts:1. General information2. Equipment and test requirements3. PLC programming languages4. User guidelines5 CommunicationsIEC 1131-3 is the standa rd for programminglanguages: as such, it spec ifies the syntax,semantics and display for the follow ing suiteof PLC programming languages:Ladder diagram (RLL)Sequential Function Char ts (SFC)Function Block D iagram (FBD)Structu red Text (ST)Instruction List (IL)BenefitsIn addition to provid ing for a choice ofprogramming languages, the standard alsoenables programmers to integrate multiplelanguages within the same application. Thisallows the programmer to select thelanguage best suited to the particular task.The standard also prov ides for commonelements, such as data types, variables,and program organization. As a result,standard-compliant programs look similarand are easier to transport between systemswhich reduces training time and engineeringeffort. At the same time, the instruc tion setis not limited by the standard; vendors arefree to develop new instructions o m eetcustomer needs as they arise.Language overviewwo of these languages - Ladder Diagram(LD) and Func tion Block Diagram (FBD) -

    are graphical; Instruction List (IL) andStructu red Text (ST) are textual. SequentialFunc tion Charts (SFC) may be thought of asbuilding blocks controlling program flow.

    0-7803-3148-6-5/964.00 1996 EE 6

  • 8/12/2019 Iec 1131.3 Lenguajes de Programacion Plc

    2/6

    Sequential Function Chart programmingSFC programm ing offers a graphicalmethod of organizing he program, withprogramming in other languages nes tedwithin the SFC. The three maincomponents of an SFC are steps,transitions, and actions. Steps are merelychunks of logic, i.e., a un it of programminglogic that accomplishes a particula r contro ltask. Actions are the individu al aspects ofthat task. Tran sitions are the mechanismsused Po move from one task to another.For example, filling a tank might be a stepwhich could be further b roken down intoactions such as op ening ingredient valvesA,B, and C. A transition - measu ring fluidlevel - would lead to the n ext step, blending.As a graph ical language, SFC program mingoffers the users several choices forexecuting a program, each depicted in avisually distinct way (Fig. 1). In a sequentialconfiguration, the processor simplyexecutes the actions in step 1 repeauedly,until the transition logic becomes true. Theprocessor then proceeds to step 2. In aselection branch, only one branch isexecuted depending on which transition isactive. In a simultaneous branch, allbranches are executed until the transitionbecomes active. In addition to varioustypes of branches, the operation ofindividu al actions within a step can bevaried with the use of action qualifiers.Qualifiers (Fig. 2) determine how the actionis scanned and allow actions to becontrolled without additional ogic.For example, one could use the L qualifierto limit the time that ingredient valve B isopened.In practice, an active step is highlighted tosignal to the programmer which part of theprogram is executing - a useful feature fortroubleshooting. This highlighting s anexample of the standards extensibility - theability of a vendor to add a feature notspecified in the standard.Note that the stand ard offers SFCprogramming as an organizing tool. Theuser chooses whether to use it or not, basedon whether the process being controlled ssequ ential in nature. And even if SFC

    programming is used, the actions will bewritten in oine of the four program minglanguages described below. Figure showsa sample net weight calcula tion as it wouldbe performed n each of these languages.In each example, net weight is calcu lated bysubtracting tare weight from the grossweight.Ladlder Diagram Chart p rogram min gFor people who understand relay controls,LD continues to be an advantage in terms ofusalbility. Although it is possible to programail control logic in LD, supplementing LDwith other languages allows users access tothe language best suited for a particularcontro l task. The standards implementationof LD appears in Figure 3.Function Block Diagram Programmin gLike SFC, FBD is a graphical language thatallows programming in other languages(ladder, instruction ist, or struc tured text) tobe nested within the FBD. In FBD, programelernents appear as blocks which are w ire dtogether in a manner resemb ling a circuitdiagram (Fig. 3). FBD is most useful inthose applications nvolving a high degreeof information/data low between controlcomponents.lnsl truct ion Llst programmingThis low-level language s similar toAssembly language and is useful in caseswhere small functions are repeated often.IL allows thiese functions to be written once,and then to simply issu e calls in latterinstances in the control program (Fig. 3).Structured Text Programm ingThis high-level anguage resembles Pascalor Egasic, and, in fact, people trained incomputer programming languages often findit the easiest languages to use forpro gramming contro l logic. When symbolicaddlressing is used, ST programs resemblesentences, making it highly intelligible to thenovice user as well (Fig. 3). Two keyadvantage?;of structu red text over ladderdiagram are its ability to perform complexmath algorithm in ST can fit on a singlepagie.As another example of the standardsextensibility, Rockwell Software augmentsST with a feature called PowerTextTM,

    7

  • 8/12/2019 Iec 1131.3 Lenguajes de Programacion Plc

    3/6

    which supplements standard ST with real-time display of discre te, forced, analog, andfloating-p oint values.Compliance/compatlbilltyWith the choice of five standardprogramm ing anguages, users have gainedconsiderable new programm ing flexibility.Yet, it is important to point out what the newstandard does not do. The standard doesnot, for example, specify the physical I Oand memory address mapping, allowing thisto vary with the hardware being used. Andthe standard does not define a commonmachine-level software interfacesomething that wo uld make it possible toexchange applications betweenprogramm able controllers from multiplevendors.A separate organization has been createdwith that goal in mind. PLCopen is aworldwide association that maintainsvendor- and product-independence, as wellas independence from IEC. Founded inJune 1992, the group has adopted the IEC1131 standard; its members are comm ittedto supply or use IEC 1131-compatiblesystems and, in general, promo te the 11313 standard. The association developscommon implemen tation concepts, appointslaboratories for compliance esting, anddefines test criteria. The long-term goal of

    PLCopen is to allow users to move betweenprogrammable controllers with very littletraining and to exchange applicationsbetween PLCs.ConclusionThe 1131 3 standard benefits vendors andusers alike. For users, the standardpromises to reduce the amount of rewritingof applications and the retraining requiredwith each new control system. For vendors,the standard holds the prom ise of reduc ingdevelopment time (no need to reinvent thewheel) and, subsequently, increasing imespent to meet specific customer or indu stryneeds.

    For a copy of IE 1131-3,contact: AmericanNational Standards Institute, Inc., CustomerService Dept., I W. FdSt., New York, NY10036; Tel: 212) 642-4900; Fax: 212)302-1486For additional information about PLCopen,contact: PLCopen, PO Box 2077,5300 CNZaltbommel, The Netherlands; Tel: +3 4 18041 139

    8

  • 8/12/2019 Iec 1131.3 Lenguajes de Programacion Plc

    4/6

    Figure 1: Sellectlon B ranch, SlmuUtaneous Branc h, and Sequential Co nfig uratio n SFC~ r o g r a m ~ i n g

    Select ion B ranch

    lmultaneous Branch

    ~ e ~ ~ e n t i a ~Conflgurat lon tAction 1Action 2Action

    29

  • 8/12/2019 Iec 1131.3 Lenguajes de Programacion Plc

    5/6

    Figure : 8FC Action Quali f iers

    SR

    L

    D

    P

    SD

    DS

    SL

    SFC Action Qualifiers

    Nonstored Terminate when the step becomes inactive.Set stored) Continue after the step is deactivated, until the action is reset.Reset Terminate the execution of an action previously started with the SSD, SL, r DS qualifier.time Limited Start when step becomes active and continue until the step goes

    inactive r a set time passes.time Delayed Start a delay timer when the step becomes active. If the step

    is still active after the time delay, the action starts and continuesuntil deactivated.Pulse Start when the step becomes ActiveiDeactive and execute theaction only once.Stored and timeDelayed Action starts after time delay, continues until reset.Delayed Stored If step is still active, action starts after time delay, continues untilreset.Stored timeLimited Action starts when step becomes active, continues for a set time r

    30

  • 8/12/2019 Iec 1131.3 Lenguajes de Programacion Plc

    6/6

    Figure 3:Weight Calculatio n Textual Languages

    Inst ru cti on Lis t IL) LD Weight-CommandJMPC WEIGH-NOINST EN0FiETLD gross-weightSUB tare-weight

    Struc tured Text ST) IF W EIGH-COM MAND TH EINEND-IF;NET-WEIGHT :=: GROSS-WEIGHT TARE-WEIGHT;

    Weight Calculat ion -Textual Languages

    Funct ion Block Diagram FBD)WEIGH

    Weigh-Commandgross-weight Net-Weighttare-weight LIMITS ALARMHigh flagHigh limitVariable value A,arm out putLower Limit

    Ladder Diagram RLL)

    gross-weighttare-weigh

    31