Part3-UNIT3---A---PLC-Overview.docx
UNIT3AP1.COverviewP1.C综述Automationofmanydifferentprocesses,suchascontrollingmachinesorfactoryassemblylines,isdonethroughtheuseofsmallcomputerscalledaprogrammablelogiccontroller(P1.C).Programmablelogiccontrollerswerefirstclearedtoservetheautomobileindustry,andthefirstprogrammablelogiccontrollerprojectwasdevelopedin1968forGeneralMotorstoreplacehard-wiredrelaysystemswithanelectroniccontroller.Sincetheadventofprogrammablelogiccontrollers,theabilitytocentralizefactoryprocesses,especiallyintheautomotiveindustry,hasimprovedgreatly.很多不同过程的自动化,比如工厂装配线的限制机是通过运用称作可编程逻辑限制器(P1.C)这样的小型计算机完成的。可编程逻辑限制器首先是为服务于汽车工业创建的,第一个可编程逻辑限制器安排是在1968年为通用汽车取代带有电子限制器的硬线继电系统而开发的。自从可编程逻辑限制器出现以来,它集中处理工厂流程的实力,特殊是在汽车工业中,有了极大的提高。P1.C,sArchitectureP1.C的构造Programmable1.ogicControllers(P1.Cs)aredisklesscompactcomputersincludingallthenecessarysoftwareandhardwareinterfacestotheprocess.Theyaregenerallyusedforautomationcontrolapplication(e.g.closedloopcontrol)eitherstandaloneorconnectedtodistributedinputs/outputs,tootherP1.Csand/ortosupervisionPCs.TheconnectionsareestablishedbymeansoffieldbusessuchasWorldFlRMPI,PROFIBUSorEthernet.TheFig.3-3A-1showsatypicalP1.Csystem,whichiseatablishcdbyfieldbusesofMPIandPROFIBUS.可编程逻辑限制器(P1.Cs)是包含了针对过程的全部必要软件和硬件接口的无盘紧凑电脑。它们通常用于自动限制应用(比如闭环限制),单机或多机连在一起去安排输入/输出,连接其他P1.C和(或)监督计算机。它们的连接是通过利用诸如WOrIdFIP、MPI、PRoFIBUS或EIhemet这样的现场总线建立的。图3-3A-1展示了一个典型的P1.C系统,它是用MPi和Profibus现场总线完成的。AtypicalP1.Cconsistsin: Apowersupply; ACPUwheretheuserprogramruns; InputZoutputmodules; Optionalcommunicationmodules.台典型的P1.C包括: 一个电源; 一个CPU,用户程序在里边运行; 输入/输出模块; 可选通讯模块。TheavailableI/Omodulessupportawiderangeofelectricalinterfaces: Analogmodule(+/-10V,+/-IV,4-20mA,resister,etc.); Temperaturemeasurement(pt100,Ni100,etc); Digitalmodule(±24V,220Vetc.); TT1.module(BeckhoffI/Omodule,etc.); RS232module; etc.应用I/O模块支持广泛的电接口: 模拟模块(+/-10V,+-lV,4-20mA,电阻等。); 温度测量(PtloO,Ni100,等); 数字模块(±24V,220V等); TT1.模块(BeCkhOffI/O模块等); RS232模块; 等ThesemodulesareeitherconnectedtotheinternalbusoftheP1.Cortoabuscouplerconnectedtoafieldbussegment(PROFIBUS,WorldFIPorCAN)sharedwithaP1.C.这些模块不是连到P1.C的内部总线上就是连到总线耦合器上,而总线耦合器又连到现场总线的某段(PROFIBUS,WorldFIP或CAN)和P1.C共享的一段上。CustomhardwarecanhardlybeconnecteddirectlytheP1.Cinternalbus.Asolutionconsistsinintegratingthecustomhardwarewithastandardfieldbusinterface(e.g.PROFIBUS,CAN,andWorldFlP)bymeansofspecificcards(e.g.HMS,sAnyBuscards).定制的硬件很难干脆连接到P1.C的内部总线上。一个解决方法就是把定制硬件与一个标准现场总线接口(比如PROFIBUS,CAN.和WorIdFIP)通过特殊的卡片连在一起(例如HMS的随意总线卡)。Nowadays,P1.CsareprovidedwithEthernet-basedcommunications.AlthoughbasedonTCP/IPandIEEE802.2,theP1.Cprotocolsaremanufacturerspecific.Therefore,P1.Csofdifferentmanufacturerscannotexchange,bydefault,dataviaEthernet.However,SchneiderP1.ChasasocketlibraryandonecanimplementtheRFC1006usedbytheSIEMENSP1.C.OnecanalsoimplementagatewaybymeansofanOPCDXsenzer,aSCADAapplicationoraspecificcommunicationcardsuchastheApplicomone.今日,P1.C基于以太网来供应通讯。虽然基于TCP/IP和IEEE802.2,P1.C协议是由制造商明确的。因此,不同制造商的P1.C不能互换通过以太网的默认数据。然而,SchneiderP1.C有个套结字库并且自己就能完成SIEMENSP1.C运用的RFelOo6.它自己也能依靠一个OPCDX服务实现个网关,实现一-个SCada应用或一个像Applicom这样的特定通讯卡。P1.C-bascdsolutionsarewelladaptedtotwo-levelcontrolarchitectureswherethefront-endlayerhastobeautonomousandindependentfromthesupervisionlayer.Theprocesscontrol(input/outputreadout,closedloopcontrol,etc.)doesnotdependonthenetworkneitheronaremotecomputer,itismoresecure.基于P1.C的解决方案很好地适用于两层限制结构,两层限制结构的前端层必需自治并独立于监管层。过程限制(输入/输出读出,闭环限制等)既不依靠于网络也不依靠于遥控计算机,它更平安。P1.Cshavealongtermavailabilityandsupport:oldgenerationofhardwareorsoftwarearetypicallysupportedduringmorethan10yearsbytheirrespectivemanufacturers.P1.C有长期的可用性并受到支持:旧代的软硬件受到它们各自制造商的支持超过十年。P1.COperationP1.C运行P1.Csareprovidedwithmanufacturerspecificoperatingsystems.TheOShandles: ThestatesoftheCPU(start,slop,init,etc.); Thecallstotheuserprogram; Theinterrupts; Thememory; Thecommunicationwithprogrammingdevicesandothercommunicatorpartner.P1.C从制造商那里获得了特定的操作系统。操作系统处理以下任务: CPU的状态(启动,停止,初始化等); 调用用户程序; 中断; 存储器; 与可编程设备和其他通讯器材伙伴联系。P1.Csoperateinapollingrlewithapreciseexecutioncycle.Thiscycleconsistsbasicallyinthreesteps(asshownintheFig.3-3A-2SIEMENSP1.Ccycle)whicharecontinuouslyexecuted: Inthe“ReadInputs'*state,theP1.Ckernelreadsalltheinputmodulesandcopythevalluesintoitsinternalinputmemory; Inthe"Operateuserprogram”slate,theP1.CkernelexecutestheuserprogramwhichhasaccesstoalltheP1.Cmemoryareas.Itstorestheexecutionresultsinitsoutputinternalmemory; Inthe"WriteOutputsstate,theP1.Ckernelcopiestheinternaloutputmemorylotheoutputmodule.P1.C运用轮询方式借助一个精确的执行周期来运行。这个周期基本上由三个步骤组成(如图3-3A-2显示的西门子P1.C周期),三个步骤持续执行: 在“读输入”阶段,P1.C内核读入全部的输入模块并把值复制到它的内部输入存储器中; 在“运行用户程序”阶段,P1.C内核执行已经进入P1.C存储器区域的用户程序。它把执行结果存储在它的输出内部存储器中; 在“写输出”阶段,P1.C内核把内部输出存储器的内容复制到输出模块中。Inadditiontothecycle,theOSmanagestheinterrupts(hardwareinterrupts,userprogramerrors,etc.).Userprogram(controlprogram)areproducedwithadevelopmentenvironmentwhichisvendordependentandthend