OPC Technology.docx

上传人:b****2 文档编号:3185725 上传时间:2023-05-05 格式:DOCX 页数:12 大小:88.91KB
下载 相关 举报
OPC Technology.docx_第1页
第1页 / 共12页
OPC Technology.docx_第2页
第2页 / 共12页
OPC Technology.docx_第3页
第3页 / 共12页
OPC Technology.docx_第4页
第4页 / 共12页
OPC Technology.docx_第5页
第5页 / 共12页
OPC Technology.docx_第6页
第6页 / 共12页
OPC Technology.docx_第7页
第7页 / 共12页
OPC Technology.docx_第8页
第8页 / 共12页
OPC Technology.docx_第9页
第9页 / 共12页
OPC Technology.docx_第10页
第10页 / 共12页
OPC Technology.docx_第11页
第11页 / 共12页
OPC Technology.docx_第12页
第12页 / 共12页
亲,该文档总共12页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

OPC Technology.docx

《OPC Technology.docx》由会员分享,可在线阅读,更多相关《OPC Technology.docx(12页珍藏版)》请在冰点文库上搜索。

OPC Technology.docx

OPCTechnology

Contents

∙HistoryofOPC

∙WhydoweneedOPC?

itsBenefits

∙OPCConcepts&Terminology

∙COMInterfaces&ComponentCategories

∙OPCCompliance

∙OPCSpecifications

∙Resources

SchematicofOPCServer.

 

Figure1.

etc)-->

Introduction

COM/OLEapplicationsarewidelyusedinIndustrialAutomationandProcessControldomains.Sincenotmanyprogrammersareawareofthesetechnologies,IthoughttosharemyexperienceinOPCandmostdeveloperswouldlovetoexpandtheirknowledgeaboutCOM/OLEapplicationareas.

ThisismyfirsteverarticleonCodeProject,soifyoufeelanythingneedstobeimproved,dropmealine.Yoursuggestionsandcommentsaremostwelcome.

Thegoalofarticle:

Give simple&understandable overviewofOPC.MoredetailedinformationandspecificationscanbedownloadedfromOPCFoundationandwebsitesmentionedinResourcessection.

Sofirst,abouttheabovediagram... 

TheoryaboutFigure1:

Onleft-bottomisahardwaredevice.Itcouldbea PLC (programmablelogiccontroller),atemperaturesensor,rollerbeltcontroller,orjustaboutanyindustrialdevice.CentralpartistheOPCserver.Rightsideistheclientthatwantsto operatethedevice.TheOPCServergivesoutstandardCOMinterfacessothatanyclientawareofthese OPCInterfaces caninterfacewithserverandoperatethedevice-withoutprogrammingdevicedriverforthathardware.HardwarecanbeasvariedasOPCservercanhandleandclientscanstillreadandwritefromthishardware.

Nowback toourOPCcourse.ThisarticlegivesanoverviewofOPCandcoversfollowingtopics.Sourcecodeisnotavailable,sincemostofservercodeisspecifictohardware.Andclientwouldstillneedaservertoconnectto.Butyes,ifyouwanttoexperimentwithOPC,checkouttheResourcessectionbelow.

HistoryofOPC

In1996,agroupofcompaniesRockwellSoftware,Intellution,et.al.cametogethertoformaconsortiumthatdefinedastandardforprocesscontrol.SCADAandsimilarstandardizationeffortswerebeingmadeatthattimeinprocesscontrolandautomationindustry.ThisgroupcreatedaninitialdraftthatwasbasedonMicrosoft'sObjectLinkingandEmbedding(OLE).Itwascalled OLEfor Process Control(OPC). OPCFoundation publishesspecificationsandmanageseverythingthatgoesintoOPCtechnology.

Todaymorethan300companiesarepartofOPCFoundation.Microsoft,GE,Siemens,Rockwell,ABB,Ford,HoneywellandmorearemembersthatactivelycontributeandconsumeOPCtechnology.

