Pr ogr amm mmabl eMa Macr oLanguage( Basi c) 1. 1.TTRRAAI I NNI I NNGGGGUUI I DDEEwww. av ev a. co m AVEVAPl ant( 12Ser i es ) Pr ogr amm mmabl eMa Macr oLanguage( Basi c)TM1401 2. 2.AVEVAPl ant( 12Ser i es)Pr ogr amm mmabl eMa Macr oLanguage-TM14012www. avev a. com 3. 3.AVEVAPl ant( 12Ser i es)Pr ogr amm mmabl eMa Macr oLanguage-TM14013www. avev a. com Re v i s i onLo gDa t eRe v i s i o nDe s cr i p t i onofRe v i s i onAu t h orRe v i e we dAp pr o v ed16 / 0 1/ 2 00 9 0. 1I ssuedf orRevi ewBT26/ 01/ 20090. 2Revi ewedBTEW 29/ 01/ 20091. 0Appr ovedf or T r a i n i n g1 2. 0 . SP3BTEW RPUp da t e sAl l h ea di n gsc on t a i ni n gup da t edorne w ma t e r i a lwi l l behi ghl i ght e d.Sugges t i on/Pr o bl emsI fy ouh av eas ug ges t i onabo utt hi sma ma nua lort he s y s t e mt owhi c hi tr ef er spl eas er epor ti tt ot heAVEVAGr oupSol ut i on sCe nt r eat g s c @a @a v e v a . c o m Th i sma ma nu al p r o v i d esdo c ume nt a t i o nr e l a t i n gt op r o du c t st owh i c hy o uma y no tha v ea cc es sorwhi c hma yno tbel i c ens edt oyo u.Forf ur t heri nf o r mat i ononwh i c h pr oduc t sar el i c ens edt oy oupl eas er ef ert oy ourl i c enc ec ondi t i ons .Vi s i tourwebs i t eat ht t p: / / www. av ev a. c om Di s cl ai merI nf or mat i onofat ec hni c al nat ur e,andpar t i c ul ar soft he pr oduc tandi t sus e,i sgi v enbyAVEVASol ut i onsLt dandi t ssubs i di ar i eswi t houtwar r ant y . AVEVASol ut i onsLt d.andi t ssubs i di ar i esdi s cl ai m an yandal l war r ant i esandc ondi t i ons , e xpr es sedori mpl i ed,t ot hef ul l es te xt entper mi t t edb yl aw.Nei t hert heaut hornorAVEVA Sol ut i onsLt doranyofi t ssubs i di ar i esshal l bel i abl et oanyper s onorent i t yf oranyac t i ons , c l ai ms ,l os sordamagear i s i ngf r om t heus eorpos ses si onofan yi nf or mat i on,par t i c ul ar sor er r or si nt hi spubl i c at i on,oran yi nc or r ec tus eoft hepr oduc t ,what s oe ver .T r ademar k sAVEVA andT r i bonar er egi s t er edt r ademar k sofAVEVASol ut i onsLt dori t ss ubs i di ar i es . Una ut hor i s edus eoft heAVEVAo rT r i bont r adema r k si ss t r i c t l yf or bi dden.AVEVAp r oduc t na mesar me et r adema r k sorr egi s t er edt r ad emar k sofAVEVASol ut i on sLt dori t ssu bs i d i ar i e s, r egi s t er edi nt h eUK,Eur opea ndo t herc ount r i es( wor l dwi d e) .Thec op yr i ght ,t r a demar k r i ght sorot heri nt el l ec t ual pr oper t yr i ght si nanyot herpr oduc t ,i t snameorl ogobel ongst oi t s r es pe ct i v eo wner . 4. 4.AVEVAPl ant( 12Ser i es)Pr ogr amm mmabl eMa Macr oLanguage-TM14014www. avev a. com Copy r i ghtCopy r i ghtandal l ot heri nt el l ec t ual pr oper t yr i ght si nt hi sma manual andt he as soc i at eds of t war e,ande ver ypar tofi t( i nc l udi ngs our c ec ode,obj ec tc ode,an ydat a c ont a i ne di ni t ,t hema manu al andan yot herdo cume nt at i onsuppl i edwi t hi t )bel ongst oAVEVA Sol ut i onsLt d.ori t ss ubs i di ar i es .Al l ot herr i ght sar er es er v edt oAVEVASol ut i onsLt dandi t s s ubs i di ar i es .Thei nf or mat i onc ont ai nedi nt hi sdoc umenti sc ommer c i al l ys ens i t i v e,ands hal l notbec opi ed,r epr oduc ed,s t or edi nar et r i ev al s ys t em,ort r ans mi mi t t edwi t houtt hepr i or wr i t t enpe r mi s s i ono fAVEVASol ut i onsLi mi t ed.Whe r es uc hpe r mi s s i o ni sgr an t ed,i t ex pr es sl yr equi r est hatt hi sDi s cl ai merandCopy r i ghtnot i c ei spr omi nent l ydi s pl ay edatt he b eg i n ni n go fe v e r yc op yt h ati sma ma de .Th ema nu al a ndas s o c i a t e dd oc u me me nt a t i o nma yno tb e adapt ed,r epr oduc ed,orc opi edi nan ymat er i al orel ec t r oni cf or m wi t houtt hepr i orwr i t t en pe r mi s s i o no fAVEVASo l u t i o nsLt d .Th eu s erma ya l s ono tr e v er s ee ng i ne er ,d ec ompi l e , c op yoradaptt heas soc i at eds of t war e.Nei t hert hewhol enorpar toft hepr oduc tdes cr i bedi n t hi spubl i c at i onma ybei nc or por at edi nt oan yt hi r dpar t ys of t war e,pr oduc t ,mac hi neor
s y s t e m wi t houtt h epr i o rwr i t t e nper mi s s i ono fAVEVASo l ut i onsLi mi t edors av ea sper mi t t ed byl aw.Anys uc hunaut hor i s edac t i oni ss t r i c t l ypr ohi bi t edandmaygi v er i s et oc i v i l l i abi l i t i es an dc r i mi nal pr o sec ut i on.TheAVEVApr oduc t sdes c r i b edi nt hi sgui dear et obei ns t al l eda nd oper at eds t r i c t l yi nac cor danc ewi t ht het er msandcondi t i onsoft her e spec t i v el i c enc e ag r e eme nt s ,a ndi na c co r d an cewi t ht h er e l e v an tUs erDo c ume nt a t i o n.Una ut ho r i s edo r unl i c ens edus eoft hepr oduc ti sst r i c t l ypr ohi bi t ed.Pr i nt edb yAVEVASol ut i onson28 J a nu ar y2 00 9©AVEVASo l u t i o nsa ndi t ss u bs i d i a r i e s20 01–2 00 7AVEVASo l u t i o nsL t d , Hi ghCr oss,Madi ngl eyRoad,Camb mbr i dge,CB30HB,Uni t edKi ngdom. m. 5. 5.5Cont ent swww. avev a. com 1 I nt r oduc t i on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91. 1 Ai m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91. 2 Obj e c t i v es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91. 3 Pr er equi s i t es. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91. 4Cour s e St r uc t ur e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1. 5Us i ngt hi s gui d e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 PML ML Ov er vi e w. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112. 1PMLPr ogr amm mmabl eMa Macr o Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112. 2PML2-AMor e Power f ul Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112. 3PML2 J ar gon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 2. 4Fe at ur esof PML2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Macr osand Sy nony ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 3 . 1As i mp l e Mac r o. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133. 2 TheOUTPUT Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133. 3 Communi c at i ngwi t hAVEVAPr oduc t si nPML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 . 4Pa r a me me t e r i s ed Mac r os . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143. 5 Sy nony ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143. 6Rec ur s i v e Sy nony ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153. 7 Del et i ng Sy nony ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 Ex e r c i s e1-TheCe nt r eo fa
Handwheel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Var i abl e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174. 1Number edVar i abl e t y pes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174. 2Named Var i abl et y pes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4 . 2 . 1Se t t i n gn amed v ar i a bl es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174. 3PML2 Var i abl et y pes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 4. 3. 1Cr eat i ng Var i abl e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184. 3. 2 Ex pandi ngVar i a bl es. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 . 3. 3 Ex pr es s i ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 . 3 . 4Ex pr e s si o n oper at or s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194. 3. 5 Oper at o rPr ec edenc e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194. 3. 6PML2 ex pr es s i o ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204. 3. 7 Us i ngVar i abl esI nEx pr es s i ons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 . 3. 8 Ar r ay s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 . 3 . 9Co nc at e na t i o n Oper at o r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20Ex er ci s e2Thev ar i abl eCent r eofaHandwheel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215PML Cont r ol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235. 1DO l o op. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 35 . 1 . 1DO l o op swi t h BREAK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235. 1. 2DO l o opswi t hSKI P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 5. 1. 3DO I ndexandDO Val ues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245. 1 . 4DO Loops Ex ampl es. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245. 2I F St at ement s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 55. 2. 1Si mpl eI F c ons t r uc t .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255. 2. 2 I F ,THEN,ELSEI FandELSESt a t ement s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 55 . 3 Br anc hi ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255. 4Condi t i onal J umpi n g. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 Ex er c i s e3-TheFul l
Handwheel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266 Bo ol e anEx p r e s s i o nsa ndI F St at e ment s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276. 1Si mpl e Bool eanEx pr es s i ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6. 2Con v er t i ngav al uet o BOOLEAN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .276. 3Val i d Bool eanex pr es s i ons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 6. 4I n val i dBool ean ex pr es s i ons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286. 5 Bool eanex pr e s s i onsPML1upwar dc ompat i bi l i t y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287Er r o r s&Er r o r Handl i ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .297. 1 Exampl eof Er r or s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297. 2 Er r or Handl i ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 7. 3Al er t Obj e c t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297. 3. 1Al er tObj ec t swi t hnor e t ur n v al u e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 6. 6.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM14016www. avev a. com 7. 4Al er tObj ec t st hatr et ur n v al ue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307. 4. 1Confi r m Al er t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .307. 4. 2 Ques t i onAl er t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307. 4. 3I nput Al e r t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 Ex e r c i s e4–Er r or Handl i ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .318 PML1 Hi e r ar chy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338. 1Modi fi c at i onst o PDMSUI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .339PML2 Func t i onsandObj ec t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359. 1Th ep ml l i ben v i r o nme nt v ar i abl e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359. 2Modi fi c at i onst o pml l i b. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359. 3 Updat i ngPDMSUIand PMLLI B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369. 4PML2 Obj e c t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 9. 5PML2 Met hods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 9. 6Met hod
Conc at e nat i on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 9 . 7Th e! ! CE Obj e c t. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 9. 8PML2 Func t i ons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Ex e r c i s e5 ( a )–Co nv e r tt h eHo ser e el ma c r oi n t oa f unc t i on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Ex er c i s e5( b)–Addi ngar gument st o t hef unc t i on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4010 For ms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4110. 1For msAr eGl obal Obj e c t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4110. 2 Dy nami cl oadi ngofObj ec t s ,For msandFunc t i ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4110. 3For m Defi ni t i on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 10. 3. 1Us i ngt he. net f r amewor k. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4210. 3. 2 Showi ngandhi di ngFor ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4210. 3. 3Bui l t i nmet hodsf or For ms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4310. 4 Cal l bac k s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4310. 5For m Gadget s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 10 . 5 . 1Bu i l t i nme mb er san dme t ho dsf or Gadget s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4410. 5 . 2Gadget pos i t i oni ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 1 0. 5 . 3Do c k i n ga ndAn c ho r i n g Gadget s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 610. 6Par agr aph Gadget s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4710. 7 Bu t t on Gadget s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 1 0 . 7 . 1 Li nk l a bel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4810. 8Te x tEnt r y Gadget s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4810. 9 For mat Obj e c t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 10. 10Li s t Gadget s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 10. 11Fr ame Gadget s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 1 0. 1 1. 1Fo l dUpPa ne l Fr ames. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5310. 12 Tex t paneGadget s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 31 0. 1 3Op t i o n Gadget s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 1 0. 1 4T o gg l e Gadget s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 10. 15Radi o Gadget s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 10. 16For m Member Var i a bl es. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5610. 17 Tool t i p s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 61 0. 1 8Pr o gr e ss Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 Ex er c i s e6( a)-Cal c ul at i on met hods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Ex er ci s e6( b) -Loops. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Ex er c i s e6( c )– Conc at enat i on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 Ex er c i s e6( d)–St r i ng mani p ul at i on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 Ex er c i s e7–St or i ngandr es et t i ng def aul t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6210. 19Open Cal l bac k s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 Exer ci se8–Tabset sandOpen Cal l bac k s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6410. 20Bar Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 10. 20. 1Defini ngaMenu Obj ec t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6511PML Obj e c t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6711. 1Bui l ti nPMLOBJECT T y pes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6711. 2For msand MenusObj ec t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6811. 3 3DGeomet r y Obj e c t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6811. 4 Met hodsAv ai l abl et oAl l Obj ec t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6911. 5TheFi l e Obj e c t. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 11 . 5 . 1Us i ngfi l e obj e c t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 7. 7.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM14017www. avev a. com 11. 5. 2UseNot epadt oopen fi l e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Ex er ci s e9– Menubar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7112User Defined Obj e c t s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7313
Col l ec t i o ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7513. 1TheCol l ec t i onSy nt ax( PML 1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 513. 2TheObj ec t Col l ec t i onSy nt ax( PML2). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 Exer ci se10–Equi pment Col l ec t i ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7614PopUp Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 Ex e r c i s e11 ( a )–Po pu p menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78Ex er ci s e 11( b)–Equi pment Chec k i ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 9Ex er ci s e 11 ( c )–Se t t i n gEq ui p me nt at t r i but e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8015Vi ew Gadget s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 11 5. 1Al p ha Vi e ws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 15 . 2Pl o tVi e w Ex ampl e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 15. 3Vol umeVi ew ex ampl e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 Ex e r c i s e12 ( a )–Ad di n gaVo l u me Vi ew. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83Ex er ci s e12( b)– Addi ngaCl i pboxt ot hev i ew. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 Ex e r c i s e12 ( c )–Dy na mi c a l l ymo di f ya c l i pbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85Ex er c i s e12( d)–Add Noz z l et aggi ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 Ex e r c i s e12 ( e )–Ad d Hi ghl i g ht i ng. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8716 Ev e ntDr i v e nGr a ph i c s ( EDG). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8916. 1Si mpl e EDG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 1 6. 2Us i n g EDG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Ex e r c i s e13–Us i n g EDG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 Ex e r c i s e13 ( a )–Ad dEDG t o! ! ex 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 1Ex er ci s e13( b) –AddEDG t o! ! e x 11b. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 Ex e r c i s e13 ( c )–Ad dEDG t o! ! ex 12b. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9317 Mi s c el l aneous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9517. 1Rec ur s i v ePml 2 Func t i ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9517. 2Undo
andRedo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 17 . 2 . 1Mar k i ngt he dat abas e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9517. 2. 2 UndoandRedoDat a bas eCommands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9517. 3Er r or t r ac i n g. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 18Men u Addi t i o ns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9718 . 1Mi s c el l a ne ou s Not es. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9718. 2 Modul est hatus et henewAddi nsf u nc t i onal i t y. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9718. 3Addi nga Menu/ T ool bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9718. 4 Appl i c at i on Des i gn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9718. 5 For m andTool bar Cont r ol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9818. 6 Conv er t i ngEx i s t i ng Appl i c at i ons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 818. 6 . 1DBAR andAddi nObj ec t. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 18. 6. 2BarMenuand Tool bar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9918. 6. 3 Defi net ool bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991 8. 6 . 4Ad di n gt o Menus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9918. 6. 5 Addi ngnewmenust of o r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 01 8. 7Ex a mpl eobj e c ti n c l u di n gt o ol ba r s ,b arme nu sa nd menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 01Ex er c i s e14–AddaUt i l i t yandTool bar menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10319Upgr adi ngf r o m PML1 t oPML2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10519. 1Poi nt st o wat c houtf or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 Appendi xA–PDMS Pr i mi t i v es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 Appendi xB–Exampl e c ode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 Appendi xB1-Exampl e ex 1. mac. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Appendi x B2-Ex ampl eex 2. mac. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Appendi xB3-Exampl e ex 3. mac. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113Appendi x B4-Ex ampl eex 4. mac. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114Appendi xB5-Exampl e ex 5a. pml f n c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115Appendi x
B6-Ex ampl eex 5b. pml f n c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116Appendi xB7-Exampl e ex 6a. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118Appendi x B8-Ex ampl eex 6b. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119Appendi xB9-Exampl e ex 6c . pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121Appendi x B10-Ex ampl eex 6d. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 8. 8.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM14018www. avev a. com Appendi xB11-Exampl e ex 7. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127Appendi x B12-Ex ampl eex 8. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Appendi xB13-Exampl e ex 9. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135Appendi x B14-Ex ampl eex 10. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139Appendi xB15-Exampl e ex 11a. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140Appendi x B16-Ex ampl eex 11b. p ml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141Appendi xB17-Exampl e ex 11c . p ml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143Appendi x B18-Ex ampl eex 12a. p ml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146Appendi xB19-Exampl e ex 12b. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150Appendi x B20-Ex ampl eex 12c . p ml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154Appendi xB21-Exampl e ex 12d. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159Appendi x B22-Ex ampl eex 12e. p ml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165Appendi xB23-Exampl e ex 13a. pml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172Appendi x B24-Ex ampl eex 13b. p ml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174Appendi xB25-Exampl e ex 13c . p ml f r m. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177Appendi x B26-Ex ampl eex 14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 9. 9.9www. aveva. com CHAPTER11I nt r oduct i onThi smanual i sdesi gnedt ogi vean i n t r o du ct i o nt ot h eAVEVAPl an tPr o gr a mmi n gMa c r oLa ngu ag e,Th er ei snoi n t e nt i o nt o t e ac hs o f t wa r ep r o gr a mmi n gb utj u s th owt h ec u s t o mi s a t i o nu s i n gPMLc a nb ed on ei n AVEVAPl a nt .Ap pe nd i xBc o nt a i n sex a mp l ec o det h ata ns we r se ac he x e r c i s e .Th ee x e r c i s e s ha vebeendel i ber at el ywr i t t ent obeopent oi nt er pr et at i on.Thi smeanst hatt hec odey ou pr o du c ema y bed i ff er e nt .1 . 1Ai m Th ef o l l o wi n gp oi n t sne edt ob eu nd er s t o odb yt h et r a i n ee s: Under st andhow PMLcanbeusedt ocust omi seVant agePl antDesi gn( PDMS)Under st and ho wt oc r eat eFunc t i ons ,For msan dOb j ec t s .Und er s t an dho wt ous et hebui l t i nf eat ur e sof Va nt a gePl a ntDe s i g n( PDMS)Un de r s t a ndt h eu s eo fAd di n st oc u s t o mi s et h ee nv i r o nme nt .
1. 2Obj e ct i v esAtt h eendoft h i st r ai ni ng,y ouwi l l h av ea:Br oado v er v i e wo fPr og r ammabl e Ma c r oLa ng ua geBa s i cc o di n gp r a c t i c e san dc o nv e nt i o nsHo wPMLc a ni n t e r a c twi t ht h e Desi gnmodel HowFor msandMenuscanbedefinedwi t hPML1. 3Pr er equi si t esThe par t i ci pant smusthavecompl et edanAVEVABasi cDesi gnCour seandhavesomebasi c pr ogr emmi nk nowl edge.1. 4Cour s eSt r uc t ur eT r ai ni ngwi l l c ons i s tofor al andv i s ual pr es ent at i ons ,demons t r at i onsands ete xer c i s es .Eac hwor k s t at i onwi l l ha veat r ai ni ng pr oj ec t ,popul at edwi t hmodel obj ec t s .Thi swi l l beus edbyt het r ai neest opr ac t i c et hei r met hods ,andc ompl et et hes ete x er c i s es .1. 5Us i ngt hi sgui deCer t ai nt e xts t y l esar eus edt o i n di c at es pec i a ls i t u at i onst hr oug hou tt hi sdo cument ,he r ei sas ummar y ;Menupu l l do wn s andbut t onpr es sac t i onsar ei ndi c at edb ybol ddar kt ur quoi s et e xt .I nf or mat i ont heus erhas t oKe yi n' wi l l ber edandBOLD' Annot at i onf ort r ai neesbenefi t :Addi t i onal i nf or mat i onRef er t oo t he rdoc ument a t i onSy s t em pr omp t ss houl db ebol dan di t al i ci ni n v er t edc ommasi . e. ' Choos ef unc t i on' Ex ampl efi l esori nput swi l l bei nt hec our i ernewf ont ,c ol our sands t y l es u s edasb ef o r e . 10.10.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140110www. avev a. com 11.11.11www. av ev a. co m CHAPTER22PMLOv er vi ewMac r osAmac r oi sagr oupofPDMS commandswr i t t ent oafil ePMLPr ogr ammabl eMacr oLanguage( t wopar t s)PML1Fi r st v er s i onofPMLi nc l udi ngl oops ,I Fs t at ement s ,s t r i nghandl i ng,l abel set c .PML2Obj ec t or i ent at edl anguagebui l dsonPML1ande xt endst hef ac i l i t i est obel i k eot herobj ec tbas ed l a ngu ag es( C++,Smal l t a l k )Fo r msMo s ta pp l i c at i o nsa r edr i v e nb yf o r msa ndme nu s.Mo s t PMLwi l l bebasedonaf or m.2. 1PMLPr ogr ammabl eMacr oLanguageMacr osar eASCI I fil escont ai ni ngPDMScommandsi nsequence.Byaski ngPDMSt or unamacr o,youar e r e al l ya sk i n gPDMSt or u nas er i e so fc o mman dsi nas e to r d er( a sde fin edi nt h ema cr ofil e ) Pr o gr a mma bl ema c r o sa r ema c r o st h atc o nt a i np r o gr a mc o ns t r u c t ss uc ha sI Fs t a t e me nt s , DO l oopsandvar i abl esMacr osar er uni nPDMSbyt ypi ng$m/ FI LENAMEont ot he c omma ndl i n e( Di s p l a y >Comman dL i n e) .An ye x t r ai n f o r ma t i o na dd edt oama cr ol i nei s t r e at e da si n pu tp ar a me t e r sa ndar epa s s edt ot h ema c r o .i . e .$ M/ BUI L DBOX1 0020 03 00 Thi smea nst h att h ee x t r a3v a l u esaf t e rt h ema cr on amear et r e at e da sp ar ame t e r s1,2a nd 3.Whenent er edi nt h i swa y ,t hes ep ar ame t er sar et hena v ai l ab l ef o ru s ei nt hema cr o i nst eadoffix edval ues.2. 2PML2-AMor ePower f ulLanguagePML2i sanenhancedver si on o fPMLandi smo r el i k eot h ermo de r nl a ng ua ge st h aty o uma ybef a mi l i a rwi t h .PML 2i s al mos tanobj ec tor i ent edl anguage.I tpr o vi desmos tf eat ur esofot herObj ec tOr i ent at ed Pr ogr ammi ng( OOP)l anguagesex c eptf ori nher i t anc e.I tpr o vi desf orc l as s esofbui l t i n, s y s t e md efi nedan du s er d efi ne do bj e ctt y pe s.Ob j e ct sha v eme mb er s( t h ei ro wnv ar i a bl e s) andme t hods( t hei ro wnf unc t i ons ) .Al l PMLv ar i abl esar eani ns t anc eofabui l t i n,s y st emde fi ne do ru s er de fi ne do bj e c tt y pe.T y pi c a l l y , f e we rl i ne so fc od en ee de dwi t hPML 2wh en c ompar edt ot r ad i t i onal PML( PML1)an di thasbeende si gn edt obee as i ert or ead/ wr i t e . Wh i l emo s tPML 1ma c r o swi l l s t i l l r u nwi t h i nPDMS,PML 2b r i n gma nyne wf e at u r e st h at wer epr e vi ous l yuna vai l abl e.Bui l ti nmet hodsf ordi ffer entv ar i abl et y pesr emo ves ev er al mul t i l i nepr oc edur esus edi nol ds t y l emac r os .Us eof$c har ac t er si sdr amat i c al l yr educ edwi t ha mor er eadabl ef or matf ore xpr es si ons$s t y l emac r oswi l l s t i l l wor kpr o vi dedt hes y nt axhas beenf ol l owedc or r ec t l y .I ti spos si bl et oc onv er tt r adi t i onal PMLc odet oi nc l udenewerPML2 f eat ur es ,buti ti si mpor t antt hatus er smai nt ai nc ompat i bi l i t yatal l t i mes .Manynewf eat ur es
h av ebe enad de dt oi mp r o v es pe edan de as eofu s e.Th es ef e at u r e swi l l b ed i s c u s s edan d de mon st r at edt hr ought hi sc our s e. 12.12.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140112www. avev a. com 2 . 3PML2J a r g on2 . 4Fe at u r e so fPML 2Th ema i nf e at u r e so fPML 2a r e :•Av a i l a bl eVa r i a bl e Types-STRI NG,REAL,BOOLEAN,ARRAY•Bui l ti nMet hodsf orcommonl yusedact i ons• Gl o ba lF un c t i o nss u pe r s e deol ds t y l ema c r o s•Us e rDe fi ne dOb j e c tT y p es•PMLSe ar c h Pa t h( PML LI B)•Dy n ami cLo ad i n go fFo r ms ,Fu nc t i o nsan dOb j e ct s•Ai do bj e ct sf or g eo me t r i cmo de l l i n gPMLi sno wmo r ec o ns i s t e ntwi t ho t h erp r o gr a mmi n gl a ng ua ge san d mor est r uct ur edi nf or m.Thenew dat at ypesar enowOBJECTSwhi chcanbeoper at edby r unni ngMETHODS.Theol d$ba sedv a r i a bl esar est i l l v al i d,bu tar eal wa y st r eat edas s t r i ngs .Gl oba lf unc t i onsa r emac r oswhi c hc anbec al l edmor el i k es ubr o ut i ne st ha n t r adi t i onal mac r os .e. g.af unc t i oncanbec al l edbet weent hebr ac k et sofanI Fs t at ementand r e t u r naBOOL EANr e sul tUs er d efi ne do bj e ctt y pe sen ab l eag r o upofmi x e dv a r i a bl e st obe c omb i ne di n t opa c ka ge s .Th er e su l t i n go bj e ctc ant h enb eu se da sas i mpl ev a r i a bl ea ndt he s epar at epar t ss etorus edasat t r i but esoft hev ar i abl e.e. g.! f r ed. pos i t i on! f r ed. nameSear c h pa t h sa ndd yn ami cl o ad i n gme ant h ati ti snol o ng ern ec es s ar yt op r el o adf o r msorh av e s y no ny msf o rc al l i n gma cr o s.Al ar g en umbe ro fn ewa i dob j e ct sha v eb ee nc r e at e ds ot h at us er sc andomor egr aphi c al c ons t r u ct i on. 13.13.13www. av ev a. co m CHAPTER33Mac r osandSynony msAmac r oi sagr oupof PDMS c omma nd swr i t t e nt oafi l e( i ns e que nc e)t ha tc a nb er u nt o ge t h er .Th i sr e mo v est hen ee df o r us ert ohav et oent ere ver yl i neofc odes epar at el y .Thi smeanst hatr epet i t i v epr oc es sescan ber unasamacr o.3. 1Asi mpl eMacr oBel owi sanexampl eofamacr ot opr oduceaBOX an dCYL I NDERa ndc o nn ec tt ot wot o ge t h er ,a l l wi t h i na nEQUI .T y pet h ef o l l o wi n gi n t oa sui t abl et extedi t orandsavei tasc: pml t r ai ni ngSi mpl eMac. macNEW EQUI P/ ABCDNEW BOXXLEN30 0YLEN400ZLEN600NEW CYLDI A400HEI600CONNP1TO P2OF PREVYouhavecr eat edyourfir stmacr o.Tor unt hemacr oi nt oPDMS,t ype$M/ont ot he c ommandfi l e,f o l l o wedb yt hef ul l fi l epat hoft hes av edmac r o .e. g . $M/ c : p ml t r a i n i n gSi mpl e Ma c. ma cWh enr un ni n gt h i sma c r oi n ,en s ur et h eCu r r en tEl e me nt ( CE)i saZONEo rb el o w Al t e r n at i v e l yt hema c r oca nb er u nb yDr a gg i n gan dDr o pp i n gi t ont ot heCommandWi ndow.3. 2TheOUTPUTCommandWhi l edevel opi ngamacr ot her e ar et womai nmet hodswi t hi nPDMSt ofindt hei nf or mat i oni tneeds:OUTPUTcommandDB l i s t i ngut i l i t yBot hpr ov i det hei nf or mat i onneeded,s ot hec hoi c eonwhi c hwi l l beper s onal .An e x amp l eo fu si n gt heOUTPUTc o mma ndi sasf ol l o ws :T y pefi l e/ c : p ml t r ai n i n ga a. t x to nt ot h e c ommandl i ne,t henpr es sent er( t y pi ngfi l e/ c : pml t r ai ni ngaa. t x tov erorFFi l e/ c : pml t r ai ni ngaa. t x ti sal s oac cept abl e) .PDMSwi l l opent hes pec i fi edfi l er eadyt owr i t et o.I ft he fi l edoesnotex i s t ,t hi spr oc es swi l l c r eat ei t .Choos et her equi r eel ementofi nt er es tand en sur ei ti st heCE.Af t eri ti sc hos en,t y peOUTPUTCEont ot heco mmandl i ne.Thi swi l l p r i n tt h ei n f o r ma t i o nPDMSh asab ou tt h eCEt ot h efi l e .L as ts t e p,t y peTERM o nt ot h e c ommandl i ne.Thi swi l l c l os et hef or m,al l o wi ngi tt obeopenedb yano t h erpr ogr am.Th i sfil e wi l l hol dt hei nf or mat i on( e. g.at t r i but es )PDMSneedst odefi net heel ement s .T r yt he OUTPUTcommandont heequi pmentcr eat edbySi mpl eMac. mac.Not i cet headdi t i onal i n f o r ma t i o nPDMSs a v esab ou tt h ee l e me nt s( i n f o r ma t i o nno ts p ec i fi edi nt h ema cr o ) .
14.14.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140114www. avev a. com 3. 3Communi cat i ngwi t hAVEVAPr oduct si nPMLAl l commandsneedt obesuppl i edt ot he c o mma ndpr o c es s o ra sSTRI NGS.Th i si si mp or t a ntwh enwo r k i n gwi t hel e me ntc r e at i o n ( us i ngt heNEW s y nt ax )T oe xpandt h ec ont ent sofaPMLv a r i a bl ei nt oast r i n g-pu ta$i n f r o nto fi t !! Co mp T y pe=| EL BO|! d i s t=5 60 0NEW $ ! Co mp T y peDI ST$ ! d i s t3 . 4 Pa r a me t e r i s e dMa c r o sMa c r o sc a nb ep ar a me t e r i s e d.Th i sme an si n s t e ado fh ar dc o di n gt h e v al uest hr ought hema cr o,t hev al uesc anb er ef er enc ed,al l o wi ngt hem t obev a r i e d. Si mpl emac. macc anbepar amet er i sedasf ol l ows: NEW EQUI P/ $1NEW BOXXLEN$2 YLEN $3ZLEN$4NEW CYLDI A$3HEI$4CONNP1TOP2OFPREVSav et heMac r oa s c : p ml t r a i n i n gPa r a me t er Ma c . ma cT or u nt h i sMa c r o ,p ar a me t e r sne edt ob epa s se dt oi t .Th i s ap pe nd i n gt h ep ar a me t erv a l ue st ot h ema cr o :e . g .$ M/ c : p ml t r a i ni n gPa r a me t e r Ma c. ma c ABCDE300400600I fnop ar ame t er sar es pec i fi ed,t hema cr owi l l f a i l .T oa v oi dt h i s ,d ef aul t v a l ue sc anb epu ti n s i d et h ema c r o.Th i si sdo neb ys pe c i fi ed$ d1 =a tt h et o po ft h ema cr o . Forexampl e:$d1=ABCDEF$d2=300$d3=400$d4=600Def aul tval ueswi l l onl ybeusedi f n op ar a me t e r sa r es pe c i fi e d.Ma c r o sma yha v eupt o9p ar a me t e r ss e pa r a t e db ys pa c e.I n t h eb el o we x a mp l e ,ABC,DEF&GHKa r es ee na ss ep ar a t es t r i n gsa ndt h er e f o r edi ff er e nt p ar a me t e r s :e . g .$ M/ c : p ml t r a i n i n gNi n ePa r a . ma cABCDEFGHK5 56 67 78 89 90 0I fat e x t s t r i ngi sr equi r edasas i ngl epar amet er ,i tc anbeent er edb ypl ac i nga$
a f t e rt h es t r i n g.e . g .$ M/ c : p ml t r a i n i n gSe v en Pa r a . ma c$ 5 5667 78 89 900 $<$>ac tasdel i mi t er sandan yt hi ngi nbet weeni si nt er pr et edasas i ngl epar ame t er .3. 5 Sy n on y msSy n on y msa r eab br e v i a t i o nso fl o ng erc o mma nd s .Th eya r ec r e at e db ya s s i g ni n g t hecommandt oasy nony mv ar i abl e:e. g.$SNewBox =NEW BOXXLEN100YLEN200 ZLEN300Asynonym canal sobepar amet er i sed: 15.15.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140115www. avev a. com e. g.$SNewBox=NEW BOXXLEN$S1YLEN$S2ZLEN$S3Toc al l t hefir st ver si on,t ype NewBox.Fort hesecondver si on,t ypeNewBox1002003003. 6Recur si veSynonymsI ti s po ss i bl ef oras y non ym t oc al l i t s el f ,e ffe ct i v el yl oo pi n gt hr ou ght hes amec omman d.The f o l l o wi n ge x a mp l es ho wsh owt h eXL ENa t t r i b ut eofagr o upofb ox e s( o wn edbyt h es a me el ement )canbeupdat ed:e. g.$SXChange=XLEN1000$/NEXT$/XChangeThi smet hod wi l l endwi t haner r orasi tr unsunt i l i tr unsoutofbox est oc hange.$/ac t sasar et ur n c h ar a c t e r3 . 7De l e t i n gSy n on y msT ok i l l as y no ny m,t y p e$ SXXX=&a l l s y n on y ms$ s kTo s wi t c hs y no n ymso ffa ndon$S-a nd$S+I fa l l s y n on y msa r ek i l l e d,t h es y n on y msn ee de dt o r u nPDMSwi l l b er e mo v e d.Th i sme an sPDMSwi l l n ol o ng erwo r kpr o pe r l yan dwi l l r e qu i r e r es t ar t i ng .I fs y no ny msar et ur ne doff ,s omePDMSf un ct i ona l i t ywi l l a l s ober emo v ed.The r et ur nt hi sf unc t i onal i t y ,t hes y non ymsshoul dbet ur nedbac kon. 16.16.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140116www. avev a. com Ex e r c i s e1-TheCe nt r eofaHa nd wh ee lWr i t eama cr ot obu i l dt hec en t r eofaha nd wh ee l ( s hownr i ght )I ts hal l bec ons t r uc t edf r om 4pr i mi t i v es :2bo x es ,ac y l i nderandadi s hCr eat e t hepr i mi t i v eswi t hi naPDMSDe si gnse ss i onus i ngt heav ai l abl eapp wa r e.On cet hi si sdon e, uset heOUTPUTcommandt oseet hei nf or mat i onPDMSneedst ocr eat et hem.Basedon t h eo ut p ut ,u s et h eCONNc o mma ndt oc onn ec tt h ePp oi n t so fp r i mi t i v e st o ge t he ri . e .CONN P1TO P1OFPREVThi swi l l c on ne ctPPo i n t1( P1 )o ft h ec ur r e ntp r i mi t i v et oP1oft h e pr i mi t i v ec r eat edpr ev i ous l y .Thehi er ar c hyc r eat eds houl dl ooks i mi l art ot hef ol l owi ng:The
d i me ns i o nso ft h ep r i mi t i v e sa r e :BOX1-Xl e ng t h=1 00 mm Yl e ng t h=1 00 mm Zl e ng t h= 100mm CYLI-Di amet er=80mm Hei ght=5mm BOX2-Xl engt h=50mm Yl engt h=50mm Zl engt h=15mm DI SH1-Di amet er=50mm Hei ght=15mm Toai dwi t hconnect i ngt he pr i mi t i v es ,r ef ert ot headj ac entdi agr am s howi nganex pl odedver s i onoft heequi pment ,wi t h t h ePPo i n t si d en t i fi ed .Att h ee ndo ft h ema cr oa ddt hef o l l o wi n gl i n e:ADD/ Ha nd Wh ee l AUTO / Ha nd Wh ee lTh i sl i newi l l a ddt hec r e at e deq ui p men tt ot h ed r a wl i s ta nds c al et h e v i e ws oi tc anbes een.Youc oul dal s oaddt hef ol l owi ngl i nebef or ei t .REM ALLThi swi l l c l eart hedr a wl i s tfi r s t ,ens ur i ngt hatonl yt hene w pi ec eofequi pmenti ss eeni nt hemai n3D wi n do w.Sa v et h efi l ea sc : p ml t r ai n i n ge x 1. ma ca ndr u ni to nt h ec omma ndl i n eb yt y p i n g $ m/ c : p ml t r a i n i n ge x 1. ma cAnex a mp l eoft h ec o mp l e t e dma c r oc anbef o un di nAp pe nd i xB 17.17.17www. aveva. com CHAPTER44Var i abl esVar i abl essetusi ngt heVARsynt axar e PML1s t y l ev a r i a bl e sa ndar est or edi nAVEVApr oduc t sass t r i ngs .Ot her wi s e,t he yar e PML 2s t y l ev a r i a bl e s .4 . 1Nu mb er e dVa r i a bl et y p esNu mb er edv a r i a bl e sa r es e tb yt y pi n ga n umb ert h env a l u ea f t e rt h ec o mma ndVAR.Ex a mp l e soft h i sa r ebe l o w:v a r1na mev a r2 ‘ h el l o ’v ar3( 99 )v a r4( 99*3/6+0. 5)v ar117posi ns i t ev a r1 18( nameofo wnerofo wner ) v ar119‘ hel l o’ +‘ wor l d‘ +‘ howar ey ou’ T oobt ai nt hev al ueofv ar i abl e1,ent erqv ar1,qv ar 11 7e t c .Theav ai l a bl ev ar i a bl enumb er sonl ygot o119( t h er ei sno120)andt he yar emodul e de pe nd an t .Fo rt h es er e as on s ,t h i st e ch ni q uei sn ol o ng erc ommo nl yu s ed .4 . 2Na med Va r i a bl et y pe sT og i v eav a r i a bl ean ame ,t h er e qu i r e dn amemu stb epr e ce de dwi t he i t h era s i ngl eordoubl ee xc l amat i onmar k( ! ) ,! v ar i abl enameor! ! v ar i abl enames i ngl e!-al oc al v ar i abl e( c anonl ybes eeni nt hec ur r entmac r o)doubl e! !-agl obal v ar i abl eVar i abl enames ma ybeupt o6 4c h ar a c t e r sl o ngan dt h en ame sc anc on t a i nal p haan dn ume r i cc h ar a c t e r s . Var i abl enamesmu stno ts t ar twi t hanumbe ro rc on t ai na.( f ul l s t op )4 . 2. 1Se t t i ngname d v a r i a bl e sTh ef o l l o wi n ga r es omeex a mp l e sofs e t t i n gv a r i a bl e s :VAR! FREDNAMET a k es t hecur r entel ement ’ s( ce)nameat t r i but eVAR! POSPOSI NWORLD Takesceposi t i on at t r i but er el at i v et owor l dc oor di nat esVAR! x‘ NAME’ Set st hev ar i abl et ot het e xts t r i ng ‘ NAME’ VAR! t e mp( 2 3*1 . 8+3 2)Ca l c ul at eav a l u eu si n gt h ee x pr e ss i o nVAR! l i s tCOL L AL LEL BO FORCEMa k esast r i n ga r r a yofd at a ba ser e f er e nc esQu ot e s‘ ‘ o rv e r t i c al ba r s|| ma ybeu se da st e x tDe l i mi t e r s 18.18.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140118www. avev a. com 4 . 3PML2Va r i a bl et y pe sTh er ea r ef ou rb as i cv a r i a bl et y pe s:STRI NG ‘ a nyal ph an ume r i c c h ar a c t e r s ’ REALa n yn ume r i cv a l u eBOOL EANt r u e/ f a l s et / f( b utn ot0 / 1 )ARRA Ya n y c omb i na t i o no ft h ea bo v eNo t e :PML 1s t y l ev a r i a bl e su s i n gt heVARs y nt a xar eo nl ys t o r e d ass t r i ngs .4. 3. 1Cr ea t i ngVar i abl esTh ef o l l o wi n gar es omee x ampl esofs et t i n gPML2 v a r i a bl e st y p es :! Na me=‘ Fr e d’ T oc r e at eaL OCAL ,STRI NG v a r i a bl e! ! An s we r=4 2T o cr eat eaGLOBAL,REALvar i abl e:! ! Fl ag=TRUETocr eat eaGLOBAL,BOOLEANvar i abl e:! n ewa r r a y=ARRA Y( )T oc r e at eaL OCALemp t yARRA Y! n ewa r r a y [ 1 ]=| x x x |o r! n ewa r r a y [ 1 ] =‘ x x x’ T oaddt ofi r s tv al uet ot heempt yARRAY( l oc al l y )Thet y peofv ar i abl ei saut omat i c al l y i mpl i edbyi t scont ent! ! answer=42becomesaREAL! name=‘ f r ed’ becomesSTRI NG ! flag =TRUEb ec o me sBOOL EANVa r i a bl e sc a nb ei n i t i a l i s e dt oe ns u r eo nl yc or r e c tr e s ul t sc an bes et .Al l v ar i abl et y pescanbes etupt hef ol l owi ngway :! ! number=r eal ( )! ! t ex t=s t r i ng( ) 4 . 3 . 2Ex p an di n gVa r i a bl e sToex p an dv a r i a bl e si nAVEVAp r o du c t so nt h ec o mma ndl i n eu s e
a$ .Wh ent h el i n ei sr e ad ,t h ev a l ue so ft h ev a r i ab l e swi l l b eu se d.VAR! XL EN( 1 00 0)VAR! YLEN( 10 00)VAR ! ZLEN ( 100 0)NEW BOXXLEN$! XLENYLEN$! YLENZLEN $! ZLEN 19.19.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140119www. avev a. com 4. 3. 3Ex pr es s i o nsEx pr es s i o nsar ec al c ul at i onsus i ngPMLva r i abl e s.Thi sc anbedonei sa PML1orPML2st yl e:PML1:VAR! Z(| $! X|+| $! Y|)PML2:! Z=! X+! YI nt hePML1exampl e, ! Zi ss e ta saSTRI NG v a r i ab l e.I nt h ePML 2e x amp l e ,! Zi sr e t ur n edasaREAL ,i f! Xa nd! Y a r eREALSe t t i n gv a r i a bl e sus i n gt h ePML 2me t h odi sn ea t e ra ndmo r er e ad ab l ewh en c omp ar e dt oPML 1.An yv ar i ab l ec anb ef o r c e dt ob eaSTRI NG b yp ut t i n gad ol l a ri nf r o nto f i t .! x=64t hi sr et ur nsaREAL.VAR! y( 64)t hi sr e t ur nsaSTRI NG I F( ! xeq! y ) THENi si nv al i d s y nt axb ec aus et heco mpar i s oni smi x i n gv ar i abl et y pes .I F( $! xe q! y ) THENv al i dbec au se t hedol l ari nf r ontof! xf or c esi tt obeaSTRI NG.4. 3. 4Ex pr es s i onoper at or sTher ear ea nu mbe ro fe xpr e ss i onop er at or swhi c har ea v ai l abl ef orus e.Theac t ual s y nt axwi l l d epend o nwh et h eraPML 1o rPML 2s t y l eha sb ee na do pt e d.Nu me r i co pe r a t o r s :+-/*Co mp ar i s o n oper at or s:L TGTEQ NELEGELogi coper at or s:NOTANDORNumer i cf unct i ons:SI NCOS TAN SQRPOW NEGATEASI NACOSAT ANLOG ALOG ABSI NTNI NTForf ur t he r exampl es,r ef ert oPDMSSof t war eCust omi sat i onRef er enceManual :Someexampl esof e xpr es si onsi nus e:! s=30*s i n( 45)! t=po w( 20, 2)( r ai s e20t ot hepower2( =400) )! f= ( mat ch( nameofowner , | LPX| ) gt0)4. 3. 5Oper at orPr ecedenceWhenPDMSr eadsan e xpr es si on,t her ei sapr ec edenc et hatappl i edt oi t .Thi sshoul dbec ons i der edwhenwr i t i ng one.Theor deri sasf ol l ows:( )*/+-EQ NEGTLTGELENOTANDORe. g.( 60*2/3+5) =45 20.20.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140120www. avev a. com 4 . 3 . 6PML2e x p r e s s i o nsPML2e x pr e s s i o nsma ybeofa n yc o mp l e x i t y ,t h eyma yc on t a i n c a l l st oPMLFu nc t i o nsa ndMe t h od san di n c l u deFo r mg ad ge tv a l u es, o bj e c tme mb er sa nd me t h od s .Fo re x a mp l e :! Ne wVa l=! ! My Fu nc ( ! Ol dVa l )*! ! For m. Gad ge t . Va l/! My Ar r a y . Me t h od ( )4 . 3 . 7Us i n gVa r i a bl e sI nEx p r e ss i o ns$a ndq uo t e sa r en otn ec es s ar y wh enu s i n gt h ev a l ueo fav a r i a bl ei naPML 2e x pr e s si o n:! X=6 4( i n s t ea do fVAR! X( 6 4) )! Y =32! Z=! X+! YThes amee xpr es si onPML1i sst i l l v al i d(VAR! Z( | $! X|+| $! Y| )) ,buti nt hi s c a s e! Zi saSTRI NG v a r i a bl e4 . 3 . 8Ar r a y sAnARRA Yv a r i a bl ec anc on t a i nma nyv a l u es , ea c ho fwh i c hi sc al l e danARRAYEL EMENT .Anar r a yi sc r e at e da ut o mat i c al l yb yc r e at i n g o neo fi t sa r r a yel e me nt so ri tc a nb ei n i t i a l i s e da sa ne mp t yARRA Y.I fa nARRA YEL EMENT i si t s el fanARRAY,t hi swi l l c r e at eaMul t i d i men si onal ARRAY.Fore x ampl eane x ampl eof anar r a y ,t y peoutt hef ol l owi ngont ot hec ommandl i ne:! x [ 1]=| ABCD|! x [ 2]=| DEFG|! y [ 1]=| 1234|! y [ 2]=| 5678|! z [ 1]=! x! z [ 2]=! yT oquer yt hei nf or mat i onabout! z ,t y peqv ar! z .Thi s wi l l r e t u r nt h ef o l l o wi n gi n f o r ma t i o n:[ 1 ]2El e me nt s[ 2 ]2 El emen t sTofi ndoutmo r ei nf o r mat i onab outt heel emen t swi t hi nt heMul t i d i mens i onal ar r a y , t y peqv ar! z [ 1]orqv ar! z [ 2] [ 1]4. 3. 9Conc at enat i onOper at orVal uest obec onc at enat edar e au t omat i c al l yc on v er t edt oSTRI NG b yt he‘ &’ o pe r at o r .T y pet hef o l l o wi ngont ot heco mmand l i n e:! a=64! b=3 2! m =‘ mm’ ! c=! a&! b&! m qv ar! cCompa r et hi sagai ns tt her es ul t sof t y pi ng! d=! a+! bqv ar! d 21.21.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140121www. avev a. com Ex e r c i s e2-Thev a r i a bl eCe nt r eofaHa nd wh eel Wr i t eap ar a me t e r i s edma cr ot ob ui l dt he c ent r eofahandwheel .e x1 . ma cwi l l bet heba si sf ort hene w mac r o.Al s o,ad dt woex t r a
pr i mi t i v est or epr es entanar m( ac yl i nder )andpar toft hewheel ( ac i r c ul art or us ) . Us et he $ d1 =XXXs y n t a xt or e pl a c et h ev a l u esu s edi nex 1 . ma cwi t hpa r a me t e r s$ d1s ho ul dbeus e d f o rt h en ameoft h ee qu i p me nta ndt h er es ts h ou l dbes e ta st h er e qu i r edd i me ns i o nsGi v e BOX1an ames ot hati tc anber ef er r edt o.Thi swi l l beus ef u lwhenpos i t i oni ngt h ene w c y l i nd erandc i r c ul a rt or us .As$1i sas t r i ng,auni quena mec anb ec r eat edb yus i ngt he v ar i ab l ewi t hs omeaddi t i onal c har a ct er se. g ./ $1 XXXThene wc y l i n ders hal l ha v eahe i ght of500mm an ds hou l dn oto v er l apt heor i gi nal BOX1.Bo t ht hec y l i n derandc i r c ul art or u ss hal l ha veadi amet erof50mm.Thec ent r el i neoft hec i r c ul art or usshal l i nt er c eptt heendoft he ne wc y l i n de r .TheCONNme t h odf r om e x er c i s e1c ans t i l l beu s ed ,bu ti n s t e ado fu s i ng PREV ,wec a nr e f e r e nc eo t h ern ame de l e me nt s .Th i n kab ou tt h ea v a i l a bl ePPo i n t swh en pos i t i oni ngt henewpr i mi t i v es( Ref ert oAppendi xA)Thehi er ar c hyc r eat edshoul dl ook s i mi l art ot hef ol l owi ng:Sa vet hefil easc : pml t r ai ni nge x2. macandr uni tont hec ommandl i ne b yt y pi ng$m/ c : p ml t r a i ni n ge x 2. ma cAne x amp l eoft h ec omp l e t e dma cr oc anbef o un di n Ap pe nd i xBT r yr u nn i n gt h ema c r oag ai nwi t had i ff er en te qu i p me ntn amev a r i a bl et oc he cki t wor ks 22.22.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140122www. avev a. com 23.23.23www. av ev a. com CHAPTER55PMLCont r ol 5. 1DO l oopADO l oopi sawayof l o opi n gwi t h i nt h ePMLma cr oa l l o wi n gp i e ce so fc o det ob er u nmo r et h ano nc e.Th i si s us ef u lasi tal l o wsc odet ober eu sedandr educ est hel engt hofc od e.Asanex ampl e,t y pe o utt h ef o l l o wi n ga nds a v ei tac : p ml t r a i n i n gDo Lo op . ma c :DO ! l o op Co un t e rFROM 1T O1 0! v a l ue=! l oo pCo un t e r*2qv a r! l o op Co un t e r! v a l u eENDDO I ft h ea bo v ee x ampl ei sr u ni n t o PDMS,v al ue so f! l oopCo unt erand! v al uewi t hbep r i nt edt ot hec ommandl i nef ort hef u l l r a ngeo ft h ed efi ne dl o op .Th es t epo ft hel o opc a nb ea l t e r e db ya dd i ngBYt ot hel o op defini t i on:eg:DO ! l oopCount erFROM 1TO 10BY25. 1. 1DO l oopswi t hBREAKI fyouneed al oopt or ununt i l ac er t ai nc ondi t i oni sr eac hed,aBREAKc ommandwi l l e x i tt hec ur r ent l o op:T y peoutt hef ol l o wi ngex ampl ean ds av ei tac: pml t r ai ni ngDoBr ea k. ma c:! n=0DO ! n =! n+1! v al ue=POW( ! n,2)qvar! val ueBREAKI F( ! val ueGT1000)ENDDO TheBREAK c ommandc anal s obecal l edf r om wi t hi nanor mal I Fc ons t r uc t .Thi si st y pi c al l ydonei f mu l t i p l ebr e akc on di t i o nsne edt obeco ns i d er e d.e . g .I F( ! v a l u eGT10 00 )BREAKENDI F Thel oopi nt hee xampl ewi l l r ununt i l t heBREAKc ondi t i oni sme t .I ft hec ondi t i oni snev er r eac hed ,t hent h ec odewi l l r uni nde fini t e l y !ADO l oopof1t o10 00 00c ou l dbeu sedi ns t ead, asi th asanend.AnopenDO l oopt hatne v ermee t st hebr ea kc ondi t i o nwi l l r u ni ndefi ni t el y 24.24.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140124www. avev a. com 5 . 1 . 2DO l o op swi t hSKI PI ti spo ss i b l et os k i ppa r t oft h eDO l o opus i n gt h eSKI Pc o mman d. Thi sc ou l db eu s ef u li fpa r t sofanu mb ers e qu en cen ee dst ob emi s s ed :T y peo utt h e f o l l o wi n ge x a mp l ean ds a v ei tac : p ml t r a i n i n gDo Sk i p . ma c :DO ! nFROM 1TO 2 5SKI PI F( ! n LE5)OR( ! nGT15)qvar! nENDDO TheSKI Pcommandcanal sobecal l edwi t hi nanor mal I Fcons t r uct( ast heBREAKcommand)5. 1. 3DO I ndexandDO Val uesDO I ndexandDO Val uesar ewa ysofl oopi ngt hr oughar r a ys .Thi si saneff ec t i v emet hodf orc ont r ol l i ngt he v al uesus edf ort hel oops .T ypi c al l yv al uesar ecol l ec t edi nt oanARRAYv ar i abl et henl ooped t hr oughusi ngt hef ol l owi ng:DO ! XVALUES! ARRAY! Xt akeseachARRAYel ementENDDO DO ! XI NDEX! ARRAY! Xt ak esan umberf r om 1t o! ARRAYsi zeENDDO 5. 1. 4DO Loops Ex a mp l e sT y p eo utt h ef o l l o wi n ga sa ne x a mp l eo fl o op i n gt h r o ug ha nARRA Yo fv a l u es .
Savet hef ol l owi ngasc: pml t r ai ni ngDoAr r ay . mac.VAR! ZonesCOLLALLZONESFORSI TE VAR ! NamesEVALNAMEFORALLFROM ! Zon esqv ar! NamesDO ! xVALUES! Namesq va r! xENDDO DO ! xI NDEX! Namesqv ar! Names[ ! x] ENDDO Theexampl eusest heCOLL s ynt axasamet hodofdefi ni nganar r a y .Thi ss ynt axwi l l bee xpl ai nedl at eri nt hemanual .I t s ho wsh owt h et wome t h od sca ne x t r a ctt h es a mei nf or ma t i o nf r o mt h es o ur c ear r a y . 25.25.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140125www. avev a. com 5. 2I FSt at ement sAnI Fs t at emen ti sac on st r uc tf ort hec ond i t i on al e x ec ut i onofc ommands . Thec ommand swi l l onl yber uni ft h ec on di t i on so ft heI Fs t at emen ta r eme t .5. 2. 1Si mpl eI F c ons t r u ct .As i mpl eex ampl eofanI Fc ons t r uc ti ss ho wnbel o w.Th ec od ewi t hi nt heI F c ons t r u cti sonl yr uni ft hee xpr es s i o ni sTRUE.Ane x ampl ei sasf ol l o ws :I F(! Numbe rL T0) THEN! Negat i ve=TRUEENDI F5. 2. 2I F,THEN,ELSEI FandELSESt at ement sAnI F c ons t r uc tc anbeex t endedbyaddi ngaddi t i onal c ondi t i ons .Thi si sdoneb yaddi ngei t her EL SEI Fo rEL SEt oi t .Wh enanI Fc ons t r u cti senc ount er ed,PMLwi l l e v al uat ei t sco ndi t i on.I f t hec on di t i oni sFAL SE,PDMSwi l l l ookt ot hene xtEL SEI Fc on di t i o n.On ceacondi t i oni s f oundt obeTRUE,t hatc odewi l l ber unt hatpr opor t i onal oft hec odeandt heI Fc ons t r uc ti s c ompl et e.I fanEL SEc ondi t i oni sadded,t hi spor t i onofc odewi l l onl yber uni ft heot her c ondi t i on sar ene v erme t .Thi si sawa yofens ur i ngso mecodei sal wa y sr un.T y peoutt he f o l l o wi n ge x ampl e ,an ds av ei ta sc : pml t r a i ni ngNu mChec k . ma c.Runi twi t honer e al par amet er .I F( $1EQ 0)THEN$pYourval uei szer oELSEI F( $1LT0)THEN$pYourval ue i sl esst hanzer oELSE$pYourval uei sGr eat ert hanzer oENDI FTheELSEI FandELSE c o mma nd sar eop t i o na l ,b utt h er ec anon l yb eo neEL SEc o mma ndi nanI Fc o ns t r u c t .5 . 3 Br a nc h i n gPMLpr o v i d esawa yofj u mp i n gf r o mo nep ar to fama c r ot oa no t h eru s i n g GOLABEL.LABEL/ FREDMaxl engt h16char act er s,excl udi ng( / ). . .SomePMLcode. . . GOL ABEL/ FREDTh en ex tl i n et obee x ec u t e dwi l l b et h el i n ef o l l o wi n gL ABEL/ FRED, whi chcoul dbebef or eoraf t ert heGOLABELcommand.Theuseoft hi smet hodshoul dbe l i mi t ed .I tc anma k ec od eha r dt or e adan dd eb ug . 26.26.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140126www. avev a. com 5. 4Condi t i onal J umpi ngT y peoutt h ef ol l o wi ngasane x ampl eofc ondi t i ona lj umpi ng .Sa v ei t a sc : p ml t r a i n i n gCo nd i t i o na l . ma c .DO ! A$ PPr o c es s i n g$ ! ADO ! BT O1 0! C=! A*! B GOLABEL/ fini shedi f( ! CGT100)$PPr oduct $! CENDDO ENDDO LABEL/ fini shed$P Fi ni s hedwi t hpr oc es s i ng=$! APr o duc t=$! CI ft heex pr es s i on! CGT1 00i sTRUEt her ewi l l beaj umpt ol a be l/ fi ni s he da ndPMLe x ec u t i o nwi l l c o nt i nu ewi t ht h e$ Pc omma nd .I ft h e e x pr e s s i o ni sF AL SE,PMLe x e c ut i o nwi l l c o nt i n uewi t ht h ec o mma nd :$ PPr o du c t$ ! Ca ndg o ba c kt hr o ug ht h eDO l o op.Ex e r c i s e3-Th eFu l l Ha nd wh ee lI n t r o du cev ar i a bl e san d c al c u l a t i o nst or ed uc et h en umb ero fp ar a me t e r sn ee de dt obu i l daha nd wh ee l .Us eex 2. ma c a sab as i sf o rt h en ewma c r oan du s eal o opt oc omp l e t et h eo ut e rwh ee l .Cr e at et woSUBE el emen t s .Onewi l l c ont a i nt hepr i mi t i v est hatmak eupt hec ent r eoft hehan dwheel a ndt he o t h ert h ea r mo ft h eh an dwh ee l .Us eal o opt oc op yt h ea r m SUBEe l e me ntt oc omp l e t et h e o ut e rwh ee l .Wh enb ui l d i n gt h el o op ,c o ns i d erh owma n yc o pi e sa r en ee de d.Wh enc r e at i n g ac op y ,c r e at et h ee l e me nta su su al bu tap pe ndCOPY/ XXXXt ot hel i n e.Th i swi l l c r e at ea new el ement ,butcopyi tf r om / XXXXe. g.NEW BOXCOPY/ XXXXAseachar m wi l l needt o ber ot at ed90°f r om t hepr evi ous,t heROTATEcommandcanbeusede. g.ROTATEBYAAA ABOUTBBBwh er eAAAi st h ea ngl eofr o t a t i o nan dBBBadi r e c t i o nt or o t a t ear o un di . e .U.
Thi n kab ou th owt h el o opc anbeus edt oc ha ng et h ea ng l eofr o t at i o na ndt h en ameoft h e c opi edel ement s .Thehi er ar c hycr eat eds houl dl ooks i mi l art ot hef ol l o wi ngSa vet hefi l eas c : p ml t r a i n i n ge x 3. ma ca ndr u ni to nt hec o mma ndl i neb yt y pi n g$m c : p ml t r a i n i ng ex 3. ma cAn e x a mp l eoft h ec o mp l e t e dma c r oc anbef o un di nAp pe nd i xB 27.27.27www. avev a. com CHAPTER66Bool eanExpr essi onsandI FSt at ement s6. 1Si mpl e Bo ol e anEx p r e s s i o nsEx p r e s s i o nsb as e do nt h eo pe r a t o r ss u c ha sEQ ( e qu al t o )a ndGT ( gr eat ert han )gi v eaBOOLEANr es ul twhi c hc anbeus eddi r ec t l yi nanI Fc ons t r uc t .An e x ampl ei sasf ol l o ws .T y peou tt hee x ampl eands av ei tasc : pml t r ai n i ng Bool ean. mac .Runi t a sas i n gl epa r a me t erma c r o .! v a l u e=i n t ( $1 )I F(! v a l u eNE1)THEN! T es t=F AL SEEL SEI F (! v a l u e. e q( 1 ))THEN! T es t=TRUEENDI Fqv ar! T e s tTh ee x pr e s s i o nc a nb eas i mp l e v a r i ab l ep r o v i d edi ti saBOOL EANt y pev a r i a bl e :! Su c ce ss=! Va l u eGT0I F(! Su c ce s s) THENTh ee x pr e s s i o nc o ul dbeau s er d efi n edPMLf u nc t i o no rme t h odt h atr e t u r n sa BOOLEANr esul t :I F(! ! MyFunct i on( ))THEN6. 2Conver t i ngaval uet oBOOLEANTher ei sa bu i l t i nPMLme t h odandaf u nc t i o nf o rc on v er t i ngav a l u et oBOOL EAN:! My St r i n g=| TRUE| I F(! My St r i ng. Bool ean( ))THEN. . .TheBoo l eancon v er s i oni sasf ol l o ws :REALze r o becomesFALSEAl l ot herposi t i veandnegat i veREALval uesbecomeTRUESTRI NG ‘ F AL SE,‘ F’ ,‘ NO’ a nd‘ N’ be c omeF AL SESTRI NG ‘ f a l s e,‘ f ’ ,‘ no ’a nd‘ n ’b ec omeF AL SE STRI NG ‘ TRUE’ ,‘ T’ ,‘ YES’ AND‘ Y’ b ec omeTRUESTRI NG ‘ t r u e’ ,‘ t ’ ,‘ y e s ’a nd‘ y ’b ec o me TRUE6. 3Val i dBool eanexpr ess i onsBOOLEANcons t ant sar eTRUE,FALSE,YESandNO andt hei rs i ngl el e t t erabbr ev i at i onsnotenc l os edi nquot esr et ur nBool eanr es ul t sands oc an b eu s edd i r e c t l yi ne x p r e s s i o ns .Fo re x a mp l e :i f(TRUE)a ndi f(F AL SE)BOOL EANOKi f (T)andi f(F)BOOLEANOKi f(YES)andi f(NO )BOOLEANOKi f(Y)andi f(N) BOOLEANOK 28.28.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140128www. avev a. com 6 . 4I n v al i dBo ol e anex pr e ss i o nsTh ef o l l o wi n gd on otr e t u r nBOOL EANv a l u esa ndar e t her ef or ei nv al i d:i f(1)andi f(0)REALi nv al i di f(| TRUE|)andi f(| FALSE|)STRI NG i nv al i di f(| T|)andi f(| F|)STRI NG i nv al i di f( $Var i abl e)wher eVar i abl e=1REALi nv al i d6. 5 Bo ol e ane x pr e ss i o nsPML 1up wa r dc omp at i bi l i t yFo rup wa r dc omp at i b i l i t ywi t hPML 1, STRI NG v ar i abl essett o‘ TRUE’ ,‘ FALSE’ ,‘ YES’ or‘ NO’ ort hei rs i ngl e-l et t erabbr ev i at i ons c anb eus edi nani ft e sta sl ongast he yar ee v al uat e dwi t hapr ec edi n g$.Fore x ampl e:i f ( $Var i abl e)wher eVar i abl e=‘ TRUE’ STRI NG OK 29.29.29www. aveva. com CHAPTER77Er r or s&Er r orHandl i ngAner r orcondi t i oncanoccur wh enac omma ndc ou l dno tc omp l e t es uc c es s f u l l y . Th i si sb ec au seofami s t ak ei nt h ema cr o orf unc t i on( ei t heri nputorex ec ut i on) .Aner r ornor mal l yhast hr eeeffec t s :•AnAl er tbox a pp ea r swh i c ht h eu s ermu s ta c k no wl e dg e.•Aner r o rme s s ag ei so ut p ut t e dt ot h ec o mma nd l i n et oge t herwi t hat r ac ebac kt ot hee r r ors our c e.•An yc ur r entr unni ngPMLma cr osand f un ct i o nsar ea ban do ne d.7 . 1Ex a mp l eofEr r o r sTh i se x amp l eo fa ne r r o ri sc au se db ya n a t t e mp tt ocr e at eanEq ui p me ntwh eni nt h ewr o ngpa r t o ft h eh i e r a r c h y .( 4 1, 8 )ERROR– Canno tc r eat eanEQUIatt hi sl e v el .Th e41i st hepr ogr am s ec t i onwhi c hi den t i fi edt heer r or and8i st heer r orc odei t s el f .7. 2Er r orHandl i ngI ft hei nputl i newaspar tofaPMLmac r oor f unc t i on,t heer r orma yop t i o nal l ybeHANDL ED.Thi sal l o wst hedes i gneroft hemac r ot o l i mi tt heer r or st heus erwi l l ex per i enc e.T ypeoutt hef ol l owi ngex ampl eands av ei tas c : pml t r ai ni ngEr r o r T e s t . mac .Fi r s tr u nt hemac r oataSI TEe l ement ,t he nataZONEel ement
a ndt h enag ai natt h es a meZONE.Co mp ar et h er e t u r npr i n t e dl i n esi nt h ec o mma nd wi ndow.NEW EQUI/ ABCDHANDLE( 41,8)$pNeedt obeataZONEorbel ow ELSEHANDLE( 41,12)$pThatnamehasal r eadybeenused.Namesmustbeuni que ELSEHANDLEANY$pAnot herer r orhasoc cu r r edELSEHANDLENONE$pEv er yt hi ngOK. EQUIc r e at e dENDHANDL E7 . 3Al e r t Ob j e ct sAl er tob j e ct sal l o wu se r c on t r o l l edpo pu p f or mst obeus ed.7. 3. 1Al er tObj ec t swi t hnor et ur nv al ueTher ear e3t y pesofal er twi t hno r et ur nv al ue:! ! Al er t . Er r or (| Youc annotdot hi s ! |)! ! Al er t . Mes sage(| Sav i ngy ourdat anow|)! ! Al er t . War ni ng(| I nc or r ec tv al ue! |) 30.30.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140130www. avev a. com Bydef aul t ,al l al er tf or msappearwi t ht her el ev antbut t onasneart ot hec ur s oraspos si bl e. T opos i t i onana l er ts pec i fi c al l y , Xan dYv al ue sc anbes pe ci fi edasap r opo r t i ono ft he s cr eens i z e.! ! Al er t . Er r or (| Youc annotdot hi s ! |,0. 25,0. 1)7. 4Al er tObj ec t st hatr et ur nv al ue Ther ear et hr eet y pesofal er twhi c hr e t ur nav al ue,c onfi r m,ques t i onandi nputal er t s .7. 4. 1 Con fir m Al er t sCon fir m al er t sr e t ur n‘ YES’ o r‘ NO’ ass t r i ng se . g .! Ans wer=! ! Al e r t . Confi r m(| Ar ey ous ur e ! |)Af t e rt y pi ngt hea bo v eont ot hec omma ndl i ne,t y peqv ar! Ans we r7 . 4. 2 Ques t i onAl er t sAns wera l er t sr e t ur n‘ YES’ or‘ NO’ or‘ CANCEL ’ a ss t r i n gse. g.! Ans we r=! ! Al er t . Ques t i on(| OKt odel et eSi t e|)Af t ert y pi ngt heabo veont ot hec ommandl i ne,t y peqv ar ! Ans wer7. 4. 3I nputAl er t sThefi r s tv al uei st hepr omptandt hes ec ondi st hedef aul tv al ue. I nputal er t sr et ur nav al ueasas t r i ng.e. g.! Answer=! ! Al er t . I nput (| Ent erWi dt hofFl oor | , | 10|) Af t e rt y pi n gt heab ov eon t ot h ec o mman dl i n e,t y peqv ar! An s we r 31.31.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140131www. avev a. com Ex e r c i s e4–Er r orHan dl i ngAdds omeer r orh andl i n gt oc ont r ol an yer r or sge ner at edwhi l e r unni nge x3. mac .Al t houghy ouwi l l notbeabl et ohandl eev er yer r or ,t hi nkaboutl i k el yer r or s a ndh owt oha nd l et h em Wh atwo ul db eas ui t a bl er e s po ns et oa ne r r o r ?Sh ou l di tb e i gnor ed?Ormaybesomeuser f eedbackpr ovi ded?MaybePDMSshoul ddosomet hi ng aut omat i c al l yt oc or r ec ti t ?Ane xampl eofus er f eedbac kc oul dbet opr i ntawar ni ngt ot he c ommandl i ne.T odot hi s ,s t ar tal i newi t h$pf ol l owedb yas pac e.What e veri swr i t t enaf t er t hi ss hal l bepr i nt edt ot hec ommandl i ne.e. g.$pEr r orFoundT oge ty ous t ar t ed,t he f o l l o wi n gar ee x ampl e sofs omeer r or swhi c hma yo cc ur :•Att h ewr ongl e v el i nt hehi e r ar c hy ( i . e.ataPI PEel ementr at hert hanaZONE)•As ui t abl ehi er ar c hyl ev el f orequi pment c r eat i o ndoesno te xi s t( orc anno tbef ound)•Anel eme ntc al l ed‘ HandWheel ’ al r eadyex i s t s Sa v et h efi l ea sc : p ml t r a i n i ng ex 4. ma ca ndr u ni to nt h ec omma ndl i n eb yt y p i ng $ m/ c : p ml t r a i n i n ge x 4. ma cAnex a mp l eoft h ec o mp l e t e dma c r oc anbef o un di nAp pe nd i xB 32.32.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140132www. avev a. com 33.33.33www. avev a. com CHAPTER88PML1Hi er ar chyAl l PML1Macr osar ei nadi r ect or y s t r u c t u r epo i nt edatb yt h ev a r i a bl ePDMSUI .Th ePDMSUIe nv i r o nme ntv a r i a bl eSe t PDMSUI =C: AVEVApl ant PDMS12. 0. 2pdmsui St andar dAVEVAenvi r onmentvar i abl ear eset i nab atfi l esc al l edEVAR. bati nt hee x ec ut abl ed i r ec t or y .Al l PML1mac r osan df or msar e c al l e du si n gs y no ny msFore x amp l et h ema cr o sa ndf o r msas s oc i a t e dwi t hpi p i n ga r ec a l l ed us i ngt hes y non ymCALLP$SCALLP=$M/ %PDMSUI %/ DES/ PI PE/ $s 1CALLPMPI PEThi s i swh yi fal l s y non ymsar ek i l l edt hatPDMSwi l l nol ongerwor kpr oper l y8. 1Modi fi c at i onst o PDMSUII ti sno r mal p r ac t i c et oc r e at eapar al l e lhi er ar c hyt oc ont ai nan yne w ormodi fi ed PML.Changest oAVEVAst andar dpr oductmaycausePDMSt of unct i oni nappr opr i at el y
The s emo di fi c at i o nsc ant he nb ec a l l edb ymod i f y i n gt hePDMSUIv a r i a bl et op oi n ta tamu l t i pa t h .Th i sc anbedo nebypu t t i n gane wfi l epat hi nf r o nto ft h e%PDMSUI %d efi ni t i o n.Th i s wi l l updat et hePDMSUIen vi r onmentv ar i abl et oi nc l udet hes pe ci fi edfi l epat h.Se t PDMSUI =c: pml t r ai ni ngPDMSUI%pdmsui % Thenewfil epat hshoul dgoi nf r ontof %PDMSUI %s ot hi sar eai sc hec k edfi r s tf orc ont en t .On cecont enti sf ou nd,o t herl o cat i on s wi l l n otb es e ar c h ed.Th i smod i fi c at i ons ho ul dbedo neaf t e rt h ePDMSUIe nv i r o nme nt v a r i ab l eh asbe ende fi ned .Thi sc anbedo neatt h eb ot t om o ft h eEVAR. b atfi l eori nt h e PDMS. batfi l e( af t ert hel i newh i c hc al l sev ar . bat ) .Theen vi r onmentv ar i abl escanbec hec k ed wi t hPDMSbyusi ngt heqevarsynt axqevarPDMSUIorqevar‘ SAM000’ 34.34.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140134www. avev a. com 35.35.35www. av eva. com CHAPTER89PML2Funct i onsandObj ect s9. 1Thepml l i b en vi r onme ntv ar i abl eThePMLLI Ben vi r onmentv ar i abl epo i nt st oaPML2di r e ct or ys t r uc t ur e Se tPML LI B=C: AVEVAp l a nt PDMS1 2. 0 . 2 pml l i bTh er ear e3ne wfi l ee x t e ns i o ns. p ml f n cf o r Func t i ons ,. pml f r mf orFor msand. pml obj f orObj ec t s ,wi t ht hes ee xt ens i onst hefi l eswi l l be l o ad edbyPDMSa ut o ma t i c a l l ywh ent h ep r o gr a mi ss t a r t e d.Fu nc t i o nsa r el o ad edbyPDMS an da r er u nb yt y p i ngt h ef o l l o wi n g! ! my ma c( ) .Th i sr u nsfi l emy ma c. p ml f n cFo r msar e di s pl a y edb yt y p i n gSho w! ! My f o r mo r! ! My f o r m. s h ow( )Ob j e ct sha v et ob ea s si g ne dt oa v ar i abl ebef or et heycanbeus edi . e.! x=obj ec tMy Obj ec t ( )9. 2Modi fi cat i onst opml l i bI ti s no r ma lp r a ct i c et oc r e at eap ar a l l e lh i e r a r c h yt oc on t a i nan yne wo rmo di fi edPML.Ch an ge s t oAVEVAs t a nd ar dpr o du c tma yc au s ePDMSt of u nc t i o ni n ap pr o pr i a t e l yTh es e mod i fi c at i on sc ant henb ec al l edb ymodi f y i ngt hePMLL I Bv ar i abl et opoi ntatamul t i p at h. Thi sc anbedo nebyput t i ngane wfi l epat hi nf r ontoft he%PMLLI B% de fini t i on .Thi swi l l up dat et hePMLLI Ben vi r onmentv ar i abl et oi n cl udet hespec i fi edfi l epa t h .Set p ml l i b =c : p ml t r a i n i n gPML LI B%p ml l i b % Th en ewfi l epa t hs ho ul dgoi nf r o nto f%PML LI B% s o t hi sar eai schec kedfi r s tf orc ont ent .Onc ec ont enti sf ound,ot herl oc at i onswi l l notbe s ea r c he d.Th i smo di fi c at i o ns hou l dbedon ea f t e rt h ePMLL I Be nv i r o nmen tv a r i ab l eha sbe en de fi ne d.Th i sc anbed on ea tt heb ot t o mo ft h eEVAR. ba tfi l eo ri nt h ePDMS. b atfi l e( af t e rt h e l i n ewhi c hc al l sev ar . bat ) .I nAVEVApr o duc t sen vi r onmen tv a r i a bl e sc anbec hec k edu si ng t heqev ars ynt axi . e.qev arpml l i b 36.36.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140136www. avev a. com 9 . 3Up da t i n gPDMSUIa ndPML LI BEd i tt h eEv a r . b atfi l et oi n c l u demu l t i p at h sf o rPDMSUI an dPML LI BThe ses et t i n gss h ou l dbema deatt hebo t t o m oft h ee v ar . b atfi l eSe t pd ms ui =c : p ml t r a i ni n gp dms ui %p dms u i % Se tp ml l i b =c : p ml t r a i n i ng pml l i b%p ml l i b % The s e t t i n go ft h ev a r i ab l ec anb ec he ck e di nAVEVAPl a ntDe s i gn( PDMS)u si ngt h ef o l l o wi n g c omma nd s:qev a rp dms ui a ndqe v arp ml l i bI fapml l i bfi l ei sco nc ei t emsh av ebe enl oa de d b yPDMS,i tn ee dst ober e l o ad ed .Th i sc anbedo nebyt y pi n ge i t he rpml r el o adf or m! ! NAME o rp ml r e l o adob j e c tNAMEI fane wfi l ei st opml l i b ,t h efi l e sc anber e ma pp eds oPDMS k no wswhe r ei ti sl oc at ed .Thi si sdo neb yt y pi ngp ml r eha shont ot hec ommandl i ne .Thi swi l l updat et hefi r s tfi l el oc at i oni nt hes ear c hpat h.T oupdat eal l s ear c hpat hs ,t y pepml r ehas h a l l .9 . 4PML 2Ob j e c t sAnob j e c ti saPMLgr o up i n go fi n f o r ma t i o n.I tma yha v eMEMBERS ( u s edt oho l dda t a )a nd sMETHODS( u s edt oc omp l e t eanac t i o n) .On c ea s s i g ne dt oa v ar i abl e,t hatv ar i abl ebec omesani ns t anc eoft hatobj ec t .Thi smeanst hatv ar i abl ewi l l beha veast heobj ec tdefi ni t i on.Whi l ei ti spos si bl et oc r eat eus er defi nedobj ec t s( di s cus sed
l at er ) ,PDMSi ss uppl i edwi t hal ar genumberofbui l t i nobj ec t s .Af ul l l i s toft hes ec anbe f o un di nt h ePDMSSo f t wa r eCu s t o mi s a t i o nRe f e r e nc eMa nu al .Fo re x a mp l e ,t y p e! p os= obj ec tpos i t i on( )ont ot hecommandl i ne.Quer yt hevar i abl eandchec kt her es ul t sagai ns tt he member sofapo si t i onobj e ctl i s t e di nt her ef er en cemanual .Al t houghaFORM i sanob j ec t ,i t i sas ub j e c ti ni t sowna ndwi l l b ed i s c us s edl at e r .9 . 5PML 2Me t h od sWh enwo r k i n gwi t h b ui l t i no bj e c t s ,t h er ema ya l s ob eBUI L T I NMETHODS( o bj e c td ep en da nt ) .Th es eme t h od s ha v ebee nde finedt oc omp l e t ec er t ai na ct i onsappl i c abl et oobj ec t .Fo re x ampl e,t y pet he f ol l o wi ngi nt ot hec ommandl i ne:! v al ue=| 56|! r es ul t=! v al ue*2Thi se xampl ewi l l ha ve c aus edaner r orasas t r i ngc anno tbeus edi nane xpr es si onl i k et hi s .T oa voi dt heer r or ,r ef er t ot heSTRI NG ob j e cti nt h eRe f e r e nc eMa nu al a ndfi ndt he. r ea l ( )me t h od .Th i sme t ho d t r ans l at est hev ar i abl ef r o m aSTRI NG t oaREALsot ha ti tc anbeus edi nt heex pr e ss i on . The! v al uer emai nsas t r i ng,b ut! r e sul t sno wb ec omesaREALe . g.! v a l ue=| 56|! r es ul t=! v al ue. r eal ( )*2Wi t hi nPML2,t her ear ebui l t i nmet hodsf oral l t hes t andar dobj ec t s( ARRAY, TABLE,FORM,andSTRI NG) .Ref ert oPDMSSof t war eCust omi sat i onRef er enceManualf or t hea v ai l abl eme t hodsa ndi nf or mat i o n 37.37.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140137www. avev a. com Foreachobj ectt ype,t het abl eshows:NAMEThenameoft hemet hodormember .For e x a mp l e ,aREALob j e c th asame t h odna me dCo s i n e.I ft h er ear ean ya r g ume nt s ,t h eya r e i n di c at edi nt hebr ac k et s( )a f t ert hename.Fore x ampl e ,t heREALobj ec thasame t hod namedBETWEENwhi cht akest woREALar gument s.RESUL TThet ypeofv al uer et ur nedby t h eme t h od .Fo re x a mp l e ,t h er e s ul to ft h eme t h odCo s i n ei saREALv a l u e.So meme t h od s donotr et ur naval ue:t hesear eshownasNO RESUL T.STATUSThi scol umni susedt ogi ve o t h eri n f o r ma t i o na bo utt h eme t h odo rmemb er s .Fo rme t h od s,t h i sc ol u mnt e l l sy ouwhe t h er t h eme t h odMODI FI ESt h ev a l u eo ft heob j e ct .Forme mb er s ,t h i sc ol u mnt e l l sy o uwh et h er t hememberi sSETTABLE( byt heuser )orUNSETTABLE.Not et hatf ort hesyst emdefined PDMSobj ectt ypes,member scor r espondt oPDMSat t r i but esACTI ONThi scol umnt el l syou whatt hememberormet hoddoes.Al ar genumberofmet hodshavebeenpr ovi dedf ort he bu i l t i nPMLda t at y pe s:Fo re x amp l e ,f o rSTRI NG ob j e ct s ,y o uwi l l fi ndame t h odna me d Le ng t h .! Na me=‘ T on yBl a i r ’ ! Nu mb er Of L et t e r s=! Na me . L en gt h ( )qv a r! Nu mb er Of L et t er s Thi sme t h odr e t u r n saREALv a l u e( t h enu mb ero fc ha r a ct e r si nt h es t r i n g) ,b uth asNO EFFECTont hev ar i abl ei t s el f .No t i c et hedo ts ep ar at orbe t weent hen ameo ft hev a r i abl e an dt h ena meoft h eme t h od .Al s ono t et he( )b r a ck e t sf o l l o wi n gt h en ameo ft h eme t h od .Th e br a c k et sar eu se dt oe nc l o set hear g umen t soft h eme t h od ,bu tt he ymu stb ep r e se nt .The f o l l o wi n gme t h odc r e at e sa nARRA Yo fSTRI NGS:e . g .! Na me St r i n gs=! Na me . Sp l i t ( )9 . 6 Me t hodConc at en at i onI ti spos s i bl et oa ppl ymul t i p l eme t hod st ot hes amev ar i abl ewi t hi n t hes amel i neo fc ode.Thi spr oc es swi l l wor kpr o vi di ngt hedat apas s eda tea chs t a gei s v al i d.T r yt hef ol l owi ngont hec ommandl i ne:! l i ne=' hel l owor l dho w ar ey ou' ! newl i ne=! l i ne. upc as e( ) . s pl i t ( ) . s or t ( )qv ar! l i ne! newl i ne' hel l owor l dhowar ey ou' [ 1]' ARE' [ 2]' HELLO' [ 3]' HOW' [ 4]' WORLD' [ 5]' YOU' 38.38.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140138www. avev a. com 9 . 7Th e! ! CEOb j e ctAs pe c i a lGL OBALPMLv ar i a bl e! ! CEa l wa y spo i n t st ot h ec u r r e nt PDMSe l e me nta ndi t sa t t r i b ut e s .T y peqv a r! ! CEo nt ot h ec omma ndl i n ea ndc omp ar ei t
agai ns tt y pi ngqat t .Youwi l l not i c et her et ur nedat t r i but ei nf or mat i oni st hes ameoft he member sl i s toft he! ! CEobj ec t .Thi sme an st hatt he! ! CEobj e ctc anbeus edt oas s i gnt he v al uesofat t r i but est o! v a r i a bl e sFore x ampl e ,! Br a nc hHe adBor e=! ! CE. Hbo r eas s i gn st he HBOREa t t r i b ut e( t a k enf r o mt hec ur r en tBRANe l e me nt )t ot h ev a r i a bl e! Br a nc h Hea dBo r e mak i ngi tr eal .I ft he! ! CEobj ec tmemberi sanobj ec ti t s el f ,t hatobj ec twi l l al s ohav e member ss of ur t he ri nf or mat i onbeobt a i ne de. g.! Head Po si t i on=! ! CE. Hpos . Ea stEas t memberf r om aPOSI TI ONobj ect! East i ng=! ! CE. Hr ef . Cpar [ 1]Cat apar amet ermember ( at t r i but e)ofaDBREFobj ec tI ft he! ! CEobj ec tmemberi sanobj ec twi t hbui l t i nmet hods , t hesemet hodsc anal sobecal l ed:! PosWRTVal ve=! ! CE. Hpos. WRT( ZONE)POSI TI ON ob j ec tw. r . tt heo wni ngZONEThi spr o ces sc anal s ob er e v er s edal l o wi ngt h es et t i ngof at t r i but esf ort heCE.Thi smeanst hati ti spos si bl et or ec or dt hec ur r entv al ueofanat t r i but e, mo di f ya ndr e as s i gnba ckt ot h eCE.Fo re x amp l e,t y p eo utt h ef o l l o wi n gon t ot hec omman d l i n e:! Po s=! ! CE. Po sqPOS! Po s . Up=2 00 0! ! CE. Po s=! Po sqPOSTh es el i n eswi l l h av e mo v e dt h eCEu pb y20 00 .T r yt h i se x amp l ea ga i nwi t hs o meo t h era t t r i b ut e s .9 . 8PML 2 Fu nc t i o nsF un c t i o nsa r ene ws t y l ema c r o swh i c har epr e l o ad edbyPDMSa ndc anbec al l e d di r ec t l y .Fore xampl e,t oc al l t hef unc t i onc al l edFunc Name. pml f nc ,t y pe! ! Func Name( )ont o t hec omma ndl i ne.Af unc t i oni sdefi ne dwi t hi na. pml f n cfi l es t or edwi t hi nt h ePMLLI Bfi l e pat h.Forane xampl eofaf unc t i on,t y pet hef ol l o wi ngi nt oane wfi l eands av ei tas c : pml t r ai ni ngpml l i bf un ct i ons Name CE. pml f n c.defi nef unc t i on! ! NameCE( )! c e=! ! CE. f ul l na me $p$ ! c eend f unc t i onT or unt h i sf un ct i on,t y pe! ! NameCE( )ont ot hec ommandl i ne.Youwi l l no t i c et hef ul l namei spr i nt edbel o wi t .Thi si sanex amp l eofaNONRETURNf unc t i onwi t h NO ARGUMENTS.I ft hef unct i oncanbegi venar gument swhi char et henassi gnedt o v ar i abl eswi t ht hef unc t i on.I fav ar i abl ei sr et ur ned,t hi smeanst hatt hef unc t i onc anbe as si gnedt oanot herv ar i abl eoraspar tofac al c ul at i on.T ypeoutt hef ol l owi ng,ands av ei tas c : pml t r ai ni ngpml l i bf unc t i ons Ar ea. pml f nc :defi nef unc t i on! ! Ar ea( ! Radi usi sREAL)i sREAL! Ci r c l eAr ea=! Radi us . Power ( 2)*3 . 142r et ur n! Ci r c l eAr eaendf unc t i onAst hi sf unc t i oni san exampl eofaRETURNf unct i onwi t hanARGUEMENT,i tcanbeusedaspar tofan e xpr es s i o n.Th er e t u r n edv al uei sbas edt hef unc t i onsar gume ntandi t st y pe( REALi nt hi s c a s e ) : 39.39.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140139www. avev a. com ! Hei g ht=6 4! Cy l i nde r Vol ume=! ! Ar ea( 2. 3)*! Hei gh tqv a r! Cy l i nde r V ol umeAsi ndi c at edb y t he! ! ,f unc t i on sar egl obal .Thi sme anst haton cedefi ned,t h eycanbec al l edb yan yf or m or me t h odwi t h i nPDMSmi ni mi s i n gr ep et i t i v ec od e.Sy no ny msar ed i s ab l e di n s i def u nc t i on s Ex e r c i s e5( a )–Con v er tt heHos er eel ma cr oi nt oaf unc t i o nThi sex e r c i s ewi l l c ov erho wt o up dat ee xi s t i ngmac r ost omak eu seofupd at e df unc t i onal i t y . Themac r ot ha twi l l b eupdat ed i sc : p ml t r a i n i ng ma cr o se x 5. ma c.Ha v eal oo ka tt hefi l e .I tu se st h eREADme t h oda ndt hi s t e c hn i q uei snol on ge rv al i d .Ho wc ant her e qu i r e dv a l u esbep as s edt ot h ema cr o ?A f unc t i onc anbeus edt oal l o wi np utv al ues .Sa v et heup da t edma cr oasaf unc t i onc al l e d ex 5a. pml f nci nt hedi r ec t or yc: pml t r ai ni ngpml l i bf unc t i onsTobegi nwi t h,defi neaf unc t i onwi t h on ear gume nt :Thena meoft heequi pment .Appl ys ui t abl eer r orhandl i n gt ot hef unc t i onand c h ec ki two r k s .Af t e rt y p i n gPMLREHASHAL L,t y p e! ! e x 5 a( ‘ Ho s eWh ee l ’ )a ndane wh os e wh ee lwi l l b ec r e at e d.L oo katt h ema cr oan dy o uwi l l s eei tu se st h es amehan dwh ee lwe ha vedefi neds of ar .Thef unc t i onus est hev ar i abl e! Wheel Di at oal t ert hedi amet eroft he
ha ndwh ee l .Up da t et h ef u nc t i o nb ya ddi n ga no t h era r g umen t ,t h ed i a me t ero ft h eh and wheel .T es ty ourf unc t i onands eet hei mpac tofal t er i ngt hi svar i abl e. 40.40.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140140www. avev a. com Ex er c i s e5( b)–Addi ngar gument st ot hef unc t i onEx t endt hef unc t i onwr i t t eni nex er c i s e5at o a cc ep tt womor ea r g ume nt s :•t h ewi d t hoft h eh os e wh ee l•t h ed i ame t e ro ft h eh os ewh ee l . Re wr i t epar t soft hef u nc t i onssot hathos ewheel wi l l c hanges i z eb as edont hes ei nput t ed nu mb er s .Ho wd ot h ep r i mi t i v e si nt h eh os e wh ee lr el a t et ot h es ed i men si o ns .Re du cet he l i n eso fc o debyi n t r o du ci n gDO l o op san dPML 2s y nt a xSa v et heup da t e df u nc t i o na sa f unc t i onc al l edex 5b. pml f nci nt hedi r ec t or yc : pml t r ai ni ngpml l i bf unc t i onsT ypes how! ! e x5pl tt o s eeandi me ns i o nedpl o tfi l e! ! e x 5b( | Hos eReel 00 1| ,1000,2000) 41.41.41www. av ev a. com CHAPTER1010For ms10. 1For msAr eGl obal Obj ect sFor msnow l ookl i keGLOBALOBJECTS,wi t hGadget sast hei rMEMBERS.Oncel oaded,t he i n f or mat i onh el dwi t hi naf or mc anbea cc es s eda tan y t i me.T ofi ndou ti n f or mat i ona bo utt he f or m,i tc anbequer i edasi fi twasanobj ec t .Fore xampl e,l et sus et heGr aphi c sSet t i ngs f o r m( Se t t i n gs >Gr a ph i c s …)T y peSh ow! ! gp hs e t t i n gso nt ot h ec o mma ndl i net os eet hef o r m i nq ue st i o no rc h oo sei tf r o mt h emen uT y peqv a r! ! g ph se t t i ng so nt ot h ec omma ndl i n e.Th e i nf or mat i oni sal i s toft hemember soft hef or m.Compar et hi sl i s tagai ns ts omeoft hegadge t so nt h ef o r m.Asg ad ge t sar eme mb er so ff o r ms ,wec a nfi n di n f o r ma t i o na bo utt h es e .Th e fi r s tgadge tl i s t edi scal l edOK( r epr es ent i ngt heOKbut t onont hef or m) .T ypeqv ar! ! gphs et t i ngs . ok .Thei nf or mat i onr et ur nedi si nf or mat i onaboutt hebut t on.Spec i fi ci nf or mat i on aboutt hegadgetc anbequer i eddi r ec t l ye. g. :qv ar! ! gphs et t i ngs . ok . t agqv ar! ! gphs et t i ngs . ok . v al qv ar! ! gphs et t i ngs . ok . ac t i v eT ogett henameofas ho wnf or m,t y pe s ho w! ! p ml f o r ms .Th i sf or mc a nl i s ts ho wnf or ms10 . 2Dy na mi cl o ad i n go fOb j e c t s ,For ms andFunc t i onsWhenaPMLobj ec ti sus edf ort hefi r s tt i me,i ti sl oadedaut omat i c al l y .Thi s appl i est obot hFORMSandOBJECTSe. g. :! Per son=obj ectPRI MEMI NI STER( )show! ! My I n pu t Fo r m On c ea no bj e c ti sl o ad edb yPDMS,t h ed efi n i t i o ni sh el db yPDMS.Th i s meanst hati ft heobj ec ti sc hangedwhi l s ti ti sl oaded,t hef or m wi l l needt ober el oaded.T o r el o adaf or mt y pep ml r el o adf o r moro bj ec tf ol l o wedb yt h eobj ec tnamee . g. :pml r e l oad f o r m! ! My I n pu t Fo r mp ml r e l o adob j e c tPRI MEMI NI STERI fane wfi l ei sc r e at e dwh i l s tPDMS i sopen,t hefi l ewi l l notbemapped( ev eni fi ti ssa vedi nanappr opr i at efi l epat h) .Ther emap fi l est y pepml r ehas h.Thi swi l l r emapal l t hefi l eswi t hi nt hefi r s tfi l epat hi nt hePMLLI B v ar i abl e.Ther emapal l fi l esi nal l t hefi l epat hs ,t y pepml r ehas hal l 42.42.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140142www. avev a. com 10 . 3For m De fi ni t i o n. . .Fo r msar ed efi ne dwi t hi n. p ml f r mfi l e sa nds hou l db ed efi ne di nt he f o l l o wi n gwa y .A. pml f r mfi l ec anc on t ai nt h ef o r ms et upde fini t i onandan yme t hodsc r eat edi n as soc i at i on:s et upf or m! ! f name. . .e xi tdefi nemet hod. i ni t ( ). . .Endmet hod10. 3. 1Us i ngt he . n etf r a me wo r kFo r mo bj e c t sc anno wma k eu s eo ft h e. n etf r a me wo r k .Th i sa l l o wsne w f e at ur est ob ei nc l udedonf or ms :•Doc k i ngf o r ms( aut omat i cr e si z i ng )•An chor i ngg adge t s ( us ef ul whenr es i z i ng)•Mul t i c ol umnl i s t s•T absonFor ms•MenuAddi t i onst oe xi s t i ng appl i c at i ons :•T ool barAddi t i onst oe xi s t i ngappl i c at i ons•DBARConv er s i onsAl t houghi ti s no wp os s i bl et odoc kf or ms ,i tdoe sno tappl yt oe v er yf or m.Ther ear es omer ul est o c on si de rwh end ec i d i n gi faf o r ms h ou l dd oc k :•Do est h ef o r mn ee dt or e ma i no pen ?•I st h e f o r mus edhea vi l y•I faf or m ha sanOK/ Canc el but t o n,i ts ho ul dno tnee ddo ck i ng•I faf or m
hasamenubar ,i tCANNOTbedockedTodecl ar eaf or m asdockabl e,t hi shast obedoneon t het opoft hedefi ni t i on.Byi nc l udi ngdi al ogdoc kl ef t ,wear es t at i ngt hatt hef or mi s di s pl ay ed,i ts hal l al r eadybedoc kedt ot hel ef t :s et upf or m! ! f nam di al ogdoc kl ef tT odefi nea fl oat i ng,doc kabl ef or m,us et hef ol l owi ngl i ne:s et upf or m! ! f nam di al ogr es i z eabl eT odefi ne af or m ofac er t ai ns i z ei nt hec ent r eoft hes cr een,us et hef ol l owi ngl i ne:s et upf or m! ! f nam doc umentatx r0 . 5y r0 . 5s i z e100100I fnoaddi t i onal de t ai l sar ei nc l uded,t hedef aul tf or m c r eat i oni saDi al og,nonr es i z eabl e,s i z eadj us t edaut omat i c al l yt ofi tc ont ent sf or m.Formor e exampl es,r ef ert ot heFORM obj ecti nt hePDMSSof t war eCust omi sat i onRef er enceManual 10. 3. 2Showi ngandhi di ngFor msNowf or mscanbef oundt hr ought hePMLLI Bsear chpat h, t her ei snol ongert henee dt ol oadt hem i ndi v i dual l y . T os ho w af or m us es ho w! ! f or mname . Thi swi l l l oadt hef or m defi ni t i onands ho wi ti nonego!Somet i mesi ti sus ef ul t oha vet he f or ml oadedwi t hs eei ngi t( e. g.t or ef ert os t or edi nf or mat i on) .Af or mc anbel oaded( butnot s ho wn )b yt y pi n gl o adf o r m! ! f o r mn ame 43.43.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140143www. avev a. com 10 . 3 . 3Bui l t i nme t hod sf orFor msAl t houghi spos s i bl et od efi neu ser defi nedme t hod swi t hi n us er defi nedf or ms( di s c us s edl at er ) ,al l FORM obj ec t sha vebui l t i nme t hodsav ai l abl e.T r y ont hef ol l owi ngont hec ommandl i ne:! ! gphs et t i ngs . s how( )qv ar! ! gphs et t i ngs . s hown( )! ! gphs et t i ngs . hi de( )qv ar! ! gphs et t i ngs . s ho wn( )I nt hi se xampl e,t he. s how( )met hodi sus edt o s ho wt h ef o r m,t h e. s h own ( )me t h odr e t u r n swh et h ert h ef o r mi ss ho wna ndt h e. hi d e( ) me t h odhi d est h ef o r m.Fo rmo r ee x amp l e s ,r e f e rt ot h eFORM o bj e c ti nt h ePDMSSo f t wa r e Cu s t o mi s a t i o nRe f e r e nc eMa nu al 1 0. 4Ca l l b ac k sI fa no bj e c th asaCAL LBACKme mb er ,i t c anbegi v enac al l bac ks t r i ng.Thi smeanst hati ft heus eri nt er ac t swi t ht heobj ec t ,anac t i on c anb ep er f o r med .Thec a l l b ac kc andoo neo ft h r e et h i n gs :•s ho waf o r m •e x ec ut ea c o mma ndd i r e c t l y•r u naf u nc t i o no rme t h odAFORM o bj e c th ass o mes p ec i a lc a l l b ac k s wh i c ha r eu se dwh ent h ef o r mc omp l e t e sc er t a i nac t i on s( e . g .Sho wn ,c l o se d)Co pyou tt h e f ol l owi ngi nt oanewfi l eands av ei tasCal l bac k. pml f r m.Putt hefi l ei nt ot heappr opr i at efi l e pat hc: pml t r ai ni ngpml l i bf or msandr emapt hefil es .T os eet hef or m,t y peshow! ! Cal l bac k. Pr es st hebut t onsl ookatt hec ommandl i ne.s et upf or m! ! Cal l bac k! t hi s . f or mTi t l e=| Cal l bac k Ex ampl e|! t hi s . i ni t c al l =| ! t hi s . i ni t ( ) |! t hi s . ok c al l =| ! t hi s . ok Cal l ( ) |! t hi s . c anc el c al l =| ! t hi s . c anc el Cal l ( ) |! t hi s . qui t c al l =| ! t hi s . qui t c al l ( ) |but t on. ok' OK' OKbut t on. c an' Canc el ' at x 3 0CANCELe x i td efi n eme t h od. Ca l l b ac k ( )$ pCo ns t r u c t o rMe t h od -e nd me t h odde fi ne met hod. i ni t ( )$pI ni t i al i s eMet hod-endmet hoddefi nemet hod. ok cal l ( )$pOKMe t hode nd me t h odde fi neme t h od. c a nc e l c a l l ( )$ pCa nc e lMe t h od -e nd me t h od 44.44.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140144www. avev a. com de fineme t hod. qui t c al l ( )$pQui tMe t hod-endme t hodAtt het o poft h ef or m,t hec al l bac k me mb er so ft h ef o r m wh er ese tu s er d efi n edme t h od swi t h i nt h ef o r m.•Th e CONSTRUCTORmet hodwascal l edwhent hef or ml oaded( not i ce,i thast hesamenameas t hef or m) .•TheI NI TCALLmet hodi sc al l ede ver y t i met hef or mi ss hown( p er f ec tf ors et t i ng de f a ul tv a l u es•Th eOKCALLme t ho di sc al l e db ya nybu t t ong ad ge twi t ht heOKi ni t s d efi n i t i o n•Th eCANCEL CAL Lme t h odi sc a l l e db ya nyb ut t o ng ad ge twi t hCANCELi ni t s de fini t i on•TheQUI TCALLme t hodi sc al l e db yc l i c k i ngt hec l os ebut t onont hef or m.I fno cal l backsar edefinedf orOKCALL,CANCELCALLandQUI TCALLt hedef aul ti st ohi det he f o r m on l y10 . 5Fo r m Ga dge t sTh er ea r eman yk i n dsoff or mg ad ge t s ,e ac hanob j e c tt h atwi l l
havei t sownmember sandmet hods.Whenyouar edefini nggadget sonaf or m,t her ear e t woc ommo na i ms :•De fi net h ea r e at obet a k enupont h ef o r m •De fi net h ea c t i o nt obe t ak eni ft hegadgeti ssel ec t edI ti st hepos i t i onands i z eoft hegadgett hatdet er mi nest he a r e at a k enu pa ndi t sac t i o ni sde fi ne db yi t sCAL LBACKme mb er .1 0. 5 . 1Bu i l t i nme mb er s an dme t h od sf o rGa dg et sAsGa dge t sa r eob j e ct s ,t h er ear eav a r i e t yo fu s ef ul me mb er sa nd bui l t i nmet hodst hatc anbeus ed.Us i ngt hepr e vi ousex ampl e( ! ! Cal l bac k) ,t y pet he f o l l o wi n gont ot heco mmandl i ne:T ogr e y o utt heOKb ut t on! ! Cal l bac k . ok . Ac t i v e=F AL SET o hi det heCANCELbu t t on! ! Cal l bac k . c an. Vi s i bl e=F AL SEAppl yat ool t i pt ot heOKb ut t on! ! My f or m. o k. s et T oo l Ti p( | Thi si sanOKb ut t o n| )Forf ur t he ri nf o r mat i o n,PDMSSof t war e Cust omi sat i onRef er enceManual 45.45.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140145www. avev a. com 10 . 5 . 2Ga dge tpo si t i on i ngGadge t sar epo si t i onedonaf or mf r o mt opl ef tus i n gt heAT s ynt ax .TheATs y nt axdefi nest heor i gi noft hegadge ti nr el at i oni ngt ot heowni ngobj ec t( i . e. FORM o rFRAME) ..Gadge t sc anbepos i t i o nedex pl i c i t yori nr el at i o nt oo t hergadge t s . Wh enr e f e r r i n gt oot h erg ad ge t s ,t h er e6k n ownpo s i t i o nsonag ad ge t :XMI N,XCEN,XMAX, YMI N,YCENa ndYMAX.Th es er e f e rt ofi x e dp os i t i o ni nt h exa ndyd i r e c t i o nsont h e r ef er en cedg adge t .Ag ad ge tc anbet h oug htofa sa nen cl os i ngbo xt ha twi l l e nc l os et he ge ome t r yoft heg adge t( i nc l udi n gi t snamet agi fs pec i fi ed) .T op os i t i onag adge tatak no wn posi t i onuse:atx0y0Toposi t i ont heaboveCANCELbut t onuseXmaxandYmi nofOK u se :a tx ma x. o k+1 0y mi n . o kT op os i t i o naDI SMI SSb ut t o ni nt h eb ot t o mc or n ero faf o r m us e:atx maxf or m –si z ey ma xf or m Formor epos i t i oni ngsy nt ax ,r ef erpage25 9i nt h e PDMSSo f t wa r eCu s t o mi s a t i o nRe f e r e nc eMa nu al Th ea v a i l a bl es y nt a xan di t so r d erc a nb e d er i v e db yr e f e r r i n gt ot h eSYNT AXGRAPHSi nt h er e f e r e nc ema nu al .Th es edi a gr a msa r e a v ai l abl ef ormos tGad ge t sandca nbeus edwheni ni t i al l ydefi ni ngt hem.Thepi c t ur ebel o w i sane xampl eoft heSy nt axGr aphf orgadgetpos i t i oni ng( r ef er st oanot hergr aph) : Ref erPDMSSof t war eCust omi sat i onRef er enceManual f ormor egui danceont hesegr aphs 46.46.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140146www. avev a. com 10. 5. 2. 1Posi t i onGadget susi ngt hepat hcommandThepat hcommandcanbeusedt o de fi net hel o gi c al p os i t i o no fs u bs eq ue ntg ad ge t s .Thi sme t h odh asbe ensu pe r s ed edb yt h e pr e v i o usme t h oda ndh asbe eni n c l u de df o ri n f o r ma t i o n.Af t e rag ad ge th asbe end efi ne d,t he nextgadgeti sposi t i onedbasedonaPATH,HDI STorVDI STandHALI GNorVALI GN.Asan e x a mp l e ,s e et h ep i c t u r ebe l o w:Bu t t o n. Bu t 1$*d ef a ul tp l a c eme ntPA THd ownHAL I GN c ent r eVDI ST2par agr aph. Par 2wi dt h3he i gh t2$*aut opl ac edt oggl e. T og3$*a ut o p l ac ed PATHr i g htHDI ST3VAL I GNb ot t o mL i s t. L i s 4wi d t h2he i g ht3$*a ut o p l a c edPA THu p HAL I GNr i g htPar a gr a ph. Pa r 5wi d t h3h ei g ht3$*a ut op l a c ed10 . 5 . 3Do ck i n ga nd An chor i ngGadge t sAf t eragadge tha sbee nl oa de di t ss i z ean dpo si t i onar el oc k ed.T o modi f yt hepos i t i onors i z emanual l y ,t heal t er at i onsha vet obemadei nt hefi l eandt hef or m r el oaded.Asf or msc anber es i z ed,i ti snec es s ar yf orgadget st omov e/ r es i z es ot hel a youtof t h ef o r mr e ma i n s.Th er ea r et woa v ai l ab l es y nt a xd efi n i t i on st ha tc anh el pDOCKo r ANCHOR.Thi ssynt axshoul dbei ncl udedwhendefini ngagadgetandcanbei ncl udedi f orar ei ncl udedi nt hegadget ssynt axgr aph.TheDOCKandANCHOR ar emu t ua l l ye x c l u si v es oo nl yon ei sde fin edp erg ad ge tANCHORc on t r o l st h ep os i t i o no fa n edgeoft hegadge tr el at i v et ot hec or r es pondi ngedgeofi t sc ont ai ner .Fore xampl e,i fa
DI SMI SSbut t oni sanc hor edt ot heRi ght+Bot t om,i twi l l r emai ni nt hebot t om,r i ghtoft he f or mi fi ti sr e si z ed.DOCKf or c esgadgetfi l l t heav ai l abl es pac ei nac er t ai ndi r ec t i on.For ex ampl e,i fal i s ti sdoc k edt ot hel ef t ,i twi l l mai nt ai ni t swi dt h,buti t shei ghtwi l l c hangei tfi l l i t sc ont ai ner .DOCKFI LLi sv er yus ef ul f orens ur i ngagadgeti st hef ul l s i z eofi t sc ont ai ner . Cop youtt hef ol l o wi ngi n t oane wfi l eandsa v ei tasDoc k Ex ampl e. p ml f r m.Putt hefi l ei nt o t heappr opr i at efi l epat hc : pml t r ai ni ngpml l i bf or msandr emapt hefi l es .s et upf or m! ! Doc kEx ampl edi al ogr es i z eabl e! t hi s . f or mTi t l e=| Doc kandAnc hor |! but t pos=| x max . f 1-s i z e y ma x. f 1-s i z e |f r a me. f 1an ch orAL Lwi d t h3 0h ei g ht5b ut t on. b ut t 1| Do ckTOP|d oc kTOP bu t t on. but t 2| Anc horB+R|a t$ ! but t posanc horR+Be xi te xi t 47.47.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140147www. avev a. com Re si z et h ef o r ma ndob s er v et h er e su l t s .On ceag adg eti sd ec l a r e da sAn ch or edorDo ck i n g i twi l l r emai ns o.I fac hangei sr equi r ed,t hef or m defi ni t i ons houl dbeupdat edandt hef or m r e l o ad ed .Re f e rPDMSSo f t wa r eCu s t o mi s a t i o nRe f e r e nc eMa nu al f o rt h eSy n t a xGr a ph s . 1 0. 6Pa r a gr a phGa dg et sPa r a gr a phg ad ge t sa r es i mp l en ame dga dg et swh i c ha l l o wap i e c e o fTEXTo raPI XMAPt obedi s pl a y edonaf o r m.I ti sapa ss i v egad ge tt h atc a nn otb e s el e ct edb yt heus ers ohasnoc al l ba ck .Par agr aphg adge t sar eu seddi s pl a yei t her i ns t r uc t i onsorpi c t ur es .Copyoutt hef ol l owi ngi nt oanewfi l eands av ei tas Par aEx ampl e. pml f r m.Putt hefi l ei nt ot heappr opr i at efi l epat hc : pml t r ai ni ngpml l i bf or msand r emapt hefi l es .s et upf or m! ! Par aEx ampl e! t hi s . f or mTi t l e=| Par agr aphs |par a. par a1t e xt| No r ma lp ar ag r ap hg ad ge t |wi dt h20pa r a. p ar a 2a tx0y ma x. p ar a1ba ck g6t e x t| Ac y a n pa r ag r a phga dge t |wi d t h20pa r a. p ar a 3a tx0y ma x. pa r a 2p i x mapwi d t h154he i g ht5 0 pa r a. par a4atx0y max . p ar a 3+0 . 5t e x t| |wi d20he i2ex i tdefi neme t hod. Par a Ex ampl e( )Updat et hedi spl ayedt extusi ngCONSTRUCTORmet hod! t hi s. par a4. val=| Abovewasa PI XMAP ,t hi si sont wol i nes |-Us ebui l t i nme t hodt oappl ypi c t ur e! t hi s . par a3. AddPi x map( | c : p ml t r a i n i n gpml l i b i ma ge sa v ev a . pn g| )En dme t h odRef e rt ot heRe f e r e nc eMa nu al a ndGu i d e f ormor eexampl esThel astval ueoft hel astgadgetwassetdur i ngt heCONSTRUCTOR me t h od .e mp t ypa r a gr a phg adg et sc anb ec r ea t e dt or e se r v es pa c ewi t hv a l u ess etaf t e r c r eat i on. .10. 7But t onGadge t sBut t ongadget sar et y pi c al l yus edt oi n vok eanac t i onort o di spl ayachi l df or m.I t sCALLBACKcancal l aLOCALMETHOD,GLOBALFUNCTI ONor OBJECTMETHOD.I facal l backandachi l df or m ar ebot hspeci fied,t hecal l backcommand wi l l ber unbef or et hec hi l df or mi sdi s pl a yed.Copyoutt hef ol l o wi ngi nt oane wfi l eands av ei t asBut t onEx ampl e. pml f r m.Putt hefi l ei nt ot heappr opr i at efi l epat hc : pml t r ai ni ngpml l i bf or ms andr emapt hefi l es .s et upf or m! ! But t onEx ampl edi al ogr es i z eabl e! t hi s . f or mTi t l e=| But t ons | but t on. but t 1| Nor mal |but t on. but t 2| Gr een|bac kg5but t on. but t 3| Deac t i v e|but t on. but t 4| f or m|f or m! ! Par aEx ampl ebut t on. but t 5t oggl ebac k g4c al l | ! t hi s . c hec k( ) |pi x mapwi d31hei 21exi tdefinemet hod. But t onExampl e( )-Deact i vat ebut t 3i nCONSTRUCTORmet hod! t hi s . but t 3. ac t i v e=FALSE-Us ebui l ti nmet hodt oappl ypi c t ur es! t hi s . but t 5. AddPi x map( | c : pml t r ai ni ngpml l i bi mages off. png| ,| c : pml t r ai ni ngpml l i bi mages on. png| ) 48.48.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140148www. avev a. com en dme t ho dde fi neme t h od. c he ck ( )-Re t u r nt h et og gl ebu t t o nv a l u et ot h ec omma ndl i n e! c he ck=! t h i s . b ut t 5 . v a l$ p$ ! c he cken dme t h odRef e rt ot heRe f e r e nc eMa nua la ndGu i d ef o r mo r eex a mpl e sAs. b ut t 5wa ss e ta sat o gg l ebu t t o n,i th asei t he raTRUEo rF AL SEs t a t e . Thi smea nst h atat og gl eb ut t o nh ol d sa. v a lme mb erwh i c hc anb es e to rq ue r i e d.1 0. 7 . 1
Li nk l abel TheLi nk l abel ,pr ov i desapur el yt ex t ual but t onpr es ent at i on,i . e.i thasnoenc l os i ng box .I ti sof t enus edt oi ndi c at eal i nkt os omeappl i c at i oni t em,e. g.ahyper l i nkt oafi l e,al i nk t oa nas s oc i at e df or m.The ydoc au sev al i da t i ono fan ymod i fi edt e x tfi el dsoft hef or m whenev ert he yar epr es sed.Thet agt e xti ss ho wni nadi ff er entc ol ourt oal l ot hergadget ' s t agt e x t .Thel i nkl abel g adge thi ghl i ght sbyunde r l i ni ngwhent hemous ec ur s orpa ss esov er i t .Pr es s i ngi tc aus esaSEL ECTe v en tt ober a i s edandr u nsan yas s oc i at edc al l bac k . Li nk l abel sha vet hef ol l owi ngr es t r i c t i ons :•The ydon' ts uppor tc hangeofbac k gr oundc ol our . •Th eydo n' ts up po r t ' p r e ss ed 'a nd' no tpr e ss ed 'v a l ue .•Th eyc anh av ep op upme nu s, t h ou ght h i si sno tr e c omme nd ed .•Th eydo n' th av eCo nt r o lT y p ese . g .OK,CANCELet c . Cop youtt hef ol l o wi ngi n t oane wfi l eands av ei tasLi nk Label Ex ampl e. pml f r m.Putt hefi l e i nt ot heappr opr i at efi l epat hc : pml t r ai ni ngpml l i bf or msandr emapt hefi l esse t upf or m! ! Li nk Label Ex ampl edi al ogr es i z eabl e! t hi s . f or mTi t l e=| Li nk Label |but t on. but t 1| Par agr aph For m|l i nk l abel f or m! ! Par aEx ampl eex i t10. 8Te xtEnt r yGadge t sAt e xti nputgadge tpr o vi des t h eu s erawa yo fe nt e r i n gas i n gl ev a l u ei n t oPDMS.ATEXTg ad ge ti sd efi n edb y :WI DTH– de t er mi nest h edi s pl a y edn umb erofc har a ct er s .Anop t i onal s c r ol l wi dt hc anal s obes pec i fi ed TYPE–de t er mi ne st het y peoft hev a r i a bl ec r eat edwhe ni nput t i ngav al ue.Thi si si mpo r t ant wh enPMLus e st h ev a r i a bl e .Y ouma ya l s os up pl yaFORMA To bj e c t( e x p l a i n edbe l o w)t o f o r matt h ev al ueent er ed( e. g.wh ol enumb er )Cop youtt hef ol l o wi ngi nt oane wfi l eandsa v e i tasTex t Ex ampl e. pml f r m.Putt hefi l ei nt ot heappr opr i at efil epat hc : pml t r ai ni ngpml l i bf or ms andr emapt hefil es. 49.49.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140149www. avev a. com s et upf or m! ! T ex t Ex ampl e! t hi s . f or mTi t l e=| Te xt |pat hdownt ex t. t x t 1| Val asSt r i ng|wi dt h10 i sSTRI NG t e x t. t x t 2| On l ynu mb er s|wi dt h1 0i sREALf o r mat! ! REALFMTt e x t. t x t 3| Ro und n umb er s|wi d t h10i sREALf o r ma t! ! I NTEGERFMTt e x t. t x t 4| Fo rp as s wo r d s|wi d t h10NOE i sSTRI NG t ex t. t x t 5| Li mi t eds cr ol l |wi dt h10s cr ol l 1i sSTRI NG t ex t. t x t 6| Notedi t abl e|wi dt h 10i sSTRI NG e xi tdefi neme t hod. T ex t Ex ampl e( )-Ma keT ex t6u ned i t abl e! t hi s . t x t 6. v al =| Canno tc hange! |! t h i s . t x t 6. s et Edi t a bl e ( F AL SE)en dme t hodThebene fitofmak i n gat e x t gadgetunedi t abl e( r at hert handeac t i v at ed)i ssot heus erc ans el ec ti t sc ont ent s .Adeac t i v e t e x tbo xwi l l bef ul l gr e y edo utanduns el ec t abl e.Ref ert ot heRe f er en ceMa nua landGui de f ormor eexampl es10. 9For matObj ectAFORMATobj ectmanagest hei nf or mat i onneeded t oc on v er tanu mb er( a l wa y si nmm)t oaSTRI NG.I tc anal s obeus edap pl yaf o r ma tt oat e x t gadget .Af or matobj ec t sar eus ual l ydefi nedasgl obal v ar i abl essot hatt he yar ea vai l abl e a c r o s sPDMS.Fo re x a mp l e ,t y p et h ef o l l o wi n go nt ot h ec o mma ndl i n e:! ! On eDP=o bj e c t FORMAT( )! ! OneDP. dp=1qvar! ! OneDpTher ear ef ourst andar dFORMATobj ect swhi ch ar ea l r ea dyde fin edi ns t an da r dPDMS:! ! Di s t a nc eFmtFord i s t a nc eu ni t s! ! Bor e FmtFo rBo r e Uni t s! ! Real FmtT ogi v eac ons i s t en tl e v el ofdec i mal pl a cesonr eal number s! ! I nt eger FmtT o f o r c er e al n umb er st ob ei n t e ge r s ( 0d pRou nd ed )T ofi ndo utmo r ei n f o r ma t i o na bo utt h es e FORMA To bj e c t ,q ue r yt h em a sgl o ba lv a r i a bl e sont h ec o mma ndl i n eqv ar! ! Bo r e FmtFo r e x amp l et hen umb ero fde c i mal pl a c esdi s pl a y edu si n g! ! Re al Fmtc o ul db es e t! ! Re al Fmt . d p =6t hedef aul tv al uei s2.Thes es t andar df or matobj e ct sar eu sedwi t hi nt hef or msofPDMS. Changi ngt hedefi ni t i onoft h es eo bj ec t swi l l c han get hewa ys t andar dpr od uc tbeha v es . 50.50.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140150www. avev a. com 1 0. 1 0L i s tGa dg et sAL I STg ad ge tp r e s en t san dARRA Yo fv a l u est ot h eu s er .Th i sc a nb ea
SI NGLEorMUL TI -DI MENSI ONALARRAYAl l t heval uesi nt hegadgetar esetbyassi gni ng anARRAY.ARRAYvar i abl escanbeappl i edt oaLI STatanyt i me.Thechoi cebet ween MUL TI PLE,COLUMNandSI NGLEhast obemadewhent hegadgeti sdefi ned.Thev al ues wi t h i naCOL UMNl i s t( h ea di n gsan dv a l u es )a r es e tb yu s i n gb ui l t i ng ad ge tme t h od s.Cop y outt hef ol l owi ngi nt oanewfi l eands av ei tasLi s t Ex ampl e. pml f r m.Putt hefi l ei nt ot he appr opr i at efi l epat hc : pml t r ai ni ngpml l i bf or msandr e mapt hefil ess et upf or m! ! Li s t Ex ampl e! t hi s . f or mTi t l e=| Li s t s |! v shap=| wi dt h15hei ght6|l i s t. l s t 1| Si ngl eAr r ayLi s t |c al l | ! t hi s . v al ue( ) |SI NGLEZEROSEL$! v shapl i s t. l s t 2| Mul t i Sel ec tLi s t |MUL TI$! v shapl i s t. l s t 3| Appendi ngLi s t |c al l | ! t hi s . append( ) |$! v shapl i s t. l s t 4| Mul t i c ol umnLi s t |COL UMNS$! v shap e xi tdefi nemet hod. Li s t Ex ampl e( )-Defi nev al uesc ont ai nedwi t hi nt hel i s t sdo! If r om 1t o5! Dv al ue[ ! I ]=| Number |&! I! Rv al ue[ ! I ]=| <|&! I&| >|do! Jf r om 1t o2! mul t i [ ! I ] [ ! J ]=| c ol |&! J& | ( |&! I&| ) |enddoenddo! t hi s . l s t 1. dt ex t=! Dv al ue! t hi s . l s t 1. r t ex t=! Rv al ue! t hi s . l s t 2. dt ex t=! Dv al ue! s i ngl e[ 1]=| Cl i c kt oappendv al ues |! t hi s . l s t 3. dt ex t=! s i ngl e! t hi s . l s t 4. s et Rows ( ! mul t i )! headi ng[ 1]=| One|! headi ng[ 2]=| T wo|! t hi s . l s t 4. s et Headi ngs ( ! headi ng)endme t hoddefi ne met hod. v al ue( )Pr i ntt heDt e xtandRt e xtv al uest ot hecommandl i ne! dt e xt=! t hi s . l s t 1. s el ec t i on( ' Dt ex t ' )! r t ex t=! t hi s . l s t 1. s el ec t i on( ' Rt ex t ' )$ pSel ec t edDt ex ti s$! ( Rt e xti s$! -hi d den ! )endme t h oddefi neme t hod. append( )-Appendv al uet oLi s t3! nex t Li ne=! t hi s . l s t 3. dt ex t . s i z e( )+1! v al =| Appended|&! nex t Li ne! t hi s . l s t 3. add( ! v al ) Endmet hod 51.51.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140151www. avev a. com Re f e rt ot h eRe f e r e nc eMa nu al a ndGu i d ef o rmo r ee x amp l e s 52.52.AVEVAPl ant( 12Ser i es)Pr ogr ammabl eMacr oLanguage-TM140152www. avev a. com 10. 11Fr ameGadget sAFRAMEi sacosmet i cgadgetwhi chi susedt osur r oundagr oupof s i mi l argadget s .Thi shel pswi t hor gani s at i on,pos i t i oni ngandus ere xper i enc e.Af r amec an al sobedecl ar edasaTABSEToraRGROUP( expl ai nedl at er )andevenaTOOLBAR( when de fi ne df o rt hema i nPDMSwi n do w) .Co pyo utt h ef ol l o wi n gi n t oane wfi l ean ds a v ei ta s Fr ameEx ampl e. pml f r m.Putt hefil ei nt ot heappr opr i at efil epat hc: pml t r ai ni ngpml l i bf or msand r ema pt h efi l ess et upf or m! ! Fr a meEx ampl ed i al ogr es i z eabl e! t hi s . f o r mTi t l e=| Fr ames |f r ame . t a bs e tT ABSETa nc h orAL Lwi d1 5h ei 5f r a me. f 1| Do c k ed |a t00do c kFI L Lf r a me. f A| Do c k Al l |d oc kFI L Lf r a me. f B| Do c kRi g ht |d oc kRI GHTwi d1 0f r a me. f C| Do c kBo t t o m|d oc kBh ei 4e xi te xi te xi te xi tf r ame. f 3| Ot her |at00doc kFI LL! pos=| atx cen. f G -0. 5*s i z ey max | f r ame. f G| Deac t i v e|wi d15hei 4but t on. but 1| T r yandc l i c k! |at11e xi tbut t on. but| Show Fr ame |$! posba ck g8c al l | ! t h i s . s ho wF( ) |f r ame. f H| Hi ddenFr ame|atx mi n. f Gy ma x. b ut 2 wi dt h. f G hei . f Ge xi te xi te xi te xi tdefi nemet hod. Fr ameEx ampl e( )! t hi s . f G. ac t i v e=F AL SE! t hi s . f H. v i s i bl e=F AL SEe nd me t hoddefi neme t ho d. s ho wF( )i f! t hi s . bu t . v al . eq ( TRUE)t hen! t hi s . f H. v i s i bl e=TRUE! t hi s . but . t ag=| Hi deFr ame|el s e! t hi s . f H. v i s i bl e=FALSE! t hi s . but . t ag= | ShowFr ame|endi fendmet hodWhencr eat i ngaFRAMEgadget ,f orever yFRAMEt her e mus tbeanas soc i at edEXI T .I fi ns uffic i ente xi t sar epr o vi ded,t hi swi l l c aus eaner r orandt he f or m wi l l NOTLOAD.Ast heer r oroccur r edi nsi det heFORM DEFI NI TI ON,t hecommand l i newi l l s t i l l bei nf or m defi ni t i onmodeandwi l l notf unc t i onasus ual .T oe xi tt hi smode,t y pe EXI To nt h ec omman dl i n eun t i l a ndERRORi sr e ce i v e d.Th i swi l l me ant ha tf o r md efi ni t i o n mo deha sb ee ne x i t e da ndn or ma lc o mman dswi l l wo r kag ai n.I ti sgoo dp r a c t i s et op r o v i d e2 s pa ce swh enwo r k i n gi n s i deac od eb l o ck .Th i spr o v i de sa ne as ywa yt os po tmi s s i n ge x i t s .