Sie sind auf Seite 1von 46

GettingStartedGuide

20090520

Copyright20052014SSABAB

Permissionisgrantedtocopy,distributeand/ormodifythisdocument
underthetermsoftheGNUFreeDocumentationLicense,Version1.2
oranylaterversionpublishedbytheFreeSoftwareFoundation;
withnoInvariantSections,noFrontCoverTexts,andnoBackCoverTexts.

TableofContents
Aboutthisguide...................................................................................................................................4
Downloadandinstallation....................................................................................................................6
Createaproject.....................................................................................................................................7
ConfiguretheProject............................................................................................................................9
ConfiguretheProcessstation.............................................................................................................15
CreateasimplePlcprogram..........................................................................................................17
Build...............................................................................................................................................20
Startruntime..................................................................................................................................21
Examinetheruntimeenvironment............................................................................................22
ProcessGraphics............................................................................................................................23
Analogprogramming.....................................................................................................................27
Alarmsandevent...........................................................................................................................31
MoreProcessGraphics..................................................................................................................34
Changethecolorandtextofapushbutton................................................................................34
Buildagraphiccomponent.......................................................................................................36
Writeahelptext.............................................................................................................................39
Appendix............................................................................................................................................44
Glossary.........................................................................................................................................44
EditfunctionsintheConfigurator.................................................................................................45
EditfunctionsinthePlcEditor......................................................................................................46