In2005,OPCFoundationreleasedOPCUnifiedArchitecturedraft.Therearepredecessordraftsreleasedbefore-OPCHDA,OPCDX,OPCAE,OPCCommands,OPCSecurity.Wewillbrieflystudytheminthisarticle.

Bynow,youmusthaveaquestioninyourmind.Letmeansweritbelow...

WhydoweneedOPC?

itsBenefits

IwasalsoafirsttimertoOPC(comingfromvariedexperienceinDevTools,eLearning,CAD/PLM,Multimedia),andhadnoclueastowhydoweneedit.Ifoundthatlearningitthroughacasestudywasveryhelpful,soIamgoingtodothesameforyou.Tounderstandtheneedforstandardizationinprocesscontrolindustry,letmegiveyouanactualcasestudyperformedbyagiantorganizationinPetrochemicalsbusiness.

Refertofigure2.Itshowsthedevicesandsoftwareapplicationthatwereinactiononthisparticularpetrochemicalplant.

 

Figure2.

PLC,Vibrationsensor,andCalculationengineworkondifferentcommunicationprotocols-TSAA,Modbus,andDDE.SothesoftwareapplicationsthatneeddatafromthesedevicesalsoneedtobeawareofTSAA,Modbus,andDDEprotocol.Additionallyeachdeviceneedstoserveallthethreeapplications.Theprocesshistorian,GUIapplicationprovidinghumanmachineinterfaceandthemachineconditionmonitorallcommunicatingwithalldevicesresultsinacomplexity.Thisdeploymenttookthecompanyaround10days.AnditscostwasapproximatelyUS$50,000.

Now,someonelikeme:

)cametothemandsaid,"heyguys,whydon'twethinksmartandimplementasinFigure3?

".Observethereducedcomplexity.NowallsoftwareapplicationstalkonlytotheOPCServers.AndalldevicesalsorespondonlytotheOPCserver.OPCServerprovidesthe BlackBox forsoftwareapplicationsaroundhardware.

 

Figure3.

Thenewimplementationtookjust2daystodeployandcostincurredwasapproximatelyUS$10,000.Theycouldhaveeliminated2OPCserversaswellandimplementeddevicedriversrightinsideasingleOPCserver.ThisisatradeoffandofftheshelfOPCserversmayhavestandardprotocolssupportlikeDDE,ModbusandTSAA.

Asyouobservedcorrectly,thebenefitsare:

∙Reducedloadondevice.

∙Scalabilityofsystemhasincreased.

∙OPCserverprovidescachingofdata.

∙Clientapplicationsneednotknowhardwareprotocoldetails.

∙Increasedlifefordevice(itneednotservemultipleclientsanymore).

∙Interoperability(Unix/LinuxandWindows-bothplatformsaresupportedbyOPC)

∙Standardization

NowthatyouhavesomeinsightintoOPCbenefitsandhistory,let'stakeonestepaheadtounderstandOPCterminologyandconcepts.

OPCConcepts&Terminology

OPCspecificationdefinesaconsistentterminologytoidentifyvariousentitiesinvolved.ThebestanalogytoOPCwayofdatarepresentationisthatofafilesystemhierarchy.OPCcallsitasOPCAddressSpace.Withinthisaddressspaceeveryentitycanbeuniquelyidentifiedbyits"full-path".Forexample,refertofigure4.

 

Figure4.

OPCAddressSpace ishierarchical.Itstartswitharoot.Thentherearelogical folders and sub-folders.Leafnodesare OPCItemsorTags.Generallyyoursensorsandactuatorsformtheleafnodes.Thisisanimportantpointtounderstandandwewillspendsometimeonit.Forexample,youhaveadevicethatcansensetemperature,Pressure,andHumidity.Thentheseattributesaregenerallymappedasleafnodesundersomefolder-subfolderhierarchy.Wewillseewhatthathierarchycanbeinamoment.Ifyouhaveanactuator(say,Turn_ON_Boiler),thenthatalsobecomesaleafnode.Youcanwriteto Turn_ON_Boiler valuesof1or0forexample,andnecessaryactionwillbetaken-ofcoursewejustassumedthatyourhardwarecontrolmechanismbehavesthisway.Youcanreadfrom Temperature toknowsensedvalue.

Hopeweareallcleartillthispoint.Nowlet'sunderstandthis"logical"folderstuff.Thelogicalfoldersandsub-foldersareusedtorepresentstateofyourIndustrialAutomationsystem.Thisconfigurationcanactuallymaptosomephysicalconfigurationorevengeographicalsetup.Let'sspendsometimetounderstandthisoneaswell.Forexample,inthisdiagramwehaveanethernetcommunicationchanneltowhichawirelessmeterisconnected.Andwithinwirelessmeter,therearetwoclasses"Average"and"Channel1".Thesefoldersandsub-foldersareveryeffectivemeansofgroupingyourprocesscontrolparametersandvalues.

Thisaddressspaceis"published"toallclientsofOPCserver.TheOPCclientscanbesimplespreadsheetslikeExcel,processhistoriansthatkeeprecordofdatacomingfromvariousindustrialplantentities.Everyclientcancreatealogicalentitycalledas group insideOPCserver.Each OPCGroup cancontainasetofOPCItems.

Synchronous&AsynchronousOPCItemreading

OPCspecificationsupportssynchronousaswellasasynchronousreadingandwritingonhardwaredevices.Sincenotallhardwaredeviceoperationsarefast-enough,theasynchronousmechanismofreadingandwritingtoadevicecomesveryhandy.

COMInterfaces&ComponentCategories

Well,sonowsupposeyouwishtowriteyourfirstOPCclient.Ifyouweredevelopingaclientthatrunsonlocalmachineasthatofserver,andifyouwereawareofallOPCServerProgIDs,thenwewouldnothaveanyworries.Butsincethatisnotpossible,weneedanenumerationmechanism.Followingisanenumerationmechanism.

 Collapse

OPCComponentCategories

EnumerationissueisaddressedbyrequiringOPCserverstoimplement

componentcategories.Forexample,allserversthatareOPCDA1.0

(moreaboutthisinlatersections)compliantimplementCOMcategory

withCatID{63D5F430-CFE4-11d1-B2C8-0060083BA1FB}.Similarlythe

serverscompliantwithOPCDataAccess2.0implementcategorywith

CatID{63D5F432-CFE4-11d1-B2C8-0060083BA1FB}.

SoOPCFoundationdistributesaWindowsServicecalledasOPCEnum.

 Collapse

EnumeratingOPCServers

OPCEnum.exerunsasaWindowsServiceandprovidesenumeration

functionality.UsingOPCEnum,theclientapplicationscanquery

availableOPCServersonlocalaswellasremotenetworkedmachines.

Nowlet'slookatservercomponentinterfaces.

 

Figure5.

TherearevariousCOMinterfacesthatOPCServermustsupportaccordingtheOPCSpecificationcompliancerequired.Thesebasicinterfaceshavespecificfunctionality.

IOPCBrowse ThisinterfacehasmethodsthatallowbrowsingOPCAddressSpace.Clientcanquerylevelbylevelfoldersandsubfolderstilltheleafnodes.Thehierarchylookslikeshownin figure4.

IOPCItemIO InterfaceisusedforperformingOPCItemreadandwriteoperations.

Nowlet'sunderstandhowOPCClientinteractswiththeOPCServer.Importantstepsinvolvedaresummarizedinfigure6,below.

 

Figure6.

Iknowyoumuststillbewonderingaboutthis OPCGroup term.Let'sspendsometimeunderstandingit.EveryclientwhenopensasessionwithOPCServer,needstocreatealogicalgroupofitemsthatitwantstoreadorwrite.Clientcanmaintainmultiplegroups.Eachgroupisgivenauniquenameandhasfollowingattributes:

∙Updaterate[milliseconds]atwhichthevaluesofitemsareread.

∙ActiveorIn-activeFlag[Boolean]onlyifgroupisactivethattheitemsareprocessed.

∙Deadband[%]variationsinsidethisbandareconsideredNULL.

∙IOMode[S

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2