Aboutthisguide
Thisguidewilltakeyouthroughthestepsofconfiguring,developing,simulatingandrunninga
smallProviewproject,onasinglecomputersystem.Theguidedoesnotintendtobe
comprehensive.Fordetaileddocumentation,pleaseconsulttheDesigner'sGuideortheGE
(graphicaleditor)Manual.ThesedocumentsareavailableattheProview[http://www.proview.se]
site.

Downloadandinstallation
ToconfigureaProviewsystemyouneedtoinstalltheProviewDevelopmentpackage,pwr46,
whichisavailableontheDownloadpageatwww.proview.se.Downloadthepackageforyour
LinuxreleaseandfollowtheinstructionsintheInstallationGuidetoinstallforthepackage.

Createaproject

Loginasuserpwrp.Duringinstallationtheuserpwrpwithpasswordpwrpisaddedto
thesystem.

OpentheProjectListbydoubleclickingontheProviewicononthedesktop.TheProjectList
willopenupinanewwindow.

EnterEditmodebyactivatingEdit/Editmode(Ctrl+E)inthemenu.OnceinEditmode,an
objectpalettewillappeartotheleftinthewindow.

Createaprojecthierarchy.TheProjectListatfirstonlycontainstheBaseshierarchy.To
createahierarchyfortheprojects,selectHierinthepalette,movethecursortotheBases
hierarchyandmiddleclick.Anew,emptyHierobjectisinsertedbelowtheexistingone.
Thehierarchyobjectisacontainerforarbitraryobjectsandithastwoattributes:an
ObjectNameandaDescription.Toexpandtheobjectandexposetheattributes,selectthe
objectandusetherightarrowkey.Now,toeditanattribute,selecttheattributeandusethe
rightarrowkeytoopentheinputfield.
WechoosethenameTestforourhierarchy.

WethenaddaProjectRegobjecttotheTesthierarchyandnameitGettingStarted.We
wanttoaddtheProjectRegasachildandnotasasibling.Todothis,middleclickdirectly
onthedesiredparentleaf,whichisourTesthierarchyinthiscase.Opentheobject(select
theobjectandusethearrowrightkey)andsetthenametoGettingStarted.Notethatthe
projectandpathattributesalsoareinfluencedthenamechange.

Savethechanges(Ctrl+S)andleaveEditmode(Ctrl+E).

FigTheProjectList
Tip
Thisconfiguratortoolisusedtoconfiguremostfunctionsofthesystem,bycreating

objectsandsetvaluestoobjectattributes.SeeEditfunctionsintheConfiguratoron
howtoselect/create/delete/moveobjectsandsetattributevalues.Notethatmost
actionscanbeactivatedindifferentways:fromthemenu,fromthePopupMenu
(openedbyrightclickingonanobject),withasinglemouseclickorfromthe
keyboard.

ConfiguretheProject
ThenextstepistoattachtheprojectandtheDirectoryVolumebyrightclickingtheProjectReg
objectintheProjectList,andchoosingOpenProjectinthepopupmenu.
Tip
Analternativewayistoopenaterminalwindowandtype
>sdfgettingstarted
Thesdfcommandsetsupenvironmentvariablesfortheprojectwithdefaultvalues.
TheDirectoryNavigatoristhenstartedwith
>pwrs
StartinguptheDirectoryNavigatorforthefirsttimeinaprojectwillactivateawizardthatwill
configurethenodesandvolumesoftheproject.Tocreateasimpletestprojectyoubasicallyjust
havetopressthe'Next'button.

Comment
Thesystemgroupdefinestheusers
thatwillhaveaccesstothe
system.Commonisapredefined
groupwiththeuserspwrpand
b55.Byopeningthe
UserDatabaseyoucandefineyou
candefineanothersystemgroup
withusersandenterthenameof
thissystemgrouphere.

FigDirectoryVolumeWizard1
PressNext.

TheProviewnetworkisdivided
intobuses,andiftwonodes
shouldbeabletocommunicate
witheachothertheyhavetobeon
thesamebus.Wewilllaterstart
theruntimeenvironmentonthe
simulationbusid,whichisstated
to999.Theenvironmentvariable
$PWR_BUS_IDcontrolswhich
bustheruntimeisstartedat,and
thisisconfiguredinthefile
/etc/proview.cnf.

Comment
Thiswillregisterthevolume
VolGettingstartedinthe
GlobalVolumeList.Inthisvolume
wewilllaterconfigureour
processstation.

FigDirectoryVolumeWizard2
PressNext

Comment
Ifwehavemorethanonenode
(process,operatororstorage
station)inourprojectweshould
registeronevolumeforeachnode.
Thestandardnameforaroot
volumeisthenodenamewiththe
prefix'Vol'.Forourdevelopment
andsimulationnodeswedon't
registeranyvolumes.Theywill
loadavolumeforoneofthe
process,operatoror
storagestationsintheproject.

FigDirectoryVolumeWizard3

Wecanalsoregistera
classvolumeifweneedtocreate
specificclassesinthisproject.
Thestandardprefixfor
classvolumesis'CVol'.

PressNo
Comment
Inthispagethetypeofthe
registeredvolumesarespecified.
Inourcasewewantarootvolume
whichisthedefault.Aroot
volumeisavolumethatusually
containsalltheobjectsofanode,
andisloadedintothenodewhen
theruntimeenvironmentis
started.

FigDirectoryVolumeWizard4
PressNext

Comment
Thisistheconfigurationofthe
processstation.Normallywe
wouldenteravalidIPaddress,
butinourcase,wearenever
goingtostartthisnode,instead
wewillstartthesimulationnode
whichisconfiguredonthenext
page.

FigDirectoryVolumeWizard5
PressNext
Comment
Thisistheconfigurationofthe
currentnode,onwhichwelater
willstarttheruntime
environment.Notethatthedefault
IPaddressistheloopbackaddress
127.0.0.1,whichwillworkas
longaswedon'thaveany
communicationwithothernodes.

FigDirectoryVolumeWizard6
PressNext

FigDirectoryVolumeWizard7
PressNext

Nowtheconfigurationobjectforvolumesandnodesarecreatedandstoredinthedirectoryvolume.
Let'stakeabrieflookattheresult.

FigDirectoryVolume
Theviewisseparatedintotwowindows,theleftwiththeconfiguredvolume(s)andtherightwith

theconfigurednodes.UndertheproductionbusPrd1theproductionnodeisconfiguredandunder
thesimulationbusSim999thecurrentnodeisconfiguredasasimulationnode.Undereachnodea
rootvolumeisstatedwithaRootVolumLoadobject,specifyingwhichvolumeisloadedatProview
runtimestartup.ThereisalsoaSystemobjectcontainingthesystemnameandsystemgroup.Ifwe
laterwanttoaddvolumesordnodestotheproject,weentereditmode,andcreateadditional
VolumeConfigandNodeConfigobjects.
Ifwereturntothewizard,thereisstilloneremainingpage.
Comment
Wewillnowopentherootvolume
VolGettingstartedwherethe
configurationofourprocess
stationismade.
Tip
Thisvolumecanalsobeopenedby
rightclickingonthe
RootVolumeConfigobjectinthe
DirectoryVolume,andactivating
OpenProjectinthepopupmenu.
Itcanalsobeopenedfroma
terminalwindowwiththe
command(dosdftotheproject
first)
>pwrsvolgettingstarted

FigDirectoryVolumeWizard8
PressYes

ConfiguretheProcessstation
OpeninganemptyrootvolumewillstarttheRootVolumeWizard
Comment
Theprocessstationcontains
alsothefunctionalityofthe
operatorstation(andstorage
station)sowewillbeablestart
theoperatorenvironmentas
well.

FigRootVolumeWizard1
Wewillconfigureaprocessstation,pressNext.

FigRootVolumeWizard2
UsethestandardconfiguratonandpressNext.

FigRootVolumeWizard3
PressNexttosavetheconfiguration.

FigVolGettingstartedinitialconfiguration
Let'shavealookattheresultintherootvolumeVolGettingstartedwindow.TheConfiguratoris
separatedintotwowindows,thePlanthierarchytotheleftandtheNodehierarchytotheright.Note
thatwealreadyareineditmode,andthepaletteisvisibletotheleft.
Thenodehierarchycontainsconfigurationobjectsforthehardwareandforsystemprocesses,andis
alreadyconfiguredtosomeextent,alltheobjectsneededtorunoursimulationisthere.

Theplanthierachythough,isempty.Itwillcontainobjectsforthesignals,sensorsandcomponents
intheplant.Wewillalsoaddcodformtheplcprogramintheplanthierarchy.

CreateasimplePlcprogram
Ifyouhavefollowedtheguide,theConfiguratorfortherootvolume,VolGettingstarted,isnow
open,andineditmode.
Tip
Toopentherootvolumeagain,loginaspwrp,doubleclickontheProviewiconto
opentheProjectList,findtheGettingStartedproject,rightlclickonitandactivate
OpenProjectinthepopupmenu.Thiswillopenthedirectoryvolume.Here
rightclickonetheVolGettingstartedobjectintheleftwindow,andactivateOpen
Volumeinthepopupmenu.Nowtherootvolumewillopen.Entereditmodewith
Ctrl+E.

CreatethehierarchyH1inthePlanthierarchy:openthePlantmapinthepalettetotheleft,
andselect$PlantHier.MiddleclickinthePlanthierarchywindow(theleft)anda$PlantHier
objectiscreated.Selecttheobject,andpresstheArrowrightkeytoopentheobject,andset
thenametoH1(selectObjectNameanduseArrowrightkeyagaintoopentheinputfield).
ClosetheobjectwithArrowkeyleft.

Createfourdigitalvalueobjects(Dv):opentheSignalmapinthepaletteandselectDv.
MiddleclickontheleafoftheH1objecttocreateachildobject..Continuetocreatethree
additionalDvobjectsandnametheDvobjectsDv1,Dv2,Dv3andDv4.
TipArrowupwhentheinputfieldisopenrecallsthelastinsertedvalues.

CreateaPlcPgmobject:selectPlcPgminthepalette.CreatetheobjectaschildtoH1and
nameitPlc.Setalsothedescriptionto'Asimpleprogram'.Notethatthedescriptionis
displayedentheconfigurator.
TipMostobjectshaveadescriptionfield.It'susuallyagoodideafillinthis.

Save(Ctrl+S)andleaveeditmode(Ctrl+E)

FigDvandPlcPgmconfigured
Nowit'stimetoopentheplceditor.RightlclickonthePlcobjectandactivateOpenProgram.Note
thatyouhavetoleaveeditmodetoopentheplceditor.
ThePlceditorcontainsaworkingareawithapaletteandnavigationwindowtotheright.Wewill
createanAndgate,anOrgateandaWait(delay)functionobject,andwewillusetheDv'swehave
createdasinputsandoutputinthelogicalschema.

CreateanAndgatebyopeningtheLogicmapinthepaletteandselectAnd.Movethecursor
totheapositionintheworkingareawhereyouwanttoplacetheAndgateandclickthere.
Themousebuttonshouldnotbepressedwhenmovingthecursor.

CreateanOrgatebyselectingOrandmovethecursortoapositionintheworkingarea.

ConnecttheoutputoftheAndtothefirstinputoftheOrbydraggingwiththemiddlebutton
fromtheAndoutputpintotheOrinputpin.
TipItcanbealittlehardtohitapin.Notethatalsotheareainsidethepinissensitive.

WewillnowinvertthesecondinputoftheOrgate.RightlclickontheOrgateandactivate
ObjectEditorinthepopupmenu.Fromtheobjecteditorwecanaddnewinputsandinvert
them.ClickontheInvertcheckboxforIn2toinvertthesecondinput.Thenclosetheobject
editor.

CreateaWaitobjectbyselectingWaitinthepaletteandplacetheobjectintheworking
area.OpentheObjectEditor(fromthepopupmenu)andenterthedelaytimeinTimerTime
to5(selectTimerTimeandpresstheArrowrightkeytoopentheinputfield).Closethe
objecteditor.NotethatthedelaytimeisdisplayedintheWaitfunctionobject.

ConnecttheoutputfortheOrgatetotheinputoftheWaitobject.

NextstepistoconnecttheDv'sasinputandoutputtothelogicalschemawehavecreated.
CreateaGetDvobject,whichfetchesthevalueofaDvobject,bydraggingwiththemiddle
buttonfromtheinputoftheandobject(asyoucreatedaconnectionbefore),andreleasing
thebuttoninsomeemptyspaceintheworkingarea.ThiswillcreateaGetDobjectthatcan
beconnectedtotheDv.

ActivateView/Palette/Plantinthemenutoreplacethepalettewiththeplanthierarchy.
SelectDv1andactivateConnectinthepopupmenufortheGetDobject.

ContinuetoconnecttheotherinputstoDv2andDv3,andtheoutputtoDv4.
TipYoucanalsouseCtrl+LeftDoubleClicktoconnecttotheplanthierarchy.

Ourprogramisnowcomplete.Saveandclosetheplceditor.

Build
ReturntotheVolGettingstartedconfigurator,andactivateFunctions/BuildNodeinthemenu.

Selectthecurrentnode,whichisoursimulationnode(notthegettingstartednodewhichisournon
existingprocessstation).

FigBuildnodeselection

Startruntime
Itnowtimetostarttheruntimeenvironment.ActivateTools/RuntimeMonitortoopentheruntime
monitor.Clickonthe'StartRuntime'buttonandwaitforthe'Down'labeltoswitchto'Running'.

FigRuntimeMonitor
Tip
Theruntimeenvironmentcanalsobestartedfromaterminalwindowwiththe
command(don'tforgettodosdftotheprojectfirst)
>rt_ini&
andstoppedwiththecommand
>.pwr_stop.sh
IfyouhaveconfiguredanotherBusidentitythanthedefault(999)youhavetoset
thistotheenvironmentvariablePWR_BUS_ID
>exportPWR_BUS_ID=998
Thiscanbeinsertedintheloginscript$pwrp_login/login.sh.
Youcanalsochangethedefaultbusidin/etc/proview.cnf.

Examinetheruntimeenvironment
Theruntimeenvironmentisviewedbytheruntimenavigator(Xtt).ItisstartedfromFile/Runtime
Navigatorintheruntimemonitormenu.
Tip
Youcanalsostartitfromaterminalwindowwith
>rt_xtt
UndertheDatabasemapyouwillfindtheobjecttreewiththeH1hierarchyandthePlcPgmwe
created.

FigRuntimeNavigatorXtt
RightclickonthePlcobjectandactivateOpenPlcinthepopupmenutoopentheprogram.Nowthe
logicalschemaisviewedintracemode,withobjectswithhighstatusmarkedwithred.

FigTracefortheplccode
Tochangeoneoftheinputvalues,forexampleH1Dv3,rightclickontheobjectandactivateObject
Graphinthepopupmenu.

FigObjectgraphforH1Dv3
ClickontheSliderbuttontoenabletheslidertotherightandchangethevaluetohighwiththe
slider.NoticehowthehighlightoftheOrgateandfollowingobjectsareremoved.Changethevalue
tolowandcheckthatthewaitobjectgetshighafter5seconds.Checktheprogrambysettingand
resettingtheotherDvvaluesaswell.
Tip
IfyouchangethemodetoSimulate(Mode/Simulateintheplctracemenu)youcan
toggletheDvvaluesbyclickingwithCtrl+Shift+LeftDoubleClickonthefunction
objects.

ProcessGraphics
Wewillnowdrawagraphwithsomepushbuttonsandindicators,andconnectthemtoourDv
objects.

EntereditmodeintheConfiguratorfortherootvolumeVolGettingstarted(Ctrl+E)and
createaXttGraphobjectinthenodehierarchyundertheOpPlaceobjectNodes
GettingstartedOp.YouwillfindXttGraphinthepaletteunderNode/Operator.Select
XttGraphinthepaletteandmiddleclickontheleafoftheOpobjecttocreateitasachildto
thisobject.OpenthenewXttGraphobject(selecttheobjectandpressthearrowrightkey)
andsetthenametoTestGraph.

FigXttGraphobject
Tip
NotethattheActionattributesissettotestgraph.pwg.Thisisthenameofthegraph
fileinthecatalog$pwrp_pop.

Tobeabletoopenthegraphfromtheoperatorwindow,alinktotheXttGraphobjectshould
beinsertedintotheFastAvailarrayoftheOpobject.Theeasiestwaytodothisistoselect
theTestGraphobject,thenrightclickontheOpobjectandactivateConnectFastAvail>
Row1>Column1.

Save(Ctrl+S)andleaveeditmode(Ctrl+E).

RightclickontheTestGraphobjectandactivateOpenGeinthepopupmenu.Thiswillopen
thegraphicaleditor.Thegraphicaleditorcontainsaworkingareaandapaletteand
navigationwindowtotheright.

CreatethreepushbuttonstotogglethevaluesofDv1,Dv2andDv3.OpenthePushbutton
mapinthepaletteandselectButtonToggleCenter.Middleclickintheworkingareaand
createthreepushbuttons.Doubleclickonapushbuttontoopentheattributeeditorforthe
pushbutton.SettheTextattributetoDv1,Dv2andDv3forthebuttons.

NotetheToggleDig.Attributeattribute,thisiswherewewillinsertthenameoftheDvlater.

CreatealsothreeindicatorstoshowthevaluesofDv1,Dv2andDv3.OpentheIndicator
mapinthepaletteandselectIndRound.Createthreeindicatorsbesidethepushbuttonsby
middleclickingintheworkingarea.

CreatealargeindicatorforDv4byselectingIndRoundLargeinthepaletteand
middleclickingintheworkingarea.

NowitstimetoconnectthepushbuttonsandindicatorsthetheDvobjects.Activate
View/ViewPlantithemenutoreplacethepalettewiththeplanthierarchy.OpentheH1
mapandselectDv1.SelecttheDv1pushbuttonalsoandactivateFunction/Connect(Ctrl+Q)
inthemenu.ConnectalsothesmallindicatortoDv1,andthecorrespondingpushbuttons
andindicatorstoDv2andDv3.FinallyconnectthelargeindicatortoDv4.

Tip
YoucanalsoconnectbyselectingtheDvintheplanthierachyandclickwith
Ctrl+LeftDoubleClickonthepushbuttonorindicator.

Weshouldalsosetthebordersofthegraph.ActivateFile/GraphAttributesinthemenuto
opentheattributesforthegraph.Measurewhatyouwanttobetheupperleftcornerorthe
graphbyplacingthecursorthereandreadthecoordinatesinthelowerrightcornerofthe
editor.Insertthecoordinatesinx0andy0.Measurethelowerrightcornerandinsertthese
coordinatesinx1andy1.

SavethegraphandcloseGe.

BuildthenodefromtheVolGettingstartedConfigurator(Functions/BuildNodeinthemenu
).

Opentheruntimemonitor.Stopruntimeandstartitagain.

ActivateFile/StartOperatorEnvironmentintheruntimemonitormenu.

SelectNodesGettingstartedOpoperatorplace.Theoperatorwindowisnowopenedwith
theTestGraphbuttontotheright.

ClickontheTestGraphbuttontoopenthegraph.

Clickonthepushbuttonsandcheckthattheindicatorsareresponding.
Tip
AnotherwaytoopenagraphistostartXttfromaterminalwindow
>rt_xtt
OpenthecommandlineinxttwithCtrl+Bandenterthecommand
xtt>opengraphtestgraph
Tip
AXttGraphobjectisnotnecessarytoopenagraph.OpenGefromtheConfigurator
menu,editandsavethegraph.Thencopythegraphfilefromthecatalog$pwrp_pop
to$pwrp_exe
>cp$pwrp_pop/testgraph.pwg$pwrp_exe
Startxttandopenthegraphasdescribedinthetipabove.

Finallystoptheruntimebypressingthe'StopRuntime'buttonintheRuntimeMonitor.
Tip
Ifruntimedoesn'tstop,usethe'ResetRuntime'buttonwhichisaharderwaytostoptheruntime.
AlsousetheResetRuntimeafterafailedstartattemptbeforetryingagain.

Analogprogramming
Inthissectionwewilladdsomeanalogobjectstoourplcandgraph.
OpentheconfiguratorfortherootvolumeVolGettingStartedagain,andentereditmode(Ctrl+E).

Selectananalogvalueobject,Av,inthepalette(Plant/Signals/Av)andcreatefourAvobjectinthe
mapH1,andnamethemAv1,Av2,Av3andAv4.

LeaveeditmodeandopentheplcprogramH1Plc,andentereditmode(Ctrl+E).Openthemap
AnaloginthepaletteandcreateanAddobjectandaMinobject.ConnecttheoutputoftheAddto
thefirstinputoftheMinobject.ConnecttheAvobjectsAv1,Av2andAv3totheinputsandAv4
totheoutputinaccordancewiththefigurebelow.TheconnectingtotheAvobjectisdonethesame
wayaswedidpreviouslywiththeDvobjects.

Saveandclosetheplceditor.OpenGefromtheXttGraphobject(NodesGettingStartedOp
TestGraph).
CreatethreeslidersforthethreeinputAvobjects,Av1,Av2andAv3.OpenthemapSlidersinthe
paletteandselectSliderBackground1.Theslidersaredividedinabackgroundandasliderpart.
CreatethreeSliderBackground1objectsandthenplacethreeSlider1objectsonthem.Theoutput
Avobject,Av4wewillshowasatrend.CreateatrendobjectfromAnalog/Trendinthepalette.
Resizethetrendobjectbyselectingit,clickonscale,theupperleftpushbuttoninthetoolpanel,and

dragwiththeleftmousebuttononthetrendobject.Createalsofourvaluefieldsfrom
Value/ValueMediumtoviewthevalueswithfigures.Addatextforeachvaluefieldbyclickingthe
textbuttonmarkedwithan'A'andleftclickonthespotyouwanttoplacethetext.Enterthetextin
theinputfield.SetthetextsizewiththeTextSizeoptionmenu.
Connectthegraphicobjectbyviewingtheplanthierarchy(Ctrl+P).SelectAv1andCtrl+left
doubleclickontheslidertotheleft.Youhavetoclickonthesliderobject,nottheslider
background.Connectalsothevaluefield.Inthevaluefield,theformathastobeset.Openthe
objectbydoubleclickingonit,andsettheValue.Formatto'%5.2f'.Thisiscsyntaxandmeansthat
itisafloatvalue,thatwillbeshownwithfivecharactersandtwodecimals.Continuetoconnectthe
secondsliderandinputfieldtoAv2,andthethirdtoAv3.Finallyconnectthefourthvaluefieldand
thetrendobjecttoAv4.Don'tforgettosettheformattoallthevaluefields.

OpenthegraphattributesfromFile/GraphAttributesinthemenuandadjustthegraphsizeinx0,y0
andx1,y1.
Save,exitGeandbuildthenodefromtheconfigurator.
RestarttheruntimeenvironmentfromtheRuntimeMonitor,orfromaterminalwindow.
OpentheRuntimeNavigatorandopenPlcTraceforourplcprogram(rightclickonthePlcPgm
objectinthenavigator,andactivateOpenPlc).
Youareabletoseethevalueoftheanalogobjectsbypressingthemiddlebuttononananalog
outputpinandreleasingitinanemptyspace.Ananalyzenodeconnectedtotheoutputpinisnow
created,viewingthevalueoftheoutput.WecreateanalyzenodeforthethreeAvobjectstotheleft,
andfortheAddandMinobject.Tobeginwith,allthevaluesarezero.Tochangethevaluesofthe
Avobjects,weopentheobjectgraphforthem,byrightclickingonthemandactivatingOpen
Graph.Tochangethevalue,wecaneitherinsertavalueintheActualValuefield,orwecanpress
theSliderbuttonandusetheslidertotheright.

FigPlcTrace
Wealsowanttoknowhowourgraphworks,soweopenthegraph(forexamplebyfindingthe
XttGraphobjectNodesGettingstartedOpTestGraphobject,andactivatingGraphinthepopup
menu).TheAv1,Av2andAv3valuescanbechangedwiththesliders,andthevalueofAv4is
displayedinthecurve.

FigProcessGraphwithanalogvalues

Alarmsandevent
Alarmsandeventsaresentwithsupervisionobjects.Therearetwotypesofsupervisionobjects,
DSupthatsupervisesadigitalsignal,andASupthatsupervisesananalogsignal.Theycanbe
configuredintheplanthierarchyorinaplcprogram.InthisexamplewewilladdaDSupandan
ASuptoourplcprogram.
OpentheplceditorforourPlcPgm,H1Plc,andentereditmode.
OpentheLogicmapinthepaletteandcreateaDSupobject.ConnecttheinputoftheDSuptothe
outputoftheAndobject.

OpentheobjecteditorfortheDSup,andinsertthealarmtextintotheDetectTextattribute.

FigObjecteditorforDSup
AlsosettheattributeEventPrioritytoB.

CreatealsoanASupobject,thisisfoundundertheAnalogmapinthepalette,andconnectittothe
addobject

OpentheObjecteditorfortheASupobject,andinsertthealarmtextintotheDetectTextattributes,
andthealarmlimit,50,intotheCtrlLimitattribute.

Saveandclosetheplceditor.
WealsohavetospecifythatouroperatorareinterestedinthealarmfromtheH1hierarchy.Thisis
doneintheOpPlaceobjectfortheoperatorplace.Weentereditmodeintheconfigurator,openthe
OpPlaceobject,NodesGettingstartedOp,andinsertH1intotheattributeEventSelectList[0].The
EventSelectListisanarraywherewecanenterseveralhierarchiesfromwhichalarmsshouldbe
displayed.(InV4.6.1andpriorversions,theselectlistisplacedinaUserobjectbelowtheOpPlace
object).
Openthemessagehandlerobjectinthenodehierarchy,NodesGettingstartedMessageHandler,and
settheattributeEventLogSizeto5000.Thiswillcreateandatabasewhereeventsandalarmsare
stored.

Save,leaveeditmodeandbuildthenode.
Toseehowitworksinruntime,weopentheRuntimeMonitorandstoptheruntimeenvironment
andthenstartitagain.
ThenopentheoperatorplacebyactivatingFile/StartOperatorEnvironmentinthemenuand
choosingNodesGettingstartedOp.
SetthevaluesofH1Dv1andH1Dv2to1totriggertheDSupalarm,andsetthevalueofH1Av1
to60totriggertheAsupalarm.Thealarmareviewedintheleftpartoftheoperatorwindow,theB
alarmyellowandtheAalarmred.Abeepindicatesthatthereareunacknowledgedalarmspresent.
Acknowledgethealarmsbypushingthetickbuttonstotheleft.

OpenthealarmlistfromtheAlarmlistbuttonintheoperatorwindow.

Youcanalsoseethealarmsaseventsintheeventlistandsearchforthemintheeventlogdatabase.

MoreProcessGraphics
Nowwewillworkalittlemorewithourprocessgraph.Openthegraphicaleditoragain,byfinding
theXttGraphobjectintheConfiguratorandactivatingOpenGeinthepopupmenu.

Changethecolorandtextofapushbutton
Sofarwehaveonlyusedthedefaultdynamicsofthegraphiccomponents.Weshallnowseehow
addeasycanadddynamicsandwestartwithoneofthepushbuttons,theonethattogglesthevalue
ofDv1.LetssaythatwhenDv1islow,wewantthecolorofthebuttontobeblue,andhavethetext
'SetDv1',andwhenDv1ishigh,thecolorshouldbegreen,andthetext'ResetDv1'.
DoubleclickonthepushbuttonandopentheObjectAttributeseditor.
TochangethecolorofthebuttonwecanusethedynamicDigLowColor.OpenthemapDynType
andsetthecheckboxforDigLowColor.NowtheattributesforDigLowColor,
DigLowColor.AttributeandDigLowColor.Color,areaddedtotheattributelist.
DigLowColor.Attributeisthevaluethatshouldchangethecolor,whichshouldbeDv1,andto
insertDv1weactivateView/ViewPlantithemenutoreplacethepalettewiththeplanthierarchy.

OpentheH1mapandselectDv1.DoubleclickontheDigLowColor.AttributelineandDv1should
beinserted.

Tip
AnotherwayistousetherecallbufferoftheinputfieldintheObjectAttributeeditor.AsDv1is
alreadypresentinToggleDig.Attributeyoucanselectthisrow,presstheArrowRightkeytoopen
theinputfield,andthenpressEnterwithoutchangingthevalue.NowDv1isnowstoredinthe
recallbuffer,sobyselectingtheDigLowColor.Attributerow,pressingArrowRighttoopenthe
inputfield,andthenArrowUpwhichwillfetchthevaluefromtherecallbuffer,andfinallyEnter,
Dv1isinserted.
Thecolorshallswitchbetweenblueandgreen,andwesettheDigLowColor.Colorto
BlueMedium3.Toidentifythiscoloryouhavetolookinthecolorpalette.Thebluerowisdivided
intothreesections,andthisitthethirdcolorinthemiddlesection.
Tip
Toinsertacolorintoacolorattribute,youcanselectthecolorinthecolorpalette,and
Ctrl/DoubleclickonthecolorattributerowintheObjectAttributeseditor.
Thehighcolorshouldbegreen,andthisisthecolorwesetintheeditor.Selectthebutton,andclick
onasuitablegreencolorinthecolorpalette.

TosetatextweusethedynamicsDigText.OpenthemapDynTypeinObjectAttributesand
activatethecheckboxforDigText.NowtheattributesforDigText,DigText.Attributeand
DigText.LowText,areviewed.TheattributetochangethetextisagainDv1,soinsertDv1in

DigText.Attributeinthesamewayasbefore.Alsoinsertthethetexttheshouldbeviewedwhen
Dv1islow,'SetDv1',inDigText.LowText.Thehightext,'ResetDv1',isinsertedintotheText
attribute.

ClosetheObjectAttributeEditor.Andsavethegraph.
Tip
TocheckouttheresultyoucanactivateView/PreviewintheGemenu.Notethatthepreviewcan
onlybeusedwhentheruntimeenvironmentisstarted.
Theresultshouldbeasinthefigurebelow.

Buildagraphiccomponent
Letsnowseehowwecanbuildagraphiccomponentfromscratch,forexampleaflashingindicator.

Tocontinuetoedit,youfirsthavetostopthepreview(View/PreviewStop),ifthisisstarted.
Wearegoingtodrawtworectangles,oneframeandonefortheindicatorlamp.Whenwemakea
groupofthewecansettheflashdynamic,whichweconnecttoDv1.
Todrawtheframerectangle,pushtherectanglebuttoninthetoolbaranddragsomewhereinthe
workingarea.

Arectangleiscreated.

Tosetafillcolor,selecttherectangleandactivatethefillcolorbuttoninthetoolbar.

Setagraycolorfromthesecondrowinthecolorpalette,byselectingtherectangleandclickonthe
desiredcolorinthecolorpalette.

Setareliefshadowonontherectanglebyselectingitandpushthe3Dbuttoninthetoolbar.

DoubleclickontherectangleandopentheObjectAttributeseditor.Adjustthewithoftheshadow
withthe'shadow_width'property,andset'fixcolor'to1,becausethisframerectangleshouldnotbe
affectedbythecolorflashing.

SetagradientontherectanglebyselectingitandchoosingGradientHorizontalTube2inthetoolbar.

Now,wecreateanotherrectangle,alittlebitsmaller,ontopofthefirstrectangle.Thistime,weset
adarkergraycolor,butwedon'tsetthe'fixed_color'property,andno3Dproperty.

Nextstepistomakeagroupofthetworectangles.Selectthemboth,andpushthegroupbuttonin
thetoolbar

Whenwedoubleclickonthegroup,andopentheObjectAttributeseditor,wecansetdynamicson
thegroup.OpentheDynTypemapandsettheDigFlashcheckbox.NowtheattributesforDigFlash
areviewed.InsertDv1intoDigFlash.Attribute,andsetthetwoflashingcolorsinDigFlash.Color
andDigFlash.Color2,forexampleRedHigh6andGrayFix9.

SavethegraphandstartPreview.WhenDv1isset,theindicatorshouldstartflashingbetweenred
anddarkgray.

Writeahelptext
Inthissectionwewillwriteahelptextfortheuseroftheproject.Thehelptextsareeditedinthe
file$pwrp_cnf/xtt_help.dat(V4.6.1andpriorversions$pwrp_exe/xtt_help.dat).
Atemplatefileiscreatedatprojectcreation.Openthefilewithyoufavoriteeditor,e.g.gedit.
Thefileisdividedintopicsbythetopictag,andthemaintopicfortheprojectistheindextopic.
Thefirstrowinatopicisaheader(intheindextopicitisblank).
Nowweaddanewtopic'testgraph'forourprocessgraphtestgraphandcreatealinkintheindex
topic.Bytakingasnapshotwecreateanimageofthetestgraphwhichweviewinthetextwiththe
<image>tag.Theimagefile'testgraph.png'iscopiedto$pwrp_exe.

<topic>index

<image>pwr_logga.gif
<h1>Welcometogettingstarted
<h2>Description
ThisaprojectfollowingtheGettingStartedGuideinProview.
<h2>Processgraphics
TestgraphAtestgraph<link>testgraph
</topic>
<topic>testgraph
ProcessgraphTestgraph
PushonthethreepushbuttonstosetDv1,Dv2andDv3.
ActivatetheslidertosetvaluestoAv1,Av2andAv3.
<image>testgraph.png
<b>FigTheTestgraphgraph
</topic>
<include>$pwr_lang/profibus_xtthelp.dat
<include>$pwr_lang/opc_xtthelp.dat
<include>$pwr_lang/basecomponent_xtthelp.dat
<include>$pwr_lang/othermanufacturer_xtthelp.dat
<include>$pwr_lang/abb_xtthelp.dat
<include>$pwr_lang/siemens_xtthelp.dat
<include>$pwr_lang/remote_xtthelp.dat
<include>$pwr_lang/nmps_xtthelp.dat
<include>$pwr_lang/ssabox_xtthelp.dat

Nowbuildthenode,orcopythefileto$pwrp_exe,andyoushouldbeabletoopenthetextfrom
Help/Projectinrt_xttortheconfiguratormenu.Itcanalsobeopenedfromthehelpbuttoninthe
operatorwindow.

Inthetestgraphprocessgraphwewillnowcreateabuttonthatopensthehelptextforthegraph.
OpentheGeeditorfortestgraph,andinsertaninfobuttonfromButton/ButtonInfointhepalette.

OpentheObjectAttributeseditorbydoubleclickingontheinfobutton,andinsert'testgraph'in
Help.Topic.Whenthebuttonispressed,thehelptextforthetopic'testgraph'willbedisplayed.

Openthegraphinrt_xtt(thisfunctionwillnotworkinPreview),andpresstheinfobutton.

Appendix
Glossary
ProjectList

Alistofallprojects.Projectsareorderedinatreestructureenddefined
withProjectRegobjects.ProjectscanbeopenedfromtheProjectsListand
thisisalsowherenewprojectsarecreated.

GlobalVolumeList

Alistofallvolumesinallprojects.Allvolumeshastoberegisteredinthis
list.

Volume

Acontainerforobjects.Thereareanumberofdifferenttypesofvolumes.A
rootvolume,forexample,isloadedintoaprocessoroperatorstationat
startupandcontainsallobjectneededtoconfigurethestation.

DirectoryVolume

Everyprojectscontainsonedirectoryvolume,thatconfiguresthenodesand
volumesintheproject.

RootVolume

TherootvolumeisloadedintoaprocessoroperatorstationatProview
startup.Itusuallycontainsalltheconfigurationobjectsforthisnode.

Object

Anobjectcontainsadataareadividedinattributes.Theattributesstoredata
configuredintheConfigurator,ordatacalculatedinruntime.Anobjectcan
alsohavemethods,objectgraphsetc.Everyobjectisspecifiedbyaclass,
wheretheattributes,methods,plccodeetc.aredefined.Objectsareplaced
inanobjecttree,whereobjectscanhaveparents,siblingsandchildren.

Plcprogram

Acontrolprogrambuiltbylogicalandanalogfunctionblocks.

Configurator

Atooltonavigateintheobjecttreeandtoconfigurethe.

UserDataBase

AdatabasewhereProviewusersaredefinedwithusername,passwordand
privileges.ContainsbydefaultthesystemgroupCommonwithuserspwrp
andb55.Aprojectslinktoasystemgroupandgettheusersforthisgroup.

Project

Anumberofprocesstations,operatorstationsandstoragestationsare
gatheredintaproject.Itcontainsadirectorytreewithdatabasesand
configurationfilesforthenodesandvolumesthatbelongstotheproject.

sdf

Ashellcommandtosetuptheenvironmentforaproject(setdefaultproject)
>sdf'projectname'

Planthierarchy

Configurestheplantwithobjectsforsignals,sensorsandcomponents.Also
PlcPgm'scontainingplccodeisconfiguredintheplanthierarchy.

Nodehierarchy

Configuresthehardware,IOsystem,andsystemprocessesofthenode.

EditfunctionsintheConfigurator
Function
SelectObject
CreateObject

DeleteObject
MoveObject

Action
Mouse

LeftClick

Key

ArrowUpandDown

Menu

Edit/CreateObject/After(Ctrl+D) Selectanobjectclassinthe
Edit/CreateObject/FirstChild
palettefirst,thenselectthe
(Shift+Ctrl+D)
destinationobject(parentor
sibling),andthenactivate
CreateObjectinthemenu.

Mouse

MiddleClick

Clickontheicon(maporleaf
)createstheobjectaschildto
theclickedobject.Clickon
thetextcreatestheobjectas
sibling.

Menu

Edit/DeleteObject(Deletekey)

Deletestheselectedobjects.

PopupMenu DeleteObject

Selecttheobjectfirst.

PopupMenu

MoveSelectedObject

Selecttheobjectyouwantto
movetheobjecttofirst.

Mouse

MiddleClick

Selecttheobjectyouwantto
move,andmiddleclickonthe
destinationobject.Clickon
theicontomoveaschild.
Clickonthetexttomoveas
sibling.

ShowChildren Mouse

Openobject

Change
attributevalue

Comment

LeftClickonmapicon.

Key

ArrowRight.

Notethatarrowrightkeyalso
showstheattributesofthe
objectisnochildrenare
present.

Key

Shift+ArrowRight.
ArrowRight(ifnochildren).

Thearrowkeydisplaysthe
attributeinthecurrent
window.

PopupMenu

OpenObject

Openingfromthemenuopens
anewwindow.

Menu

Functions/OpenObject(Ctrl+A)

Key

ArrowRight.

Menu
Functions/ChangeValue(Ctrl+Q)
Table1EditfunctionsinConfigurator

Enterthevalueintotheinput
fieldandpressenter.

EditfunctionsinthePlcEditor
Function
SelectObject
CreateObject

DeleteObject

Action

Comment

Mouse

LeftClick

Key

Shift+ArrowKeys

Mouse

LeftClick

Selectanobjectclassinthe
palettewiththemouse.A
functionobjectisnowmoved
withthecursor.Placeitwitha
LeftClick.

MiddleClick

Ifaclassalreadyisselected,
orisselectedbytheArrow
UpandDownkeys,
Middleclickintheworkarea
tocreateanobject.

Menu

Edit/CreateObject(Alt+D)

Menu

Edit/Delete(Deletekey)

Deletestheselectedobjects.

PopupMenu Delete

MoveObject

Create
Connection

Openobject

Connect

Mouse

MiddleDoubleClick

Hitonanobjectdeletesthe
object.Hitinenemptyspace
deletesallselectedobjects.

Mouse

LeftDrag

Ifseveralobjectsareselected,
andaselectedobjectsis
dragged,allselectedobjects
willbemoved.

Key

Shift+Control+Arrowkeys

Mouse

MiddleDrag

Dragbetweentwopins.
Iftheconnectionisdragged
fromonepinandreleasedin
anemptyspace,apredefined
objectiscreated(normallya
GetorStoobject).

Key

Ctrl+D

Selectaconnectionpointwith
Ctrl+Arrowkeys,lockthis
withShift+Ctrl+D,andselect
asecondconnectionpoint
withCtrl+Arrowkeys.

PopupMenu

ObjectEditor

Openingfromthemenuopens
anewwindow.

Menu

Functions/OpenObject(Ctrl+A)

Mouse

Ctrl+LeftDoubleClick

Menu

Edit/Connect(Ctrl+Q)

SelectanobjectinthePlant
hierarchy.

Open
Subwindow

PopupMenu

Connect

Mouse

Shift+LeftDoubleClick

Menu

Functions/OpenSubwindow

PopupMenu SubWindow
Table2EditfunctionsinthePlcEditor

Das könnte Ihnen auch gefallen