acme-003.awl 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858
  1. DATA_BLOCK DB 1
  2. TITLE =
  3. VERSION : 0.1
  4. STRUCT
  5. HandShake : BOOL ; //Temporary placeholder variable
  6. Profibus_Control : BOOL ;
  7. Alarm_Common : BOOL ;
  8. Central_Local : BOOL ;
  9. Feedback_Run : BOOL ;
  10. Profibus_Alarm : BOOL ;
  11. Spare_06 : BOOL ;
  12. Spare_07 : BOOL ;
  13. Rapping_51_Local : BOOL ;
  14. Spare_011 : BOOL ;
  15. Rapping_51_Return : BOOL ;
  16. Rapping_51_Ready : BOOL ;
  17. Rapping_52_Local : BOOL ;
  18. Spare_015 : BOOL ;
  19. Rapping_52_Return : BOOL ;
  20. Rapping_52_Ready : BOOL ;
  21. Rapping_53_Local : BOOL ;
  22. Spare_021 : BOOL ;
  23. Rapping_53_Return : BOOL ;
  24. Rapping_53_Ready : BOOL ;
  25. Rapping_61_Local : BOOL ;
  26. Spare_025 : BOOL ;
  27. Rapping_61_Return : BOOL ;
  28. Rapping_61_Ready : BOOL ;
  29. Rapping_62_Local : BOOL ;
  30. Spare_031 : BOOL ;
  31. Rapping_62_Return : BOOL ;
  32. Rapping_62_Ready : BOOL ;
  33. Rapping_63_Local : BOOL ;
  34. Spare_035 : BOOL ;
  35. Rapping_63_Return : BOOL ;
  36. Rapping_63_Ready : BOOL ;
  37. Rotary_71_Local : BOOL ;
  38. Rotary_71_Speed : BOOL ;
  39. Rotary_71_Return : BOOL ;
  40. Rotary_71_Ready : BOOL ;
  41. Rotary_72_Local : BOOL ;
  42. Rotary_72_Speed : BOOL ;
  43. Rotary_72_Return : BOOL ;
  44. Rotary_72_Ready : BOOL ;
  45. Rotary_81_Local : BOOL ;
  46. Rotary_81_Speed : BOOL ;
  47. Rotary_81_Return : BOOL ;
  48. Rotary_81_Ready : BOOL ;
  49. Rotary_82_Local : BOOL ;
  50. Rotary_82_Speed : BOOL ;
  51. Rotary_82_Return : BOOL ;
  52. Rotary_82_Ready : BOOL ;
  53. Circuit_Breaker_C1 : BOOL ;
  54. Circuit_Breaker_c2 : BOOL ;
  55. Trans_1_Ready : BOOL ;
  56. Trans_1_Fault : BOOL ;
  57. Trans_1_Return : BOOL ;
  58. Trans_2_Ready : BOOL ;
  59. Trans_2_Fault : BOOL ;
  60. Trans_2_Return : BOOL ;
  61. Trans_3_Ready : BOOL ;
  62. Trans_3_Fault : BOOL ;
  63. Trans_3_Return : BOOL ;
  64. spare8_9 : INT ;
  65. Field_1_KV : INT ;
  66. Field_1_mA : INT ;
  67. Field_2_KV : INT ;
  68. Field_2_mA : INT ;
  69. Field_3_KV : INT ;
  70. Field_3_mA : INT ;
  71. END_STRUCT ;
  72. BEGIN
  73. HandShake := FALSE;
  74. Profibus_Control := FALSE;
  75. Alarm_Common := FALSE;
  76. Central_Local := FALSE;
  77. Feedback_Run := FALSE;
  78. Profibus_Alarm := FALSE;
  79. Spare_06 := FALSE;
  80. Spare_07 := FALSE;
  81. Rapping_51_Local := FALSE;
  82. Spare_011 := FALSE;
  83. Rapping_51_Return := FALSE;
  84. Rapping_51_Ready := FALSE;
  85. Rapping_52_Local := FALSE;
  86. Spare_015 := FALSE;
  87. Rapping_52_Return := FALSE;
  88. Rapping_52_Ready := FALSE;
  89. Rapping_53_Local := FALSE;
  90. Spare_021 := FALSE;
  91. Rapping_53_Return := FALSE;
  92. Rapping_53_Ready := FALSE;
  93. Rapping_61_Local := FALSE;
  94. Spare_025 := FALSE;
  95. Rapping_61_Return := FALSE;
  96. Rapping_61_Ready := FALSE;
  97. Rapping_62_Local := FALSE;
  98. Spare_031 := FALSE;
  99. Rapping_62_Return := FALSE;
  100. Rapping_62_Ready := FALSE;
  101. Rapping_63_Local := FALSE;
  102. Spare_035 := FALSE;
  103. Rapping_63_Return := FALSE;
  104. Rapping_63_Ready := FALSE;
  105. Rotary_71_Local := FALSE;
  106. Rotary_71_Speed := FALSE;
  107. Rotary_71_Return := FALSE;
  108. Rotary_71_Ready := FALSE;
  109. Rotary_72_Local := FALSE;
  110. Rotary_72_Speed := FALSE;
  111. Rotary_72_Return := FALSE;
  112. Rotary_72_Ready := FALSE;
  113. Rotary_81_Local := FALSE;
  114. Rotary_81_Speed := FALSE;
  115. Rotary_81_Return := FALSE;
  116. Rotary_81_Ready := FALSE;
  117. Rotary_82_Local := FALSE;
  118. Rotary_82_Speed := FALSE;
  119. Rotary_82_Return := FALSE;
  120. Rotary_82_Ready := FALSE;
  121. Circuit_Breaker_C1 := FALSE;
  122. Circuit_Breaker_c2 := FALSE;
  123. Trans_1_Ready := FALSE;
  124. Trans_1_Fault := FALSE;
  125. Trans_1_Return := FALSE;
  126. Trans_2_Ready := FALSE;
  127. Trans_2_Fault := FALSE;
  128. Trans_2_Return := FALSE;
  129. Trans_3_Ready := FALSE;
  130. Trans_3_Fault := FALSE;
  131. Trans_3_Return := FALSE;
  132. spare8_9 := 0;
  133. Field_1_KV := 0;
  134. Field_1_mA := 0;
  135. Field_2_KV := 0;
  136. Field_2_mA := 0;
  137. Field_3_KV := 0;
  138. Field_3_mA := 0;
  139. END_DATA_BLOCK
  140. DATA_BLOCK DB 2
  141. TITLE =
  142. VERSION : 0.1
  143. STRUCT
  144. Emergency_Stop_71 : BOOL ;
  145. Speed_Switch_71 : BOOL ;
  146. Contactor_FB_71 : BOOL ;
  147. Circuit_Breaker_71 : BOOL ;
  148. Emergency_Stop_72 : BOOL ;
  149. Speed_Switch_72 : BOOL ;
  150. Contactor_FB_72 : BOOL ;
  151. Circuit_Breaker_72 : BOOL ;
  152. Emergency_Stop_81 : BOOL ;
  153. Speed_Switch_81 : BOOL ;
  154. Contactor_FB_81 : BOOL ;
  155. Circuit_Breaker_81 : BOOL ;
  156. Emergency_Stop_82 : BOOL ;
  157. Speed_Switch_82 : BOOL ;
  158. Contactor_FB_82 : BOOL ;
  159. Circuit_Breaker_82 : BOOL ;
  160. Emergency_Stop_51 : BOOL ;
  161. Contactor_FB_51 : BOOL ;
  162. Circuit_Breaker_51 : BOOL ;
  163. Emergency_Stop_52 : BOOL ;
  164. Contactor_FB_52 : BOOL ;
  165. Circuit_Breaker_52 : BOOL ;
  166. Emergency_Stop_53 : BOOL ;
  167. Contactor_FB_53 : BOOL ;
  168. Circuit_Breaker_53 : BOOL ;
  169. Emergency_Stop_61 : BOOL ;
  170. Contactor_FB_61 : BOOL ;
  171. Circuit_Breaker_61 : BOOL ;
  172. Emergency_Stop_62 : BOOL ;
  173. Contactor_FB_62 : BOOL ;
  174. Circuit_Breaker_62 : BOOL ;
  175. Emergency_Stop_63 : BOOL ;
  176. Contactor_FB_63 : BOOL ;
  177. Circuit_Breaker_63 : BOOL ;
  178. Circuit_Breaker_C1_Alarm : BOOL ;
  179. SPARE_1 : BOOL ;
  180. SPARE_2 : BOOL ;
  181. Circuit_Breaker_C4_Alarm : BOOL ;
  182. PROFIBUS_ALARM : BOOL ;
  183. END_STRUCT ;
  184. BEGIN
  185. Emergency_Stop_71 := FALSE;
  186. Speed_Switch_71 := FALSE;
  187. Contactor_FB_71 := FALSE;
  188. Circuit_Breaker_71 := FALSE;
  189. Emergency_Stop_72 := FALSE;
  190. Speed_Switch_72 := FALSE;
  191. Contactor_FB_72 := FALSE;
  192. Circuit_Breaker_72 := FALSE;
  193. Emergency_Stop_81 := FALSE;
  194. Speed_Switch_81 := FALSE;
  195. Contactor_FB_81 := FALSE;
  196. Circuit_Breaker_81 := FALSE;
  197. Emergency_Stop_82 := FALSE;
  198. Speed_Switch_82 := FALSE;
  199. Contactor_FB_82 := FALSE;
  200. Circuit_Breaker_82 := FALSE;
  201. Emergency_Stop_51 := FALSE;
  202. Contactor_FB_51 := FALSE;
  203. Circuit_Breaker_51 := FALSE;
  204. Emergency_Stop_52 := FALSE;
  205. Contactor_FB_52 := FALSE;
  206. Circuit_Breaker_52 := FALSE;
  207. Emergency_Stop_53 := FALSE;
  208. Contactor_FB_53 := FALSE;
  209. Circuit_Breaker_53 := FALSE;
  210. Emergency_Stop_61 := FALSE;
  211. Contactor_FB_61 := FALSE;
  212. Circuit_Breaker_61 := FALSE;
  213. Emergency_Stop_62 := FALSE;
  214. Contactor_FB_62 := FALSE;
  215. Circuit_Breaker_62 := FALSE;
  216. Emergency_Stop_63 := FALSE;
  217. Contactor_FB_63 := FALSE;
  218. Circuit_Breaker_63 := FALSE;
  219. Circuit_Breaker_C1_Alarm := FALSE;
  220. SPARE_1 := FALSE;
  221. SPARE_2 := FALSE;
  222. Circuit_Breaker_C4_Alarm := FALSE;
  223. PROFIBUS_ALARM := FALSE;
  224. END_DATA_BLOCK
  225. FUNCTION_BLOCK FB 1
  226. TITLE =One Way Motor
  227. VERSION : 0.1
  228. VAR_INPUT
  229. Central_Local : BOOL ;
  230. LB_Start : BOOL ;
  231. LB_Stop : BOOL ;
  232. Emergency_Stop : BOOL ;
  233. Single_Start : BOOL ;
  234. Group_Start : BOOL ;
  235. Group_Stop : BOOL ;
  236. Interlock : BOOL ;
  237. Speed_Switch : BOOL ;
  238. Contactor : BOOL ;
  239. Circuit_Breaker : BOOL ;
  240. Clock : BOOL ;
  241. reset : BOOL ;
  242. Delay_Time : TIMER ;
  243. Group_ON_Timer : TIMER ;
  244. ON_Delay : S5TIME ;
  245. Group_Off_Timer : TIMER ;
  246. Off_Delay : S5TIME ;
  247. END_VAR
  248. VAR_OUTPUT
  249. Speed_Switch_Fault : BOOL ;
  250. Contactor_Fault : BOOL ;
  251. CB_Fault : BOOL ;
  252. Interlock_Fault : BOOL ;
  253. Warning : BOOL ;
  254. Common_Alarm : BOOL ;
  255. Motor_ON : BOOL ;
  256. END_VAR
  257. VAR
  258. Temp1 : BOOL ;
  259. temp2 : BOOL ;
  260. temp3 : BOOL ;
  261. temp4 : BOOL ;
  262. temp5 : BOOL ;
  263. temp6 : BOOL ;
  264. temp7 : BOOL ;
  265. temp8 : BOOL ;
  266. temp9 : BOOL ;
  267. temp10 : BOOL ;
  268. temp11 : BOOL ;
  269. temp12 : BOOL ;
  270. temp13 : BOOL ;
  271. END_VAR
  272. BEGIN
  273. NETWORK
  274. TITLE =
  275. //If System Change to Local Mode then Motor Turn Off
  276. AN #Central_Local;
  277. FP #temp7;
  278. R #Temp1;
  279. NETWORK
  280. TITLE =Start by Local Box
  281. A #Emergency_Stop;
  282. AN #Central_Local;
  283. A #LB_Start;
  284. S #Temp1;
  285. A( ;
  286. ON #Emergency_Stop;
  287. O ;
  288. AN #Central_Local;
  289. AN #LB_Stop;
  290. O #temp8;
  291. ) ;
  292. R #Temp1;
  293. A #Temp1;
  294. = #Motor_ON;
  295. NETWORK
  296. TITLE =Start Single
  297. A #Emergency_Stop;
  298. A #Central_Local;
  299. A #Single_Start;
  300. S #Temp1;
  301. A( ;
  302. ON #Emergency_Stop;
  303. O( ;
  304. AN #Single_Start;
  305. FP #temp11;
  306. A #Central_Local;
  307. ) ;
  308. O #temp8;
  309. ) ;
  310. R #Temp1;
  311. A #Temp1;
  312. = #Motor_ON;
  313. NETWORK
  314. TITLE =
  315. A #Interlock;
  316. A #Central_Local;
  317. A #Group_Start;
  318. L #ON_Delay;
  319. SD #Group_ON_Timer;
  320. NETWORK
  321. TITLE =
  322. A #Central_Local;
  323. A( ;
  324. O #Group_Stop;
  325. O #Group_Start;
  326. ) ;
  327. L #Off_Delay;
  328. SF #Group_Off_Timer;
  329. NETWORK
  330. TITLE =
  331. A #Group_ON_Timer;
  332. A #Emergency_Stop;
  333. S #Temp1;
  334. A( ;
  335. ON #Emergency_Stop;
  336. O( ;
  337. AN #Group_Off_Timer;
  338. FP #temp12;
  339. ) ;
  340. O ;
  341. AN #Single_Start;
  342. A #Common_Alarm;
  343. A #Central_Local;
  344. ) ;
  345. R #Temp1;
  346. A #Temp1;
  347. = #Motor_ON;
  348. NETWORK
  349. TITLE =Delay for Checking Feedback
  350. A #Motor_ON;
  351. L S5T#5S;
  352. SD #Delay_Time;
  353. NETWORK
  354. TITLE =Checking Contactor Feedback
  355. AN #Contactor;
  356. A #Delay_Time;
  357. A #Motor_ON;
  358. S #temp3;
  359. A #reset;
  360. R #temp3;
  361. A #temp3;
  362. = #Contactor_Fault;
  363. NETWORK
  364. TITLE =Checking Speed Switch Feedback
  365. AN #Speed_Switch;
  366. A #Delay_Time;
  367. A #Motor_ON;
  368. S #temp4;
  369. A #reset;
  370. R #temp4;
  371. A #temp4;
  372. = #Speed_Switch_Fault;
  373. NETWORK
  374. TITLE =Checking Circuit Breaker Feedback
  375. A #Circuit_Breaker;
  376. S #temp5;
  377. A #reset;
  378. R #temp5;
  379. A #temp5;
  380. = #CB_Fault;
  381. NETWORK
  382. TITLE =Checking Interlocking
  383. AN #Interlock;
  384. A #Motor_ON;
  385. S #temp6;
  386. A #reset;
  387. R #temp6;
  388. A #temp6;
  389. = #Interlock_Fault;
  390. NETWORK
  391. TITLE =Make Common Alarm
  392. //If System in Central Mode Dont Check Interlock
  393. O #Contactor_Fault;
  394. O #Speed_Switch_Fault;
  395. O #CB_Fault;
  396. = #temp8;
  397. NETWORK
  398. TITLE =
  399. A #Interlock_Fault;
  400. A #Central_Local;
  401. O #temp8;
  402. = #Common_Alarm;
  403. NETWORK
  404. TITLE =Blancking Alarm
  405. A( ;
  406. O #Common_Alarm;
  407. ON #Emergency_Stop;
  408. ) ;
  409. A #Clock;
  410. = #Warning;
  411. END_FUNCTION_BLOCK
  412. DATA_BLOCK DB 71
  413. TITLE =
  414. VERSION : 0.0
  415. FB 1
  416. BEGIN
  417. Central_Local := FALSE;
  418. LB_Start := FALSE;
  419. LB_Stop := FALSE;
  420. Emergency_Stop := FALSE;
  421. Single_Start := FALSE;
  422. Group_Start := FALSE;
  423. Group_Stop := FALSE;
  424. Interlock := FALSE;
  425. Speed_Switch := FALSE;
  426. Contactor := FALSE;
  427. Circuit_Breaker := FALSE;
  428. Clock := FALSE;
  429. reset := FALSE;
  430. Delay_Time := T 0;
  431. Group_ON_Timer := T 0;
  432. ON_Delay := S5T#0MS;
  433. Group_Off_Timer := T 0;
  434. Off_Delay := S5T#0MS;
  435. Speed_Switch_Fault := FALSE;
  436. Contactor_Fault := FALSE;
  437. CB_Fault := FALSE;
  438. Interlock_Fault := FALSE;
  439. Warning := FALSE;
  440. Common_Alarm := FALSE;
  441. Motor_ON := FALSE;
  442. Temp1 := FALSE;
  443. temp2 := FALSE;
  444. temp3 := FALSE;
  445. temp4 := FALSE;
  446. temp5 := FALSE;
  447. temp6 := FALSE;
  448. temp7 := FALSE;
  449. temp8 := FALSE;
  450. temp9 := FALSE;
  451. temp10 := FALSE;
  452. temp11 := FALSE;
  453. temp12 := FALSE;
  454. temp13 := FALSE;
  455. END_DATA_BLOCK
  456. DATA_BLOCK DB 72
  457. TITLE =
  458. VERSION : 0.0
  459. FB 1
  460. BEGIN
  461. Central_Local := FALSE;
  462. LB_Start := FALSE;
  463. LB_Stop := FALSE;
  464. Emergency_Stop := FALSE;
  465. Single_Start := FALSE;
  466. Group_Start := FALSE;
  467. Group_Stop := FALSE;
  468. Interlock := FALSE;
  469. Speed_Switch := FALSE;
  470. Contactor := FALSE;
  471. Circuit_Breaker := FALSE;
  472. Clock := FALSE;
  473. reset := FALSE;
  474. Delay_Time := T 0;
  475. Group_ON_Timer := T 0;
  476. ON_Delay := S5T#0MS;
  477. Group_Off_Timer := T 0;
  478. Off_Delay := S5T#0MS;
  479. Speed_Switch_Fault := FALSE;
  480. Contactor_Fault := FALSE;
  481. CB_Fault := FALSE;
  482. Interlock_Fault := FALSE;
  483. Warning := FALSE;
  484. Common_Alarm := FALSE;
  485. Motor_ON := FALSE;
  486. Temp1 := FALSE;
  487. temp2 := FALSE;
  488. temp3 := FALSE;
  489. temp4 := FALSE;
  490. temp5 := FALSE;
  491. temp6 := FALSE;
  492. temp7 := FALSE;
  493. temp8 := FALSE;
  494. temp9 := FALSE;
  495. temp10 := FALSE;
  496. temp11 := FALSE;
  497. temp12 := FALSE;
  498. temp13 := FALSE;
  499. END_DATA_BLOCK
  500. DATA_BLOCK DB 81
  501. TITLE =
  502. VERSION : 0.0
  503. FB 1
  504. BEGIN
  505. Central_Local := FALSE;
  506. LB_Start := FALSE;
  507. LB_Stop := FALSE;
  508. Emergency_Stop := FALSE;
  509. Single_Start := FALSE;
  510. Group_Start := FALSE;
  511. Group_Stop := FALSE;
  512. Interlock := FALSE;
  513. Speed_Switch := FALSE;
  514. Contactor := FALSE;
  515. Circuit_Breaker := FALSE;
  516. Clock := FALSE;
  517. reset := FALSE;
  518. Delay_Time := T 0;
  519. Group_ON_Timer := T 0;
  520. ON_Delay := S5T#0MS;
  521. Group_Off_Timer := T 0;
  522. Off_Delay := S5T#0MS;
  523. Speed_Switch_Fault := FALSE;
  524. Contactor_Fault := FALSE;
  525. CB_Fault := FALSE;
  526. Interlock_Fault := FALSE;
  527. Warning := FALSE;
  528. Common_Alarm := FALSE;
  529. Motor_ON := FALSE;
  530. Temp1 := FALSE;
  531. temp2 := FALSE;
  532. temp3 := FALSE;
  533. temp4 := FALSE;
  534. temp5 := FALSE;
  535. temp6 := FALSE;
  536. temp7 := FALSE;
  537. temp8 := FALSE;
  538. temp9 := FALSE;
  539. temp10 := FALSE;
  540. temp11 := FALSE;
  541. temp12 := FALSE;
  542. temp13 := FALSE;
  543. END_DATA_BLOCK
  544. DATA_BLOCK DB 82
  545. TITLE =
  546. VERSION : 0.0
  547. FB 1
  548. BEGIN
  549. Central_Local := FALSE;
  550. LB_Start := FALSE;
  551. LB_Stop := FALSE;
  552. Emergency_Stop := FALSE;
  553. Single_Start := FALSE;
  554. Group_Start := FALSE;
  555. Group_Stop := FALSE;
  556. Interlock := FALSE;
  557. Speed_Switch := FALSE;
  558. Contactor := FALSE;
  559. Circuit_Breaker := FALSE;
  560. Clock := FALSE;
  561. reset := FALSE;
  562. Delay_Time := T 0;
  563. Group_ON_Timer := T 0;
  564. ON_Delay := S5T#0MS;
  565. Group_Off_Timer := T 0;
  566. Off_Delay := S5T#0MS;
  567. Speed_Switch_Fault := FALSE;
  568. Contactor_Fault := FALSE;
  569. CB_Fault := FALSE;
  570. Interlock_Fault := FALSE;
  571. Warning := FALSE;
  572. Common_Alarm := FALSE;
  573. Motor_ON := FALSE;
  574. Temp1 := FALSE;
  575. temp2 := FALSE;
  576. temp3 := FALSE;
  577. temp4 := FALSE;
  578. temp5 := FALSE;
  579. temp6 := FALSE;
  580. temp7 := FALSE;
  581. temp8 := FALSE;
  582. temp9 := FALSE;
  583. temp10 := FALSE;
  584. temp11 := FALSE;
  585. temp12 := FALSE;
  586. temp13 := FALSE;
  587. END_DATA_BLOCK
  588. FUNCTION_BLOCK FB 3
  589. TITLE =Rapping Motor
  590. VERSION : 0.1
  591. VAR_INPUT
  592. Central_Local : BOOL ;
  593. LB_Start : BOOL ;
  594. LB_Stop : BOOL ;
  595. Emergency_Stop : BOOL ;
  596. Single_Start : BOOL ;
  597. Sequential_Start : BOOL ;
  598. Contactor : BOOL ;
  599. Circuit_Breaker : BOOL ;
  600. Clock : BOOL ;
  601. reset : BOOL ;
  602. Synchronize : BOOL ;
  603. Delay_Time : TIMER ;
  604. ON_Timer_1 : TIMER ;
  605. ON_Time_1 : INT ;
  606. Off_Timer_1 : TIMER ;
  607. Off_Time_1 : INT ;
  608. ON_Timer_2 : TIMER ;
  609. ON_Time_2 : INT ;
  610. Off_Timer_2 : TIMER ;
  611. Off_Time_2 : INT ;
  612. END_VAR
  613. VAR_OUTPUT
  614. Contactor_Fault : BOOL ;
  615. CB_Fault : BOOL ;
  616. Warning : BOOL ;
  617. Common_Alarm : BOOL ;
  618. Motor_ON : BOOL ;
  619. END_VAR
  620. VAR
  621. Temp1 : BOOL ;
  622. temp2 : BOOL ;
  623. temp3 : BOOL ;
  624. temp4 : BOOL ;
  625. temp5 : BOOL ;
  626. temp6 : BOOL ;
  627. temp7 : BOOL ;
  628. temp8 : BOOL ;
  629. temp9 : WORD ;
  630. temp10 : WORD ;
  631. temp11 : WORD ;
  632. temp12 : WORD ;
  633. temp13 : BOOL ;
  634. END_VAR
  635. VAR_TEMP
  636. TempS5 : S5TIME ;
  637. temp : INT ;
  638. END_VAR
  639. BEGIN
  640. NETWORK
  641. TITLE =
  642. //If System Change to Local Mode then Motor Turn Off
  643. AN #Central_Local;
  644. FP #temp2;
  645. R #Temp1;
  646. NETWORK
  647. TITLE =Start by Local Box
  648. A #Emergency_Stop;
  649. AN #Common_Alarm;
  650. AN #Central_Local;
  651. A #LB_Start;
  652. S #Temp1;
  653. A( ;
  654. ON #Emergency_Stop;
  655. O ;
  656. AN #Central_Local;
  657. AN #LB_Stop;
  658. O #Common_Alarm;
  659. ) ;
  660. R #Temp1;
  661. A #Temp1;
  662. = #Motor_ON;
  663. NETWORK
  664. TITLE =Start Single
  665. A #Emergency_Stop;
  666. AN #Common_Alarm;
  667. A #Central_Local;
  668. A #Single_Start;
  669. S #Temp1;
  670. A( ;
  671. ON #Emergency_Stop;
  672. O( ;
  673. AN #Single_Start;
  674. FP #temp3;
  675. A #Central_Local;
  676. ) ;
  677. O #Common_Alarm;
  678. ) ;
  679. R #Temp1;
  680. A #Temp1;
  681. = #Motor_ON;
  682. NETWORK
  683. TITLE =
  684. A #Motor_ON;
  685. L S5T#5S;
  686. SD #Delay_Time;
  687. NETWORK
  688. TITLE =
  689. A #Motor_ON;
  690. A #Delay_Time;
  691. AN #Contactor;
  692. S #Contactor_Fault;
  693. A #reset;
  694. R #Contactor_Fault;
  695. NOP 0;
  696. NETWORK
  697. TITLE =
  698. A #Circuit_Breaker;
  699. S #CB_Fault;
  700. A #reset;
  701. R #CB_Fault;
  702. NOP 0;
  703. NETWORK
  704. TITLE =
  705. ON #Emergency_Stop;
  706. O #Contactor_Fault;
  707. O #CB_Fault;
  708. = L 4.0;
  709. A L 4.0;
  710. BLD 102;
  711. = #Common_Alarm;
  712. A L 4.0;
  713. A #Clock;
  714. = #Warning;
  715. NETWORK
  716. TITLE =
  717. L #ON_Time_1;
  718. L 999;
  719. >=I ;
  720. = L 4.0;
  721. A( ;
  722. A( ;
  723. A L 4.0;
  724. JNB _001;
  725. L #ON_Time_1;
  726. L 10;
  727. /I ;
  728. T #temp;
  729. AN OV;
  730. SAVE ;
  731. CLR ;
  732. _001: A BR;
  733. ) ;
  734. JNB _002;
  735. L #temp;
  736. ITB ;
  737. T #temp9;
  738. AN OV;
  739. SAVE ;
  740. CLR ;
  741. _002: A BR;
  742. ) ;
  743. JNB _003;
  744. L #temp9;
  745. L W#16#3000;
  746. OW ;
  747. T #temp9;
  748. _003: NOP 0;
  749. A( ;
  750. AN L 4.0;
  751. JNB _004;
  752. L #ON_Time_1;
  753. ITB ;
  754. T #temp9;
  755. AN OV;
  756. SAVE ;
  757. CLR ;
  758. _004: A BR;
  759. ) ;
  760. JNB _005;
  761. L #temp9;
  762. L W#16#2000;
  763. OW ;
  764. T #temp9;
  765. _005: NOP 0;
  766. NETWORK
  767. TITLE =
  768. L #Off_Time_1;
  769. L 999;
  770. >=I ;
  771. = L 4.0;
  772. A( ;
  773. A( ;
  774. A L 4.0;
  775. JNB _006;
  776. L #Off_Time_1;
  777. L 10;
  778. /I ;
  779. T #temp;
  780. AN OV;
  781. SAVE ;
  782. CLR ;
  783. _006: A BR;
  784. ) ;
  785. JNB _007;
  786. L #temp;
  787. ITB ;
  788. T #temp10;
  789. AN OV;
  790. SAVE ;
  791. CLR ;
  792. _007: A BR;
  793. ) ;
  794. JNB _008;
  795. L #temp10;
  796. L W#16#3000;
  797. OW ;
  798. T #temp10;
  799. _008: NOP 0;
  800. A( ;
  801. AN L 4.0;
  802. JNB _009;
  803. L #Off_Time_1;
  804. ITB ;
  805. T #temp10;
  806. AN OV;
  807. SAVE ;
  808. CLR ;
  809. _009: A BR;
  810. ) ;
  811. JNB _00a;
  812. L #temp10;
  813. L W#16#2000;
  814. OW ;
  815. T #temp10;
  816. _00a: NOP 0;
  817. NETWORK
  818. TITLE =
  819. L #ON_Time_2;
  820. L 999;
  821. >=I ;
  822. = L 4.0;
  823. A( ;
  824. A( ;
  825. A L 4.0;
  826. JNB _00b;
  827. L #ON_Time_2;
  828. L 10;
  829. /I ;
  830. T #temp;
  831. AN OV;
  832. SAVE ;
  833. CLR ;
  834. _00b: A BR;
  835. ) ;
  836. JNB _00c;
  837. L #temp;
  838. ITB ;
  839. T #temp11;
  840. AN OV;
  841. SAVE ;
  842. CLR ;
  843. _00c: A BR;
  844. ) ;
  845. JNB _00d;
  846. L #temp11;
  847. L W#16#3000;
  848. OW ;
  849. T #temp11;
  850. _00d: NOP 0;
  851. A( ;
  852. AN L 4.0;
  853. JNB _00e;
  854. L #ON_Time_2;
  855. ITB ;
  856. T #temp11;
  857. AN OV;
  858. SAVE ;
  859. CLR ;
  860. _00e: A BR;
  861. ) ;
  862. JNB _00f;
  863. L #temp11;
  864. L W#16#2000;
  865. OW ;
  866. T #temp11;
  867. _00f: NOP 0;
  868. NETWORK
  869. TITLE =
  870. L #Off_Time_2;
  871. L 999;
  872. >=I ;
  873. = L 4.0;
  874. A( ;
  875. A( ;
  876. A L 4.0;
  877. JNB _010;
  878. L #Off_Time_2;
  879. L 10;
  880. /I ;
  881. T #temp;
  882. AN OV;
  883. SAVE ;
  884. CLR ;
  885. _010: A BR;
  886. ) ;
  887. JNB _011;
  888. L #temp;
  889. ITB ;
  890. T #temp12;
  891. AN OV;
  892. SAVE ;
  893. CLR ;
  894. _011: A BR;
  895. ) ;
  896. JNB _012;
  897. L #temp12;
  898. L W#16#3000;
  899. OW ;
  900. T #temp12;
  901. _012: NOP 0;
  902. A( ;
  903. AN L 4.0;
  904. JNB _013;
  905. L #Off_Time_2;
  906. ITB ;
  907. T #temp12;
  908. AN OV;
  909. SAVE ;
  910. CLR ;
  911. _013: A BR;
  912. ) ;
  913. JNB _014;
  914. L #temp12;
  915. L W#16#2000;
  916. OW ;
  917. T #temp12;
  918. _014: NOP 0;
  919. NETWORK
  920. TITLE =
  921. A #Synchronize;
  922. FP #temp8;
  923. NOT ;
  924. AN #Off_Timer_2;
  925. A #Central_Local;
  926. A #Sequential_Start;
  927. = #temp4;
  928. NETWORK
  929. TITLE =
  930. L #temp9;
  931. T #TempS5;
  932. NOP 0;
  933. NETWORK
  934. TITLE =
  935. A #temp4;
  936. L #TempS5;
  937. SD #ON_Timer_1;
  938. NETWORK
  939. TITLE =
  940. A #ON_Timer_1;
  941. A #Central_Local;
  942. A #Sequential_Start;
  943. = #temp5;
  944. NETWORK
  945. TITLE =
  946. L #temp10;
  947. T #TempS5;
  948. NOP 0;
  949. NETWORK
  950. TITLE =
  951. A #temp5;
  952. L #TempS5;
  953. SD #Off_Timer_1;
  954. NETWORK
  955. TITLE =
  956. A #Off_Timer_1;
  957. A #Central_Local;
  958. A #Sequential_Start;
  959. = #temp6;
  960. NETWORK
  961. TITLE =
  962. L #temp11;
  963. T #TempS5;
  964. NOP 0;
  965. NETWORK
  966. TITLE =
  967. A #temp6
  968. L #temp11
  969. SD #ON_Timer_2
  970. A #temp6;
  971. L #TempS5;
  972. SD #ON_Timer_2;
  973. NETWORK
  974. TITLE =
  975. A #ON_Timer_2;
  976. A #Central_Local;
  977. A #Sequential_Start;
  978. = #temp7;
  979. NETWORK
  980. TITLE =
  981. L #temp12;
  982. T #TempS5;
  983. NOP 0;
  984. NETWORK
  985. TITLE =
  986. A #temp7;
  987. L #TempS5;
  988. SD #Off_Timer_2;
  989. NETWORK
  990. TITLE =
  991. A #Synchronize;
  992. FP #temp13;
  993. JC next;
  994. NETWORK
  995. TITLE =
  996. A #Central_Local;
  997. A #Emergency_Stop;
  998. A #Sequential_Start;
  999. A( ;
  1000. A( ;
  1001. X #ON_Timer_1;
  1002. X #Off_Timer_1;
  1003. ) ;
  1004. NOT ;
  1005. ) ;
  1006. AN #ON_Timer_2;
  1007. O #Temp1;
  1008. = #Motor_ON;
  1009. NETWORK
  1010. TITLE =
  1011. next: A #temp13;
  1012. = #temp13;
  1013. END_FUNCTION_BLOCK
  1014. DATA_BLOCK DB 51
  1015. TITLE =
  1016. VERSION : 0.0
  1017. FB 3
  1018. BEGIN
  1019. Central_Local := FALSE;
  1020. LB_Start := FALSE;
  1021. LB_Stop := FALSE;
  1022. Emergency_Stop := FALSE;
  1023. Single_Start := FALSE;
  1024. Sequential_Start := FALSE;
  1025. Contactor := FALSE;
  1026. Circuit_Breaker := FALSE;
  1027. Clock := FALSE;
  1028. reset := FALSE;
  1029. Synchronize := FALSE;
  1030. Delay_Time := T 0;
  1031. ON_Timer_1 := T 0;
  1032. ON_Time_1 := 0;
  1033. Off_Timer_1 := T 0;
  1034. Off_Time_1 := 0;
  1035. ON_Timer_2 := T 0;
  1036. ON_Time_2 := 0;
  1037. Off_Timer_2 := T 0;
  1038. Off_Time_2 := 0;
  1039. Contactor_Fault := FALSE;
  1040. CB_Fault := FALSE;
  1041. Warning := FALSE;
  1042. Common_Alarm := FALSE;
  1043. Motor_ON := FALSE;
  1044. Temp1 := FALSE;
  1045. temp2 := FALSE;
  1046. temp3 := FALSE;
  1047. temp4 := FALSE;
  1048. temp5 := FALSE;
  1049. temp6 := FALSE;
  1050. temp7 := FALSE;
  1051. temp8 := FALSE;
  1052. temp9 := W#16#0;
  1053. temp10 := W#16#0;
  1054. temp11 := W#16#0;
  1055. temp12 := W#16#0;
  1056. temp13 := FALSE;
  1057. END_DATA_BLOCK
  1058. DATA_BLOCK DB 52
  1059. TITLE =
  1060. VERSION : 0.0
  1061. FB 3
  1062. BEGIN
  1063. Central_Local := FALSE;
  1064. LB_Start := FALSE;
  1065. LB_Stop := FALSE;
  1066. Emergency_Stop := FALSE;
  1067. Single_Start := FALSE;
  1068. Sequential_Start := FALSE;
  1069. Contactor := FALSE;
  1070. Circuit_Breaker := FALSE;
  1071. Clock := FALSE;
  1072. reset := FALSE;
  1073. Synchronize := FALSE;
  1074. Delay_Time := T 0;
  1075. ON_Timer_1 := T 0;
  1076. ON_Time_1 := 0;
  1077. Off_Timer_1 := T 0;
  1078. Off_Time_1 := 0;
  1079. ON_Timer_2 := T 0;
  1080. ON_Time_2 := 0;
  1081. Off_Timer_2 := T 0;
  1082. Off_Time_2 := 0;
  1083. Contactor_Fault := FALSE;
  1084. CB_Fault := FALSE;
  1085. Warning := FALSE;
  1086. Common_Alarm := FALSE;
  1087. Motor_ON := FALSE;
  1088. Temp1 := FALSE;
  1089. temp2 := FALSE;
  1090. temp3 := FALSE;
  1091. temp4 := FALSE;
  1092. temp5 := FALSE;
  1093. temp6 := FALSE;
  1094. temp7 := FALSE;
  1095. temp8 := FALSE;
  1096. temp9 := W#16#0;
  1097. temp10 := W#16#0;
  1098. temp11 := W#16#0;
  1099. temp12 := W#16#0;
  1100. temp13 := FALSE;
  1101. END_DATA_BLOCK
  1102. DATA_BLOCK DB 53
  1103. TITLE =
  1104. VERSION : 0.0
  1105. FB 3
  1106. BEGIN
  1107. Central_Local := FALSE;
  1108. LB_Start := FALSE;
  1109. LB_Stop := FALSE;
  1110. Emergency_Stop := FALSE;
  1111. Single_Start := FALSE;
  1112. Sequential_Start := FALSE;
  1113. Contactor := FALSE;
  1114. Circuit_Breaker := FALSE;
  1115. Clock := FALSE;
  1116. reset := FALSE;
  1117. Synchronize := FALSE;
  1118. Delay_Time := T 0;
  1119. ON_Timer_1 := T 0;
  1120. ON_Time_1 := 0;
  1121. Off_Timer_1 := T 0;
  1122. Off_Time_1 := 0;
  1123. ON_Timer_2 := T 0;
  1124. ON_Time_2 := 0;
  1125. Off_Timer_2 := T 0;
  1126. Off_Time_2 := 0;
  1127. Contactor_Fault := FALSE;
  1128. CB_Fault := FALSE;
  1129. Warning := FALSE;
  1130. Common_Alarm := FALSE;
  1131. Motor_ON := FALSE;
  1132. Temp1 := FALSE;
  1133. temp2 := FALSE;
  1134. temp3 := FALSE;
  1135. temp4 := FALSE;
  1136. temp5 := FALSE;
  1137. temp6 := FALSE;
  1138. temp7 := FALSE;
  1139. temp8 := FALSE;
  1140. temp9 := W#16#0;
  1141. temp10 := W#16#0;
  1142. temp11 := W#16#0;
  1143. temp12 := W#16#0;
  1144. temp13 := FALSE;
  1145. END_DATA_BLOCK
  1146. DATA_BLOCK DB 61
  1147. TITLE =
  1148. VERSION : 0.0
  1149. FB 3
  1150. BEGIN
  1151. Central_Local := FALSE;
  1152. LB_Start := FALSE;
  1153. LB_Stop := FALSE;
  1154. Emergency_Stop := FALSE;
  1155. Single_Start := FALSE;
  1156. Sequential_Start := FALSE;
  1157. Contactor := FALSE;
  1158. Circuit_Breaker := FALSE;
  1159. Clock := FALSE;
  1160. reset := FALSE;
  1161. Synchronize := FALSE;
  1162. Delay_Time := T 0;
  1163. ON_Timer_1 := T 0;
  1164. ON_Time_1 := 0;
  1165. Off_Timer_1 := T 0;
  1166. Off_Time_1 := 0;
  1167. ON_Timer_2 := T 0;
  1168. ON_Time_2 := 0;
  1169. Off_Timer_2 := T 0;
  1170. Off_Time_2 := 0;
  1171. Contactor_Fault := FALSE;
  1172. CB_Fault := FALSE;
  1173. Warning := FALSE;
  1174. Common_Alarm := FALSE;
  1175. Motor_ON := FALSE;
  1176. Temp1 := FALSE;
  1177. temp2 := FALSE;
  1178. temp3 := FALSE;
  1179. temp4 := FALSE;
  1180. temp5 := FALSE;
  1181. temp6 := FALSE;
  1182. temp7 := FALSE;
  1183. temp8 := FALSE;
  1184. temp9 := W#16#0;
  1185. temp10 := W#16#0;
  1186. temp11 := W#16#0;
  1187. temp12 := W#16#0;
  1188. temp13 := FALSE;
  1189. END_DATA_BLOCK
  1190. DATA_BLOCK DB 62
  1191. TITLE =
  1192. VERSION : 0.0
  1193. FB 3
  1194. BEGIN
  1195. Central_Local := FALSE;
  1196. LB_Start := FALSE;
  1197. LB_Stop := FALSE;
  1198. Emergency_Stop := FALSE;
  1199. Single_Start := FALSE;
  1200. Sequential_Start := FALSE;
  1201. Contactor := FALSE;
  1202. Circuit_Breaker := FALSE;
  1203. Clock := FALSE;
  1204. reset := FALSE;
  1205. Synchronize := FALSE;
  1206. Delay_Time := T 0;
  1207. ON_Timer_1 := T 0;
  1208. ON_Time_1 := 0;
  1209. Off_Timer_1 := T 0;
  1210. Off_Time_1 := 0;
  1211. ON_Timer_2 := T 0;
  1212. ON_Time_2 := 0;
  1213. Off_Timer_2 := T 0;
  1214. Off_Time_2 := 0;
  1215. Contactor_Fault := FALSE;
  1216. CB_Fault := FALSE;
  1217. Warning := FALSE;
  1218. Common_Alarm := FALSE;
  1219. Motor_ON := FALSE;
  1220. Temp1 := FALSE;
  1221. temp2 := FALSE;
  1222. temp3 := FALSE;
  1223. temp4 := FALSE;
  1224. temp5 := FALSE;
  1225. temp6 := FALSE;
  1226. temp7 := FALSE;
  1227. temp8 := FALSE;
  1228. temp9 := W#16#0;
  1229. temp10 := W#16#0;
  1230. temp11 := W#16#0;
  1231. temp12 := W#16#0;
  1232. temp13 := FALSE;
  1233. END_DATA_BLOCK
  1234. DATA_BLOCK DB 63
  1235. TITLE =
  1236. VERSION : 0.0
  1237. FB 3
  1238. BEGIN
  1239. Central_Local := FALSE;
  1240. LB_Start := FALSE;
  1241. LB_Stop := FALSE;
  1242. Emergency_Stop := FALSE;
  1243. Single_Start := FALSE;
  1244. Sequential_Start := FALSE;
  1245. Contactor := FALSE;
  1246. Circuit_Breaker := FALSE;
  1247. Clock := FALSE;
  1248. reset := FALSE;
  1249. Synchronize := FALSE;
  1250. Delay_Time := T 0;
  1251. ON_Timer_1 := T 0;
  1252. ON_Time_1 := 0;
  1253. Off_Timer_1 := T 0;
  1254. Off_Time_1 := 0;
  1255. ON_Timer_2 := T 0;
  1256. ON_Time_2 := 0;
  1257. Off_Timer_2 := T 0;
  1258. Off_Time_2 := 0;
  1259. Contactor_Fault := FALSE;
  1260. CB_Fault := FALSE;
  1261. Warning := FALSE;
  1262. Common_Alarm := FALSE;
  1263. Motor_ON := FALSE;
  1264. Temp1 := FALSE;
  1265. temp2 := FALSE;
  1266. temp3 := FALSE;
  1267. temp4 := FALSE;
  1268. temp5 := FALSE;
  1269. temp6 := FALSE;
  1270. temp7 := FALSE;
  1271. temp8 := FALSE;
  1272. temp9 := W#16#0;
  1273. temp10 := W#16#0;
  1274. temp11 := W#16#0;
  1275. temp12 := W#16#0;
  1276. temp13 := FALSE;
  1277. END_DATA_BLOCK
  1278. FUNCTION FC 6 : VOID
  1279. TITLE =
  1280. VERSION : 0.1
  1281. VAR_INPUT
  1282. Input_Bit0 : BOOL ;
  1283. Input_Bit1 : BOOL ;
  1284. Input_Bit2 : BOOL ;
  1285. Input_Bit3 : BOOL ;
  1286. END_VAR
  1287. VAR_OUTPUT
  1288. Output_Bit0 : BOOL ;
  1289. Output_Bit1 : BOOL ;
  1290. Output_Bit2 : BOOL ;
  1291. Output_Bit3 : BOOL ;
  1292. END_VAR
  1293. BEGIN
  1294. NETWORK
  1295. TITLE =
  1296. A #Input_Bit0;
  1297. = #Output_Bit0;
  1298. NETWORK
  1299. TITLE =
  1300. A #Input_Bit1;
  1301. = #Output_Bit1;
  1302. NETWORK
  1303. TITLE =
  1304. A #Input_Bit2;
  1305. = #Output_Bit2;
  1306. NETWORK
  1307. TITLE =
  1308. A #Input_Bit3;
  1309. = #Output_Bit3;
  1310. END_FUNCTION
  1311. FUNCTION FC 20 : VOID
  1312. TITLE =
  1313. VERSION : 0.1
  1314. VAR_INPUT
  1315. MAX : INT ;
  1316. MIN : INT ;
  1317. END_VAR
  1318. VAR_IN_OUT
  1319. INPUT_VALUE : INT ;
  1320. END_VAR
  1321. BEGIN
  1322. NETWORK
  1323. TITLE =
  1324. L #INPUT_VALUE;
  1325. L #MAX;
  1326. >=I ;
  1327. = L 0.0;
  1328. A L 0.0;
  1329. JNB _001;
  1330. L #MAX;
  1331. T #INPUT_VALUE;
  1332. _001: NOP 0;
  1333. AN L 0.0;
  1334. A( ;
  1335. L #INPUT_VALUE;
  1336. L #MIN;
  1337. <=I ;
  1338. ) ;
  1339. JNB _002;
  1340. L #MIN;
  1341. T #INPUT_VALUE;
  1342. _002: NOP 0;
  1343. END_FUNCTION
  1344. FUNCTION FC 1 : VOID
  1345. TITLE =
  1346. VERSION : 0.1
  1347. BEGIN
  1348. NETWORK
  1349. TITLE =
  1350. A I 40.3;
  1351. = L 0.0;
  1352. BLD 103;
  1353. A I 8.3;
  1354. = L 0.1;
  1355. BLD 103;
  1356. A I 8.4;
  1357. = L 0.2;
  1358. BLD 103;
  1359. A I 8.2;
  1360. = L 0.3;
  1361. BLD 103;
  1362. A I 41.6;
  1363. = L 0.4;
  1364. BLD 103;
  1365. A M 21.0;
  1366. = L 0.5;
  1367. BLD 103;
  1368. A Q 21.5;
  1369. = L 0.6;
  1370. BLD 103;
  1371. A I 40.4;
  1372. = L 0.7;
  1373. BLD 103;
  1374. A I 8.5;
  1375. = L 1.0;
  1376. BLD 103;
  1377. A I 8.6;
  1378. = L 1.1;
  1379. BLD 103;
  1380. A I 8.7;
  1381. = L 1.2;
  1382. BLD 103;
  1383. A M 2.6;
  1384. = L 1.3;
  1385. BLD 103;
  1386. A M 13.0;
  1387. = L 1.4;
  1388. BLD 103;
  1389. CALL FB 1 , DB 71 (
  1390. Central_Local := L 0.0,
  1391. LB_Start := L 0.1,
  1392. LB_Stop := L 0.2,
  1393. Emergency_Stop := L 0.3,
  1394. Single_Start := L 0.4,
  1395. Group_Start := L 0.5,
  1396. Group_Stop := L 0.6,
  1397. Interlock := L 0.7,
  1398. Speed_Switch := L 1.0,
  1399. Contactor := L 1.1,
  1400. Circuit_Breaker := L 1.2,
  1401. Clock := L 1.3,
  1402. reset := L 1.4,
  1403. Delay_Time := T 39,
  1404. Group_ON_Timer := T 40,
  1405. ON_Delay := S5T#5S,
  1406. Group_Off_Timer := T 41,
  1407. Off_Delay := S5T#7S,
  1408. Speed_Switch_Fault := DB2.DBX 0.1,
  1409. Contactor_Fault := DB2.DBX 0.2,
  1410. CB_Fault := DB2.DBX 0.3,
  1411. Motor_ON := Q 21.3);
  1412. NOP 0;
  1413. NETWORK
  1414. TITLE =
  1415. A I 40.3;
  1416. = L 0.0;
  1417. BLD 103;
  1418. A I 9.1;
  1419. = L 0.1;
  1420. BLD 103;
  1421. A I 9.2;
  1422. = L 0.2;
  1423. BLD 103;
  1424. A I 9.0;
  1425. = L 0.3;
  1426. BLD 103;
  1427. A I 41.7;
  1428. = L 0.4;
  1429. BLD 103;
  1430. A M 21.0;
  1431. = L 0.5;
  1432. BLD 103;
  1433. A Q 21.6;
  1434. = L 0.6;
  1435. BLD 103;
  1436. A I 40.4;
  1437. = L 0.7;
  1438. BLD 103;
  1439. A I 9.3;
  1440. = L 1.0;
  1441. BLD 103;
  1442. A I 9.4;
  1443. = L 1.1;
  1444. BLD 103;
  1445. A I 9.5;
  1446. = L 1.2;
  1447. BLD 103;
  1448. A M 2.6;
  1449. = L 1.3;
  1450. BLD 103;
  1451. A M 13.0;
  1452. = L 1.4;
  1453. BLD 103;
  1454. CALL FB 1 , DB 72 (
  1455. Central_Local := L 0.0,
  1456. LB_Start := L 0.1,
  1457. LB_Stop := L 0.2,
  1458. Emergency_Stop := L 0.3,
  1459. Single_Start := L 0.4,
  1460. Group_Start := L 0.5,
  1461. Group_Stop := L 0.6,
  1462. Interlock := L 0.7,
  1463. Speed_Switch := L 1.0,
  1464. Contactor := L 1.1,
  1465. Circuit_Breaker := L 1.2,
  1466. Clock := L 1.3,
  1467. reset := L 1.4,
  1468. Delay_Time := T 42,
  1469. Group_ON_Timer := T 43,
  1470. ON_Delay := S5T#2S,
  1471. Group_Off_Timer := T 44,
  1472. Off_Delay := S5T#10S,
  1473. Speed_Switch_Fault := DB2.DBX 0.5,
  1474. Contactor_Fault := DB2.DBX 0.6,
  1475. CB_Fault := DB2.DBX 0.7,
  1476. Motor_ON := Q 21.4);
  1477. NOP 0;
  1478. NETWORK
  1479. TITLE =
  1480. A I 40.3;
  1481. = L 0.0;
  1482. BLD 103;
  1483. A I 9.7;
  1484. = L 0.1;
  1485. BLD 103;
  1486. A I 12.0;
  1487. = L 0.2;
  1488. BLD 103;
  1489. A I 9.6;
  1490. = L 0.3;
  1491. BLD 103;
  1492. A I 42.0;
  1493. = L 0.4;
  1494. BLD 103;
  1495. A M 21.0;
  1496. = L 0.5;
  1497. BLD 103;
  1498. A M 21.0;
  1499. = L 0.6;
  1500. BLD 103;
  1501. A Q 21.3;
  1502. = L 0.7;
  1503. BLD 103;
  1504. A I 12.1;
  1505. = L 1.0;
  1506. BLD 103;
  1507. A I 12.2;
  1508. = L 1.1;
  1509. BLD 103;
  1510. A I 12.3;
  1511. = L 1.2;
  1512. BLD 103;
  1513. A M 2.6;
  1514. = L 1.3;
  1515. BLD 103;
  1516. A M 13.0;
  1517. = L 1.4;
  1518. BLD 103;
  1519. CALL FB 1 , DB 81 (
  1520. Central_Local := L 0.0,
  1521. LB_Start := L 0.1,
  1522. LB_Stop := L 0.2,
  1523. Emergency_Stop := L 0.3,
  1524. Single_Start := L 0.4,
  1525. Group_Start := L 0.5,
  1526. Group_Stop := L 0.6,
  1527. Interlock := L 0.7,
  1528. Speed_Switch := L 1.0,
  1529. Contactor := L 1.1,
  1530. Circuit_Breaker := L 1.2,
  1531. Clock := L 1.3,
  1532. reset := L 1.4,
  1533. Delay_Time := T 45,
  1534. Group_ON_Timer := T 46,
  1535. ON_Delay := S5T#4S,
  1536. Group_Off_Timer := T 47,
  1537. Off_Delay := S5T#10S,
  1538. Speed_Switch_Fault := DB2.DBX 1.1,
  1539. Contactor_Fault := DB2.DBX 1.2,
  1540. CB_Fault := DB2.DBX 1.3,
  1541. Motor_ON := Q 21.5);
  1542. NOP 0;
  1543. NETWORK
  1544. TITLE =
  1545. A I 40.3;
  1546. = L 0.0;
  1547. BLD 103;
  1548. A I 12.5;
  1549. = L 0.1;
  1550. BLD 103;
  1551. A I 12.6;
  1552. = L 0.2;
  1553. BLD 103;
  1554. A I 12.4;
  1555. = L 0.3;
  1556. BLD 103;
  1557. A I 42.1;
  1558. = L 0.4;
  1559. BLD 103;
  1560. A M 21.0;
  1561. = L 0.5;
  1562. BLD 103;
  1563. A M 21.0;
  1564. = L 0.6;
  1565. BLD 103;
  1566. A Q 21.4;
  1567. = L 0.7;
  1568. BLD 103;
  1569. A I 12.7;
  1570. = L 1.0;
  1571. BLD 103;
  1572. A I 13.0;
  1573. = L 1.1;
  1574. BLD 103;
  1575. A I 13.1;
  1576. = L 1.2;
  1577. BLD 103;
  1578. A M 2.6;
  1579. = L 1.3;
  1580. BLD 103;
  1581. A M 13.0;
  1582. = L 1.4;
  1583. BLD 103;
  1584. CALL FB 1 , DB 82 (
  1585. Central_Local := L 0.0,
  1586. LB_Start := L 0.1,
  1587. LB_Stop := L 0.2,
  1588. Emergency_Stop := L 0.3,
  1589. Single_Start := L 0.4,
  1590. Group_Start := L 0.5,
  1591. Group_Stop := L 0.6,
  1592. Interlock := L 0.7,
  1593. Speed_Switch := L 1.0,
  1594. Contactor := L 1.1,
  1595. Circuit_Breaker := L 1.2,
  1596. Clock := L 1.3,
  1597. reset := L 1.4,
  1598. Delay_Time := T 48,
  1599. Group_ON_Timer := T 49,
  1600. ON_Delay := S5T#5S,
  1601. Group_Off_Timer := T 50,
  1602. Off_Delay := S5T#4S,
  1603. Speed_Switch_Fault := DB2.DBX 1.5,
  1604. Contactor_Fault := DB2.DBX 1.6,
  1605. CB_Fault := DB2.DBX 1.7,
  1606. Motor_ON := Q 21.6);
  1607. NOP 0;
  1608. END_FUNCTION
  1609. FUNCTION_BLOCK FB 2
  1610. TITLE =Scale Data
  1611. VERSION : 0.1
  1612. VAR_INPUT
  1613. PIW_INPUT : INT ;
  1614. FULL_SCALE_INSTRUMENT : DINT ;
  1615. FULL_SCALE_REAL : DINT ;
  1616. Defult_Setting : BOOL ;
  1617. END_VAR
  1618. VAR_OUTPUT
  1619. OUTPUT_MESSUR : DINT ;
  1620. PERCENT : DINT ;
  1621. END_VAR
  1622. VAR_IN_OUT
  1623. Gain : DINT ;
  1624. Offset : DINT ;
  1625. END_VAR
  1626. VAR_TEMP
  1627. TEMP1 : DINT ;
  1628. TEMP2 : DINT ;
  1629. TEMP3 : DINT ;
  1630. TEMP4 : DINT ;
  1631. TEMP5 : DINT ;
  1632. END_VAR
  1633. BEGIN
  1634. NETWORK
  1635. TITLE =
  1636. NETWORK
  1637. TITLE =
  1638. L #PIW_INPUT;
  1639. ITD ;
  1640. T #TEMP1;
  1641. SET ;
  1642. SAVE ;
  1643. CLR ;
  1644. A BR;
  1645. = L 20.0;
  1646. A( ;
  1647. A( ;
  1648. A( ;
  1649. A L 20.0;
  1650. JNB _001;
  1651. L #TEMP1;
  1652. L #Offset;
  1653. -D ;
  1654. T #TEMP5;
  1655. AN OV;
  1656. SAVE ;
  1657. CLR ;
  1658. _001: A BR;
  1659. ) ;
  1660. JNB _002;
  1661. L #TEMP5;
  1662. L #FULL_SCALE_INSTRUMENT;
  1663. *D ;
  1664. T #TEMP2;
  1665. AN OV;
  1666. SAVE ;
  1667. CLR ;
  1668. _002: A BR;
  1669. ) ;
  1670. JNB _003;
  1671. L #TEMP2;
  1672. L #Gain;
  1673. /D ;
  1674. T #TEMP3;
  1675. AN OV;
  1676. SAVE ;
  1677. CLR ;
  1678. _003: A BR;
  1679. ) ;
  1680. JNB _004;
  1681. L #TEMP3;
  1682. L L#1;
  1683. *D ;
  1684. T #OUTPUT_MESSUR;
  1685. _004: NOP 0;
  1686. A( ;
  1687. A L 20.0;
  1688. JNB _005;
  1689. L #TEMP3;
  1690. L L#100;
  1691. *D ;
  1692. T #TEMP4;
  1693. AN OV;
  1694. SAVE ;
  1695. CLR ;
  1696. _005: A BR;
  1697. ) ;
  1698. JNB _006;
  1699. L #TEMP4;
  1700. L #FULL_SCALE_REAL;
  1701. /D ;
  1702. T #PERCENT;
  1703. _006: NOP 0;
  1704. A L 20.0;
  1705. A( ;
  1706. L #Gain;
  1707. L L#35000;
  1708. >D ;
  1709. ) ;
  1710. JNB _007;
  1711. L L#35000;
  1712. T #Gain;
  1713. _007: NOP 0;
  1714. A L 20.0;
  1715. A( ;
  1716. L #Gain;
  1717. L L#6000;
  1718. <D ;
  1719. ) ;
  1720. JNB _008;
  1721. L L#6000;
  1722. T #Gain;
  1723. _008: NOP 0;
  1724. A L 20.0;
  1725. A( ;
  1726. L #Offset;
  1727. L L#7000;
  1728. >D ;
  1729. ) ;
  1730. JNB _009;
  1731. L L#7000;
  1732. T #Offset;
  1733. _009: NOP 0;
  1734. A L 20.0;
  1735. A( ;
  1736. L #Offset;
  1737. L L#-7000;
  1738. <D ;
  1739. ) ;
  1740. JNB _00a;
  1741. L L#-7000;
  1742. T #Offset;
  1743. _00a: NOP 0;
  1744. NETWORK
  1745. TITLE =
  1746. A( ;
  1747. A #Defult_Setting;
  1748. JNB _00b;
  1749. L L#0;
  1750. T #Offset;
  1751. SET ;
  1752. SAVE ;
  1753. CLR ;
  1754. _00b: A BR;
  1755. ) ;
  1756. JNB _00c;
  1757. L L#27648;
  1758. T #Gain;
  1759. _00c: NOP 0;
  1760. END_FUNCTION_BLOCK
  1761. FUNCTION FC 2 : VOID
  1762. TITLE =
  1763. VERSION : 0.1
  1764. BEGIN
  1765. NETWORK
  1766. TITLE =
  1767. A M 2.5;
  1768. FP M 10.7;
  1769. JNB _001;
  1770. L MW 4;
  1771. L 1;
  1772. +I ;
  1773. T MW 4;
  1774. _001: NOP 0;
  1775. NETWORK
  1776. TITLE =
  1777. A M 5.2;
  1778. = L 0.0;
  1779. BLD 103;
  1780. A I 40.2;
  1781. = L 0.1;
  1782. BLD 103;
  1783. A M 13.1;
  1784. = L 0.2;
  1785. BLD 103;
  1786. A I 40.3;
  1787. = L 0.3;
  1788. BLD 103;
  1789. CALL FC 6 (
  1790. Input_Bit0 := L 0.0,
  1791. Input_Bit1 := L 0.1,
  1792. Input_Bit2 := L 0.2,
  1793. Input_Bit3 := L 0.3,
  1794. Output_Bit0 := DB1.DBX 0.0,
  1795. Output_Bit1 := DB1.DBX 0.1,
  1796. Output_Bit2 := DB1.DBX 0.2,
  1797. Output_Bit3 := DB1.DBX 0.3);
  1798. NOP 0;
  1799. NETWORK
  1800. TITLE =
  1801. A M 13.3;
  1802. = L 0.0;
  1803. BLD 103;
  1804. A M 13.4;
  1805. = L 0.1;
  1806. BLD 103;
  1807. A M 10.3;
  1808. = L 0.2;
  1809. BLD 103;
  1810. A M 10.3;
  1811. = L 0.3;
  1812. BLD 103;
  1813. CALL FC 6 (
  1814. Input_Bit0 := L 0.0,
  1815. Input_Bit1 := L 0.1,
  1816. Input_Bit2 := L 0.2,
  1817. Input_Bit3 := L 0.3,
  1818. Output_Bit0 := DB1.DBX 0.4,
  1819. Output_Bit1 := DB1.DBX 0.5,
  1820. Output_Bit2 := DB1.DBX 0.6,
  1821. Output_Bit3 := DB1.DBX 0.7);
  1822. NOP 0;
  1823. NETWORK
  1824. TITLE =
  1825. A I 0.2;
  1826. = L 0.0;
  1827. BLD 103;
  1828. A M 10.3;
  1829. = L 0.1;
  1830. BLD 103;
  1831. A I 0.5;
  1832. = L 0.2;
  1833. BLD 103;
  1834. AN I 0.6;
  1835. = L 0.3;
  1836. BLD 103;
  1837. CALL FC 6 (
  1838. Input_Bit0 := L 0.0,
  1839. Input_Bit1 := L 0.1,
  1840. Input_Bit2 := L 0.2,
  1841. Input_Bit3 := L 0.3,
  1842. Output_Bit0 := DB1.DBX 1.0,
  1843. Output_Bit1 := DB1.DBX 1.1,
  1844. Output_Bit2 := DB1.DBX 1.2,
  1845. Output_Bit3 := DB1.DBX 1.3);
  1846. NOP 0;
  1847. NETWORK
  1848. TITLE =
  1849. A I 0.7;
  1850. = L 0.0;
  1851. BLD 103;
  1852. A M 10.3;
  1853. = L 0.1;
  1854. BLD 103;
  1855. A I 1.2;
  1856. = L 0.2;
  1857. BLD 103;
  1858. AN I 1.3;
  1859. = L 0.3;
  1860. BLD 103;
  1861. CALL FC 6 (
  1862. Input_Bit0 := L 0.0,
  1863. Input_Bit1 := L 0.1,
  1864. Input_Bit2 := L 0.2,
  1865. Input_Bit3 := L 0.3,
  1866. Output_Bit0 := DB1.DBX 1.4,
  1867. Output_Bit1 := DB1.DBX 1.5,
  1868. Output_Bit2 := DB1.DBX 1.6,
  1869. Output_Bit3 := DB1.DBX 1.7);
  1870. NOP 0;
  1871. NETWORK
  1872. TITLE =
  1873. A I 1.4;
  1874. = L 0.0;
  1875. BLD 103;
  1876. A M 10.3;
  1877. = L 0.1;
  1878. BLD 103;
  1879. A I 1.7;
  1880. = L 0.2;
  1881. BLD 103;
  1882. AN I 4.0;
  1883. = L 0.3;
  1884. BLD 103;
  1885. CALL FC 6 (
  1886. Input_Bit0 := L 0.0,
  1887. Input_Bit1 := L 0.1,
  1888. Input_Bit2 := L 0.2,
  1889. Input_Bit3 := L 0.3,
  1890. Output_Bit0 := DB1.DBX 2.0,
  1891. Output_Bit1 := DB1.DBX 2.1,
  1892. Output_Bit2 := DB1.DBX 2.2,
  1893. Output_Bit3 := DB1.DBX 2.3);
  1894. NOP 0;
  1895. NETWORK
  1896. TITLE =
  1897. A I 4.1;
  1898. = L 0.0;
  1899. BLD 103;
  1900. A M 10.3;
  1901. = L 0.1;
  1902. BLD 103;
  1903. A I 4.4;
  1904. = L 0.2;
  1905. BLD 103;
  1906. AN I 4.5;
  1907. = L 0.3;
  1908. BLD 103;
  1909. CALL FC 6 (
  1910. Input_Bit0 := L 0.0,
  1911. Input_Bit1 := L 0.1,
  1912. Input_Bit2 := L 0.2,
  1913. Input_Bit3 := L 0.3,
  1914. Output_Bit0 := DB1.DBX 2.4,
  1915. Output_Bit1 := DB1.DBX 2.5,
  1916. Output_Bit2 := DB1.DBX 2.6,
  1917. Output_Bit3 := DB1.DBX 2.7);
  1918. NOP 0;
  1919. NETWORK
  1920. TITLE =
  1921. A I 4.6;
  1922. = L 0.0;
  1923. BLD 103;
  1924. A M 10.3;
  1925. = L 0.1;
  1926. BLD 103;
  1927. A I 5.1;
  1928. = L 0.2;
  1929. BLD 103;
  1930. AN I 5.2;
  1931. = L 0.3;
  1932. BLD 103;
  1933. CALL FC 6 (
  1934. Input_Bit0 := L 0.0,
  1935. Input_Bit1 := L 0.1,
  1936. Input_Bit2 := L 0.2,
  1937. Input_Bit3 := L 0.3,
  1938. Output_Bit0 := DB1.DBX 3.0,
  1939. Output_Bit1 := DB1.DBX 3.1,
  1940. Output_Bit2 := DB1.DBX 3.2,
  1941. Output_Bit3 := DB1.DBX 3.3);
  1942. NOP 0;
  1943. NETWORK
  1944. TITLE =
  1945. A I 5.3;
  1946. = L 0.0;
  1947. BLD 103;
  1948. A M 10.3;
  1949. = L 0.1;
  1950. BLD 103;
  1951. A I 5.6;
  1952. = L 0.2;
  1953. BLD 103;
  1954. AN I 5.7;
  1955. = L 0.3;
  1956. BLD 103;
  1957. CALL FC 6 (
  1958. Input_Bit0 := L 0.0,
  1959. Input_Bit1 := L 0.1,
  1960. Input_Bit2 := L 0.2,
  1961. Input_Bit3 := L 0.3,
  1962. Output_Bit0 := DB1.DBX 3.4,
  1963. Output_Bit1 := DB1.DBX 3.5,
  1964. Output_Bit2 := DB1.DBX 3.6,
  1965. Output_Bit3 := DB1.DBX 3.7);
  1966. NOP 0;
  1967. NETWORK
  1968. TITLE =
  1969. A I 8.2;
  1970. = L 0.0;
  1971. BLD 103;
  1972. A I 8.5;
  1973. = L 0.1;
  1974. BLD 103;
  1975. A I 8.6;
  1976. = L 0.2;
  1977. BLD 103;
  1978. AN I 8.7;
  1979. = L 0.3;
  1980. BLD 103;
  1981. CALL FC 6 (
  1982. Input_Bit0 := L 0.0,
  1983. Input_Bit1 := L 0.1,
  1984. Input_Bit2 := L 0.2,
  1985. Input_Bit3 := L 0.3,
  1986. Output_Bit0 := DB1.DBX 4.0,
  1987. Output_Bit1 := DB1.DBX 4.1,
  1988. Output_Bit2 := DB1.DBX 4.2,
  1989. Output_Bit3 := DB1.DBX 4.3);
  1990. NOP 0;
  1991. NETWORK
  1992. TITLE =
  1993. A I 9.0;
  1994. = L 0.0;
  1995. BLD 103;
  1996. A I 9.3;
  1997. = L 0.1;
  1998. BLD 103;
  1999. A I 9.4;
  2000. = L 0.2;
  2001. BLD 103;
  2002. AN I 9.5;
  2003. = L 0.3;
  2004. BLD 103;
  2005. CALL FC 6 (
  2006. Input_Bit0 := L 0.0,
  2007. Input_Bit1 := L 0.1,
  2008. Input_Bit2 := L 0.2,
  2009. Input_Bit3 := L 0.3,
  2010. Output_Bit0 := DB1.DBX 4.4,
  2011. Output_Bit1 := DB1.DBX 4.5,
  2012. Output_Bit2 := DB1.DBX 4.6,
  2013. Output_Bit3 := DB1.DBX 4.7);
  2014. NOP 0;
  2015. NETWORK
  2016. TITLE =
  2017. A I 9.6;
  2018. = L 0.0;
  2019. BLD 103;
  2020. A I 12.1;
  2021. = L 0.1;
  2022. BLD 103;
  2023. A I 12.2;
  2024. = L 0.2;
  2025. BLD 103;
  2026. AN I 12.3;
  2027. = L 0.3;
  2028. BLD 103;
  2029. CALL FC 6 (
  2030. Input_Bit0 := L 0.0,
  2031. Input_Bit1 := L 0.1,
  2032. Input_Bit2 := L 0.2,
  2033. Input_Bit3 := L 0.3,
  2034. Output_Bit0 := DB1.DBX 5.0,
  2035. Output_Bit1 := DB1.DBX 5.1,
  2036. Output_Bit2 := DB1.DBX 5.2,
  2037. Output_Bit3 := DB1.DBX 5.3);
  2038. NOP 0;
  2039. NETWORK
  2040. TITLE =
  2041. A I 12.4;
  2042. = L 0.0;
  2043. BLD 103;
  2044. A I 12.7;
  2045. = L 0.1;
  2046. BLD 103;
  2047. A I 13.0;
  2048. = L 0.2;
  2049. BLD 103;
  2050. AN I 13.1;
  2051. = L 0.3;
  2052. BLD 103;
  2053. CALL FC 6 (
  2054. Input_Bit0 := L 0.0,
  2055. Input_Bit1 := L 0.1,
  2056. Input_Bit2 := L 0.2,
  2057. Input_Bit3 := L 0.3,
  2058. Output_Bit0 := DB1.DBX 5.4,
  2059. Output_Bit1 := DB1.DBX 5.5,
  2060. Output_Bit2 := DB1.DBX 5.6,
  2061. Output_Bit3 := DB1.DBX 5.7);
  2062. NOP 0;
  2063. NETWORK
  2064. TITLE =
  2065. A I 0.0;
  2066. = L 0.0;
  2067. BLD 103;
  2068. A I 0.1;
  2069. = L 0.1;
  2070. BLD 103;
  2071. A M 10.2;
  2072. = L 0.2;
  2073. BLD 103;
  2074. A M 10.2;
  2075. = L 0.3;
  2076. BLD 103;
  2077. CALL FC 6 (
  2078. Input_Bit0 := L 0.0,
  2079. Input_Bit1 := L 0.1,
  2080. Input_Bit2 := L 0.2,
  2081. Input_Bit3 := L 0.3,
  2082. Output_Bit0 := DB1.DBX 6.0,
  2083. Output_Bit1 := DB1.DBX 6.1,
  2084. Output_Bit2 := DB1.DBX 6.2,
  2085. Output_Bit3 := DB1.DBX 6.3);
  2086. NOP 0;
  2087. NETWORK
  2088. TITLE =
  2089. A( ;
  2090. A( ;
  2091. A( ;
  2092. L DB1.DBB 0;
  2093. T QB 40;
  2094. SET ;
  2095. SAVE ;
  2096. CLR ;
  2097. A BR;
  2098. ) ;
  2099. JNB _002;
  2100. L DB1.DBB 1;
  2101. T QB 41;
  2102. SET ;
  2103. SAVE ;
  2104. CLR ;
  2105. _002: A BR;
  2106. ) ;
  2107. JNB _003;
  2108. L DB1.DBB 2;
  2109. T QB 42;
  2110. SET ;
  2111. SAVE ;
  2112. CLR ;
  2113. _003: A BR;
  2114. ) ;
  2115. JNB _004;
  2116. L DB1.DBB 3;
  2117. T QB 43;
  2118. _004: NOP 0;
  2119. NETWORK
  2120. TITLE =
  2121. A( ;
  2122. A( ;
  2123. A( ;
  2124. L DB1.DBB 4;
  2125. T QB 44;
  2126. SET ;
  2127. SAVE ;
  2128. CLR ;
  2129. A BR;
  2130. ) ;
  2131. JNB _005;
  2132. L DB1.DBB 5;
  2133. T QB 45;
  2134. SET ;
  2135. SAVE ;
  2136. CLR ;
  2137. _005: A BR;
  2138. ) ;
  2139. JNB _006;
  2140. L DB1.DBB 6;
  2141. T QB 46;
  2142. SET ;
  2143. SAVE ;
  2144. CLR ;
  2145. _006: A BR;
  2146. ) ;
  2147. JNB _007;
  2148. L DB1.DBB 7;
  2149. T QB 47;
  2150. _007: NOP 0;
  2151. NETWORK
  2152. TITLE =
  2153. A( ;
  2154. A( ;
  2155. A( ;
  2156. L DB1.DBB 8;
  2157. T QB 48;
  2158. SET ;
  2159. SAVE ;
  2160. CLR ;
  2161. A BR;
  2162. ) ;
  2163. JNB _008;
  2164. L DB1.DBB 9;
  2165. T QB 49;
  2166. SET ;
  2167. SAVE ;
  2168. CLR ;
  2169. _008: A BR;
  2170. ) ;
  2171. JNB _009;
  2172. L DB1.DBB 10;
  2173. T QB 50;
  2174. SET ;
  2175. SAVE ;
  2176. CLR ;
  2177. _009: A BR;
  2178. ) ;
  2179. JNB _00a;
  2180. L DB1.DBB 11;
  2181. T QB 51;
  2182. _00a: NOP 0;
  2183. NETWORK
  2184. TITLE =
  2185. A( ;
  2186. A( ;
  2187. A( ;
  2188. L DB1.DBB 12;
  2189. T QB 52;
  2190. SET ;
  2191. SAVE ;
  2192. CLR ;
  2193. A BR;
  2194. ) ;
  2195. JNB _00b;
  2196. L DB1.DBB 13;
  2197. T QB 53;
  2198. SET ;
  2199. SAVE ;
  2200. CLR ;
  2201. _00b: A BR;
  2202. ) ;
  2203. JNB _00c;
  2204. L DB1.DBB 14;
  2205. T QB 54;
  2206. SET ;
  2207. SAVE ;
  2208. CLR ;
  2209. _00c: A BR;
  2210. ) ;
  2211. JNB _00d;
  2212. L DB1.DBB 15;
  2213. T QB 55;
  2214. _00d: NOP 0;
  2215. NETWORK
  2216. TITLE =
  2217. A( ;
  2218. A( ;
  2219. A( ;
  2220. L DB1.DBB 16;
  2221. T QB 56;
  2222. SET ;
  2223. SAVE ;
  2224. CLR ;
  2225. A BR;
  2226. ) ;
  2227. JNB _00e;
  2228. L DB1.DBB 17;
  2229. T QB 57;
  2230. SET ;
  2231. SAVE ;
  2232. CLR ;
  2233. _00e: A BR;
  2234. ) ;
  2235. JNB _00f;
  2236. L DB1.DBB 18;
  2237. T QB 58;
  2238. SET ;
  2239. SAVE ;
  2240. CLR ;
  2241. _00f: A BR;
  2242. ) ;
  2243. JNB _010;
  2244. L DB1.DBB 19;
  2245. T QB 59;
  2246. _010: NOP 0;
  2247. NETWORK
  2248. TITLE =
  2249. A( ;
  2250. L DB1.DBB 20;
  2251. T QB 60;
  2252. SET ;
  2253. SAVE ;
  2254. CLR ;
  2255. A BR;
  2256. ) ;
  2257. JNB _011;
  2258. L DB1.DBB 21;
  2259. T QB 61;
  2260. _011: NOP 0;
  2261. END_FUNCTION
  2262. FUNCTION FC 3 : VOID
  2263. TITLE =
  2264. VERSION : 0.1
  2265. BEGIN
  2266. NETWORK
  2267. TITLE =Handshake Fault
  2268. A I 40.0;
  2269. L S5T#10S;
  2270. SS T 2;
  2271. NOP 0;
  2272. NOP 0;
  2273. NOP 0;
  2274. A T 2;
  2275. = L 0.0;
  2276. AN L 0.0;
  2277. = M 13.4;
  2278. A L 0.0;
  2279. BLD 102;
  2280. = DB2.DBX 4.6;
  2281. NETWORK
  2282. TITLE =Motors Faults
  2283. A( ;
  2284. O DB51.DBX 20.3;
  2285. O DB52.DBX 20.3;
  2286. O DB53.DBX 20.3;
  2287. O DB61.DBX 20.3;
  2288. O DB62.DBX 20.3;
  2289. O DB63.DBX 20.3;
  2290. O DB71.DBX 12.5;
  2291. O DB72.DBX 12.5;
  2292. O DB81.DBX 12.5;
  2293. O DB82.DBX 12.5;
  2294. ) ;
  2295. NOT ;
  2296. = M 13.1;
  2297. NETWORK
  2298. TITLE =
  2299. AN I 0.2;
  2300. = L 0.0;
  2301. BLD 103;
  2302. AN I 0.7;
  2303. = L 0.1;
  2304. BLD 103;
  2305. AN I 1.4;
  2306. = L 0.2;
  2307. BLD 103;
  2308. AN I 4.1;
  2309. = L 0.3;
  2310. BLD 103;
  2311. CALL FC 6 (
  2312. Input_Bit0 := L 0.0,
  2313. Input_Bit1 := L 0.1,
  2314. Input_Bit2 := L 0.2,
  2315. Input_Bit3 := L 0.3,
  2316. Output_Bit0 := DB2.DBX 2.0,
  2317. Output_Bit1 := DB2.DBX 2.3,
  2318. Output_Bit2 := DB2.DBX 2.6,
  2319. Output_Bit3 := DB2.DBX 3.1);
  2320. NOP 0;
  2321. NETWORK
  2322. TITLE =
  2323. AN I 4.6;
  2324. = L 0.0;
  2325. BLD 103;
  2326. AN I 5.3;
  2327. = L 0.1;
  2328. BLD 103;
  2329. AN I 8.2;
  2330. = L 0.2;
  2331. BLD 103;
  2332. AN I 9.0;
  2333. = L 0.3;
  2334. BLD 103;
  2335. CALL FC 6 (
  2336. Input_Bit0 := L 0.0,
  2337. Input_Bit1 := L 0.1,
  2338. Input_Bit2 := L 0.2,
  2339. Input_Bit3 := L 0.3,
  2340. Output_Bit0 := DB2.DBX 3.4,
  2341. Output_Bit1 := DB2.DBX 3.7,
  2342. Output_Bit2 := DB2.DBX 0.0,
  2343. Output_Bit3 := DB2.DBX 0.4);
  2344. NOP 0;
  2345. NETWORK
  2346. TITLE =
  2347. AN I 9.6;
  2348. = L 0.0;
  2349. BLD 103;
  2350. AN I 12.4;
  2351. = L 0.1;
  2352. BLD 103;
  2353. AN I 0.0;
  2354. = L 0.2;
  2355. BLD 103;
  2356. AN I 0.1;
  2357. = L 0.3;
  2358. BLD 103;
  2359. CALL FC 6 (
  2360. Input_Bit0 := L 0.0,
  2361. Input_Bit1 := L 0.1,
  2362. Input_Bit2 := L 0.2,
  2363. Input_Bit3 := L 0.3,
  2364. Output_Bit0 := DB2.DBX 1.0,
  2365. Output_Bit1 := DB2.DBX 1.4,
  2366. Output_Bit2 := DB2.DBX 4.2,
  2367. Output_Bit3 := DB2.DBX 4.5);
  2368. NOP 0;
  2369. END_FUNCTION
  2370. FUNCTION_BLOCK FB 4
  2371. TITLE =Calculat Timeing Priode
  2372. VERSION : 0.1
  2373. VAR_INPUT
  2374. C1ON : INT ; //Collecting 1 ON Time
  2375. C1Off : INT ; //Collecting 1 Off Time
  2376. D1ON : INT ; //Discharge 1 ON Time
  2377. C2ON : INT ; //Collecting 2 ON Time
  2378. D2ON : INT ; //Discharge 2 ON Time
  2379. C3ON : INT ; //Collecting 3 ON Time
  2380. D3ON : INT ; //Discharge 3 ON Time
  2381. END_VAR
  2382. VAR_OUTPUT
  2383. C1ON_1 : INT ; //Collecting 1 ON Time
  2384. C1Off_1 : INT ; //Collecting 1 Off Time
  2385. D1ON_1 : INT ; //Discharge 1 ON Time
  2386. D1Off_1 : INT ; //Discharge 1 Off Time 1
  2387. D1Off_2 : INT ; //Discharge 1 Off Time 2
  2388. C2ON_1 : INT ; //Collecting 2 ON Time
  2389. C2Off_1 : INT ; //Collecting 2 Off Time 1
  2390. C2Off_2 : INT ; //Collecting 2 Off Time 2
  2391. D2ON_1 : INT ; //Discharge 2 ON Time 1
  2392. D2ON_2 : INT ; //Discharge 2 ON Time 2
  2393. D2Off_1 : INT ; //Discharge 2 Off Time
  2394. C3ON_1 : INT ; //Collecting 3 ON Time
  2395. C3Off_1 : INT ; //Collecting 3 Off Time 1
  2396. C3Off_2 : INT ; //Collecting 3 Off Time 2
  2397. D3ON_1 : INT ; //Discharge 3 ON Time 1
  2398. D3ON_2 : INT ; //Discharge 3 ON Time 2
  2399. D3Off_1 : INT ; //Discharge 3 Off Time
  2400. END_VAR
  2401. VAR_TEMP
  2402. temp1 : INT ;
  2403. temp2 : INT ;
  2404. temp3 : INT ;
  2405. temp4 : INT ;
  2406. END_VAR
  2407. BEGIN
  2408. NETWORK
  2409. TITLE =
  2410. A( ;
  2411. A( ;
  2412. L #C1ON;
  2413. T #C1ON_1;
  2414. SET ;
  2415. SAVE ;
  2416. CLR ;
  2417. A BR;
  2418. ) ;
  2419. JNB _001;
  2420. L #C2ON;
  2421. T #C2ON_1;
  2422. SET ;
  2423. SAVE ;
  2424. CLR ;
  2425. _001: A BR;
  2426. ) ;
  2427. JNB _002;
  2428. L #C3ON;
  2429. T #C3ON_1;
  2430. _002: NOP 0;
  2431. NETWORK
  2432. TITLE =
  2433. A( ;
  2434. L #C1Off;
  2435. L 1;
  2436. /I ;
  2437. T #C1Off_1;
  2438. AN OV;
  2439. SAVE ;
  2440. CLR ;
  2441. A BR;
  2442. ) ;
  2443. JNB _003;
  2444. L #D1ON;
  2445. T #D1ON_1;
  2446. _003: NOP 0;
  2447. NETWORK
  2448. TITLE =Field 1 Discharg Off Time 1&2
  2449. A( ;
  2450. L #C1Off;
  2451. L #D1ON;
  2452. -I ;
  2453. T #temp1;
  2454. AN OV;
  2455. SAVE ;
  2456. CLR ;
  2457. A BR;
  2458. ) ;
  2459. JNB _004;
  2460. L #temp1;
  2461. L 2;
  2462. /I ;
  2463. T #temp1;
  2464. AN OV;
  2465. SAVE ;
  2466. CLR ;
  2467. _004: A BR;
  2468. = L 8.0;
  2469. A( ;
  2470. A L 8.0;
  2471. JNB _005;
  2472. L #temp1;
  2473. L #C1ON;
  2474. +I ;
  2475. T #temp2;
  2476. AN OV;
  2477. SAVE ;
  2478. CLR ;
  2479. _005: A BR;
  2480. ) ;
  2481. JNB _006;
  2482. L #temp2;
  2483. L 1;
  2484. /I ;
  2485. T #D1Off_1;
  2486. _006: NOP 0;
  2487. A L 8.0;
  2488. JNB _007;
  2489. L #temp1;
  2490. L 1;
  2491. /I ;
  2492. T #D1Off_2;
  2493. _007: NOP 0;
  2494. NETWORK
  2495. TITLE =Field 2 Collecting Off Time 1
  2496. A( ;
  2497. L #C1Off;
  2498. L #C2ON;
  2499. -I ;
  2500. T #temp1;
  2501. AN OV;
  2502. SAVE ;
  2503. CLR ;
  2504. A BR;
  2505. ) ;
  2506. JNB _008;
  2507. L #temp1;
  2508. L 2;
  2509. /I ;
  2510. T #temp1;
  2511. AN OV;
  2512. SAVE ;
  2513. CLR ;
  2514. _008: A BR;
  2515. = L 8.0;
  2516. A L 8.0;
  2517. JNB _009;
  2518. L #temp1;
  2519. L #C1ON;
  2520. +I ;
  2521. T #C2Off_1;
  2522. _009: NOP 0;
  2523. A L 8.0;
  2524. JNB _00a;
  2525. L #temp1;
  2526. L #C1ON;
  2527. +I ;
  2528. T #temp2;
  2529. _00a: NOP 0;
  2530. NETWORK
  2531. TITLE =Field 2 Collecting Off Time 2
  2532. A( ;
  2533. A( ;
  2534. A( ;
  2535. A( ;
  2536. L #C1ON;
  2537. L #C1Off;
  2538. +I ;
  2539. T #temp1;
  2540. AN OV;
  2541. SAVE ;
  2542. CLR ;
  2543. A BR;
  2544. ) ;
  2545. JNB _00b;
  2546. L #temp1;
  2547. L 2;
  2548. *I ;
  2549. T #temp1;
  2550. AN OV;
  2551. SAVE ;
  2552. CLR ;
  2553. _00b: A BR;
  2554. ) ;
  2555. JNB _00c;
  2556. L #temp1;
  2557. L #C2ON;
  2558. -I ;
  2559. T #temp1;
  2560. AN OV;
  2561. SAVE ;
  2562. CLR ;
  2563. _00c: A BR;
  2564. ) ;
  2565. JNB _00d;
  2566. L #temp1;
  2567. L #temp2;
  2568. -I ;
  2569. T #temp2;
  2570. AN OV;
  2571. SAVE ;
  2572. CLR ;
  2573. _00d: A BR;
  2574. ) ;
  2575. JNB _00e;
  2576. L #temp2;
  2577. L 1;
  2578. /I ;
  2579. T #C2Off_2;
  2580. _00e: NOP 0;
  2581. NETWORK
  2582. TITLE =Field 2 Discharge Off Time
  2583. A( ;
  2584. A( ;
  2585. A( ;
  2586. L #C1ON;
  2587. L #C1Off;
  2588. +I ;
  2589. T #temp1;
  2590. AN OV;
  2591. SAVE ;
  2592. CLR ;
  2593. A BR;
  2594. ) ;
  2595. JNB _00f;
  2596. L #temp1;
  2597. L 2;
  2598. *I ;
  2599. T #temp1;
  2600. AN OV;
  2601. SAVE ;
  2602. CLR ;
  2603. _00f: A BR;
  2604. ) ;
  2605. JNB _010;
  2606. L #temp1;
  2607. T #temp2;
  2608. SET ;
  2609. SAVE ;
  2610. CLR ;
  2611. _010: A BR;
  2612. ) ;
  2613. JNB _011;
  2614. L #temp1;
  2615. L #D2ON;
  2616. -I ;
  2617. T #temp1;
  2618. AN OV;
  2619. SAVE ;
  2620. CLR ;
  2621. _011: A BR;
  2622. = L 8.0;
  2623. A L 8.0;
  2624. JNB _012;
  2625. L #temp1;
  2626. L 1;
  2627. /I ;
  2628. T #D2Off_1;
  2629. _012: NOP 0;
  2630. A L 8.0;
  2631. JNB _013;
  2632. L #temp1;
  2633. T #temp3;
  2634. _013: NOP 0;
  2635. NETWORK
  2636. TITLE =Field 2 Discharge ON Time 1
  2637. A( ;
  2638. A( ;
  2639. A( ;
  2640. L #C1Off;
  2641. L #temp1;
  2642. -I ;
  2643. T #temp1;
  2644. AN OV;
  2645. SAVE ;
  2646. CLR ;
  2647. A BR;
  2648. ) ;
  2649. JNB _014;
  2650. L #temp1;
  2651. L 2;
  2652. /I ;
  2653. T #temp1;
  2654. AN OV;
  2655. SAVE ;
  2656. CLR ;
  2657. _014: A BR;
  2658. ) ;
  2659. JNB _015;
  2660. L #temp1;
  2661. L #C1ON;
  2662. +I ;
  2663. T #temp1;
  2664. AN OV;
  2665. SAVE ;
  2666. CLR ;
  2667. _015: A BR;
  2668. ) ;
  2669. JNB _016;
  2670. L #temp1;
  2671. L 1;
  2672. /I ;
  2673. T #D2ON_1;
  2674. _016: NOP 0;
  2675. NETWORK
  2676. TITLE =Field 2 Discharge ON Time 2
  2677. A( ;
  2678. A( ;
  2679. L #temp2;
  2680. L #temp1;
  2681. -I ;
  2682. T #temp2;
  2683. AN OV;
  2684. SAVE ;
  2685. CLR ;
  2686. A BR;
  2687. ) ;
  2688. JNB _017;
  2689. L #temp2;
  2690. L #temp3;
  2691. -I ;
  2692. T #temp1;
  2693. AN OV;
  2694. SAVE ;
  2695. CLR ;
  2696. _017: A BR;
  2697. ) ;
  2698. JNB _018;
  2699. L #temp1;
  2700. L 1;
  2701. /I ;
  2702. T #D2ON_2;
  2703. _018: NOP 0;
  2704. NETWORK
  2705. TITLE =Field 3 Collecting Off Time 2
  2706. A( ;
  2707. L #C1Off;
  2708. L #C3ON;
  2709. -I ;
  2710. T #temp1;
  2711. AN OV;
  2712. SAVE ;
  2713. CLR ;
  2714. A BR;
  2715. ) ;
  2716. JNB _019;
  2717. L #temp1;
  2718. L 2;
  2719. /I ;
  2720. T #temp1;
  2721. AN OV;
  2722. SAVE ;
  2723. CLR ;
  2724. _019: A BR;
  2725. = L 8.0;
  2726. A( ;
  2727. A L 8.0;
  2728. JNB _01a;
  2729. L #temp1;
  2730. L #C1ON;
  2731. +I ;
  2732. T #temp3;
  2733. AN OV;
  2734. SAVE ;
  2735. CLR ;
  2736. _01a: A BR;
  2737. ) ;
  2738. JNB _01b;
  2739. L #temp3;
  2740. L 1;
  2741. /I ;
  2742. T #C3Off_2;
  2743. _01b: NOP 0;
  2744. A L 8.0;
  2745. JNB _01c;
  2746. L #temp1;
  2747. L #C1ON;
  2748. +I ;
  2749. T #temp2;
  2750. _01c: NOP 0;
  2751. NETWORK
  2752. TITLE =Field 3 Collecting Off Time 1
  2753. A( ;
  2754. A( ;
  2755. L #C1Off;
  2756. L #C1ON;
  2757. +I ;
  2758. T #temp1;
  2759. AN OV;
  2760. SAVE ;
  2761. CLR ;
  2762. A BR;
  2763. ) ;
  2764. JNB _01d;
  2765. L #temp1;
  2766. L #temp2;
  2767. +I ;
  2768. T #temp1;
  2769. AN OV;
  2770. SAVE ;
  2771. CLR ;
  2772. _01d: A BR;
  2773. ) ;
  2774. JNB _01e;
  2775. L #temp1;
  2776. L 1;
  2777. /I ;
  2778. T #C3Off_1;
  2779. _01e: NOP 0;
  2780. NETWORK
  2781. TITLE =Field 3 Discharge Off Time
  2782. A( ;
  2783. A( ;
  2784. A( ;
  2785. L #C1ON;
  2786. L #C1Off;
  2787. +I ;
  2788. T #temp1;
  2789. AN OV;
  2790. SAVE ;
  2791. CLR ;
  2792. A BR;
  2793. ) ;
  2794. JNB _01f;
  2795. L #temp1;
  2796. L 2;
  2797. *I ;
  2798. T #temp1;
  2799. AN OV;
  2800. SAVE ;
  2801. CLR ;
  2802. _01f: A BR;
  2803. ) ;
  2804. JNB _020;
  2805. L #temp1;
  2806. T #temp2;
  2807. SET ;
  2808. SAVE ;
  2809. CLR ;
  2810. _020: A BR;
  2811. ) ;
  2812. JNB _021;
  2813. L #temp1;
  2814. L #D3ON;
  2815. -I ;
  2816. T #temp1;
  2817. AN OV;
  2818. SAVE ;
  2819. CLR ;
  2820. _021: A BR;
  2821. = L 8.0;
  2822. A L 8.0;
  2823. JNB _022;
  2824. L #temp1;
  2825. T #temp3;
  2826. _022: NOP 0;
  2827. A L 8.0;
  2828. JNB _023;
  2829. L #temp1;
  2830. L 1;
  2831. /I ;
  2832. T #D3Off_1;
  2833. _023: NOP 0;
  2834. NETWORK
  2835. TITLE =Field 3 Discharge ON Time 2
  2836. A( ;
  2837. A( ;
  2838. L #C1Off;
  2839. L #temp3;
  2840. -I ;
  2841. T #temp1;
  2842. AN OV;
  2843. SAVE ;
  2844. CLR ;
  2845. A BR;
  2846. ) ;
  2847. JNB _024;
  2848. L #temp1;
  2849. L 2;
  2850. /I ;
  2851. T #temp1;
  2852. AN OV;
  2853. SAVE ;
  2854. CLR ;
  2855. _024: A BR;
  2856. ) ;
  2857. JNB _025;
  2858. L #temp1;
  2859. L 1;
  2860. /I ;
  2861. T #D3ON_2;
  2862. _025: NOP 0;
  2863. NETWORK
  2864. TITLE =Field 3 Discharge ON Time 1
  2865. A( ;
  2866. A( ;
  2867. L #temp2;
  2868. L #temp1;
  2869. -I ;
  2870. T #temp2;
  2871. AN OV;
  2872. SAVE ;
  2873. CLR ;
  2874. A BR;
  2875. ) ;
  2876. JNB _026;
  2877. L #temp2;
  2878. L #temp3;
  2879. -I ;
  2880. T #temp1;
  2881. AN OV;
  2882. SAVE ;
  2883. CLR ;
  2884. _026: A BR;
  2885. ) ;
  2886. JNB _027;
  2887. L #temp1;
  2888. L 1;
  2889. /I ;
  2890. T #D3ON_1;
  2891. _027: NOP 0;
  2892. END_FUNCTION_BLOCK
  2893. DATA_BLOCK DB 50
  2894. TITLE =
  2895. VERSION : 0.0
  2896. FB 4
  2897. BEGIN
  2898. C1ON := 0;
  2899. C1Off := 0;
  2900. D1ON := 0;
  2901. C2ON := 0;
  2902. D2ON := 0;
  2903. C3ON := 0;
  2904. D3ON := 0;
  2905. C1ON_1 := 0;
  2906. C1Off_1 := 0;
  2907. D1ON_1 := 0;
  2908. D1Off_1 := 0;
  2909. D1Off_2 := 0;
  2910. C2ON_1 := 0;
  2911. C2Off_1 := 0;
  2912. C2Off_2 := 0;
  2913. D2ON_1 := 0;
  2914. D2ON_2 := 0;
  2915. D2Off_1 := 0;
  2916. C3ON_1 := 0;
  2917. C3Off_1 := 0;
  2918. C3Off_2 := 0;
  2919. D3ON_1 := 0;
  2920. D3ON_2 := 0;
  2921. D3Off_1 := 0;
  2922. END_DATA_BLOCK
  2923. FUNCTION FC 4 : VOID
  2924. TITLE =
  2925. VERSION : 0.1
  2926. BEGIN
  2927. NETWORK
  2928. TITLE =
  2929. A M 2.5;
  2930. AN M 2.5;
  2931. = M 10.3;
  2932. A M 10.3;
  2933. NOT ;
  2934. = M 10.2;
  2935. NETWORK
  2936. TITLE =
  2937. O I 40.1;
  2938. O M 10.1;
  2939. = M 13.0;
  2940. NETWORK
  2941. TITLE =
  2942. A( ;
  2943. A M 13.2;
  2944. FP M 16.0;
  2945. JNB _001;
  2946. L MB 20;
  2947. T MB 15;
  2948. SET ;
  2949. SAVE ;
  2950. CLR ;
  2951. _001: A BR;
  2952. ) ;
  2953. JNB _002;
  2954. L 0;
  2955. T MB 20;
  2956. _002: NOP 0;
  2957. NETWORK
  2958. TITLE =
  2959. A M 13.2;
  2960. FN M 16.1;
  2961. JNB _003;
  2962. L MB 15;
  2963. T MB 20;
  2964. _003: NOP 0;
  2965. NETWORK
  2966. TITLE =
  2967. O I 41.2;
  2968. O I 41.1;
  2969. = M 21.0;
  2970. NETWORK
  2971. TITLE =
  2972. A I 41.2;
  2973. A Q 21.5;
  2974. A Q 21.5;
  2975. = M 21.1;
  2976. NETWORK
  2977. TITLE =
  2978. A I 41.2;
  2979. A M 21.1;
  2980. O ;
  2981. A I 41.3;
  2982. A I 40.3;
  2983. = M 21.2;
  2984. NETWORK
  2985. TITLE =
  2986. A M 21.2;
  2987. A I 41.2;
  2988. L S5T#5S;
  2989. SD T 52;
  2990. NETWORK
  2991. TITLE =
  2992. A T 52;
  2993. A I 41.2;
  2994. O ;
  2995. A I 41.4;
  2996. A I 40.3;
  2997. = M 21.3;
  2998. NETWORK
  2999. TITLE =
  3000. A M 21.3;
  3001. A I 41.2;
  3002. L S5T#5S;
  3003. SD T 53;
  3004. NETWORK
  3005. TITLE =
  3006. A T 53;
  3007. A I 41.2;
  3008. O ;
  3009. A I 41.5;
  3010. A I 40.3;
  3011. = M 21.4;
  3012. END_FUNCTION
  3013. FUNCTION FC 5 : VOID
  3014. TITLE =Chek Data to Load in Range
  3015. VERSION : 0.1
  3016. VAR_TEMP
  3017. Discharge_ON_Time : INT ;
  3018. Discharge_ON_2 : INT ;
  3019. END_VAR
  3020. BEGIN
  3021. NETWORK
  3022. TITLE =Field 1 Collecting Rapping ON Time
  3023. CALL FC 20 (
  3024. MAX := 120,
  3025. MIN := 20,
  3026. INPUT_VALUE := DB50.DBW 0);
  3027. NOP 0;
  3028. NETWORK
  3029. TITLE =Field 1 Collecting Rapping Off Time
  3030. CALL FC 20 (
  3031. MAX := 2500,
  3032. MIN := 1000,
  3033. INPUT_VALUE := DB50.DBW 2);
  3034. NOP 0;
  3035. NETWORK
  3036. TITLE =
  3037. A( ;
  3038. A( ;
  3039. A( ;
  3040. L DB50.DBW 0;
  3041. L DB50.DBW 2;
  3042. +I ;
  3043. T #Discharge_ON_Time;
  3044. AN OV;
  3045. SAVE ;
  3046. CLR ;
  3047. A BR;
  3048. ) ;
  3049. JNB _001;
  3050. L #Discharge_ON_Time;
  3051. L DB50.DBW 0;
  3052. +I ;
  3053. T #Discharge_ON_2;
  3054. AN OV;
  3055. SAVE ;
  3056. CLR ;
  3057. _001: A BR;
  3058. ) ;
  3059. JNB _002;
  3060. L #Discharge_ON_Time;
  3061. L DB50.DBW 4;
  3062. -I ;
  3063. T MW 54;
  3064. AN OV;
  3065. SAVE ;
  3066. CLR ;
  3067. _002: A BR;
  3068. ) ;
  3069. JNB _003;
  3070. L #Discharge_ON_Time;
  3071. L 2;
  3072. *I ;
  3073. T #Discharge_ON_Time;
  3074. _003: NOP 0;
  3075. NETWORK
  3076. TITLE =Field 1 Discharge Rapping ON Time
  3077. CALL FC 20 (
  3078. MAX := DB50.DBW 2,
  3079. MIN := 1000,
  3080. INPUT_VALUE := DB50.DBW 4);
  3081. NOP 0;
  3082. NETWORK
  3083. TITLE =Field 2 Collecting Rapping ON Time
  3084. CALL FC 20 (
  3085. MAX := 120,
  3086. MIN := 20,
  3087. INPUT_VALUE := DB50.DBW 6);
  3088. NOP 0;
  3089. NETWORK
  3090. TITLE =
  3091. L #Discharge_ON_Time;
  3092. L DB50.DBW 6;
  3093. -I ;
  3094. T MW 50;
  3095. NOP 0;
  3096. NETWORK
  3097. TITLE =Field 2 Discharge Rapping ON Time
  3098. CALL FC 20 (
  3099. MAX := #Discharge_ON_Time,
  3100. MIN := #Discharge_ON_2,
  3101. INPUT_VALUE := DB50.DBW 8);
  3102. NOP 0;
  3103. NETWORK
  3104. TITLE =
  3105. L #Discharge_ON_Time;
  3106. L DB50.DBW 8;
  3107. -I ;
  3108. T MW 56;
  3109. NOP 0;
  3110. NETWORK
  3111. TITLE =Field 3 Collecting Rapping ON Time
  3112. CALL FC 20 (
  3113. MAX := 120,
  3114. MIN := 20,
  3115. INPUT_VALUE := DB50.DBW 10);
  3116. NOP 0;
  3117. NETWORK
  3118. TITLE =
  3119. L #Discharge_ON_Time;
  3120. L DB50.DBW 10;
  3121. -I ;
  3122. T MW 52;
  3123. NOP 0;
  3124. NETWORK
  3125. TITLE =Field 3 Discharge Rapping ON Time
  3126. CALL FC 20 (
  3127. MAX := #Discharge_ON_Time,
  3128. MIN := #Discharge_ON_2,
  3129. INPUT_VALUE := DB50.DBW 12);
  3130. NOP 0;
  3131. NETWORK
  3132. TITLE =
  3133. L #Discharge_ON_Time;
  3134. L DB50.DBW 12;
  3135. -I ;
  3136. T MW 58;
  3137. NOP 0;
  3138. END_FUNCTION
  3139. FUNCTION FC 7 : VOID
  3140. TITLE =
  3141. VERSION : 0.1
  3142. BEGIN
  3143. NETWORK
  3144. TITLE =
  3145. A I 40.3;
  3146. = L 0.0;
  3147. BLD 103;
  3148. A I 0.3;
  3149. = L 0.1;
  3150. BLD 103;
  3151. A I 0.4;
  3152. = L 0.2;
  3153. BLD 103;
  3154. A I 0.2;
  3155. = L 0.3;
  3156. BLD 103;
  3157. A I 42.2;
  3158. = L 0.4;
  3159. BLD 103;
  3160. A M 21.1;
  3161. = L 0.5;
  3162. BLD 103;
  3163. A I 0.5;
  3164. = L 0.6;
  3165. BLD 103;
  3166. A I 0.6;
  3167. = L 0.7;
  3168. BLD 103;
  3169. A M 2.5;
  3170. = L 1.0;
  3171. BLD 103;
  3172. A M 13.0;
  3173. = L 1.1;
  3174. BLD 103;
  3175. CALL FB 3 , DB 51 (
  3176. Central_Local := L 0.0,
  3177. LB_Start := L 0.1,
  3178. LB_Stop := L 0.2,
  3179. Emergency_Stop := L 0.3,
  3180. Single_Start := L 0.4,
  3181. Sequential_Start := L 0.5,
  3182. Contactor := L 0.6,
  3183. Circuit_Breaker := L 0.7,
  3184. Clock := L 1.0,
  3185. reset := L 1.1,
  3186. Delay_Time := T 10,
  3187. ON_Timer_1 := T 11,
  3188. ON_Time_1 := DB50.DBW 14,
  3189. Off_Timer_1 := T 12,
  3190. Off_Time_1 := DB50.DBW 16,
  3191. ON_Timer_2 := T 13,
  3192. Off_Timer_2 := T 14,
  3193. Contactor_Fault := DB2.DBX 2.1,
  3194. CB_Fault := DB2.DBX 2.2,
  3195. Motor_ON := Q 20.0);
  3196. NOP 0;
  3197. NETWORK
  3198. TITLE =
  3199. A I 40.3;
  3200. = L 0.0;
  3201. BLD 103;
  3202. A I 1.0;
  3203. = L 0.1;
  3204. BLD 103;
  3205. A I 1.1;
  3206. = L 0.2;
  3207. BLD 103;
  3208. A I 0.7;
  3209. = L 0.3;
  3210. BLD 103;
  3211. A I 42.3;
  3212. = L 0.4;
  3213. BLD 103;
  3214. A M 21.1;
  3215. = L 0.5;
  3216. BLD 103;
  3217. A I 1.2;
  3218. = L 0.6;
  3219. BLD 103;
  3220. A I 1.3;
  3221. = L 0.7;
  3222. BLD 103;
  3223. A M 2.5;
  3224. = L 1.0;
  3225. BLD 103;
  3226. A M 13.0;
  3227. = L 1.1;
  3228. BLD 103;
  3229. CALL FB 3 , DB 52 (
  3230. Central_Local := L 0.0,
  3231. LB_Start := L 0.1,
  3232. LB_Stop := L 0.2,
  3233. Emergency_Stop := L 0.3,
  3234. Single_Start := L 0.4,
  3235. Sequential_Start := L 0.5,
  3236. Contactor := L 0.6,
  3237. Circuit_Breaker := L 0.7,
  3238. Clock := L 1.0,
  3239. reset := L 1.1,
  3240. Delay_Time := T 15,
  3241. ON_Timer_1 := T 16,
  3242. Off_Timer_1 := T 17,
  3243. Off_Time_1 := DB50.DBW 26,
  3244. ON_Timer_2 := T 18,
  3245. ON_Time_2 := DB50.DBW 24,
  3246. Off_Timer_2 := T 19,
  3247. Off_Time_2 := DB50.DBW 28,
  3248. Contactor_Fault := DB2.DBX 2.4,
  3249. CB_Fault := DB2.DBX 2.5,
  3250. Motor_ON := Q 20.1);
  3251. NOP 0;
  3252. NETWORK
  3253. TITLE =
  3254. A I 40.3;
  3255. = L 0.0;
  3256. BLD 103;
  3257. A I 1.5;
  3258. = L 0.1;
  3259. BLD 103;
  3260. A I 1.6;
  3261. = L 0.2;
  3262. BLD 103;
  3263. A I 1.4;
  3264. = L 0.3;
  3265. BLD 103;
  3266. A I 42.4;
  3267. = L 0.4;
  3268. BLD 103;
  3269. A M 21.1;
  3270. = L 0.5;
  3271. BLD 103;
  3272. A I 1.7;
  3273. = L 0.6;
  3274. BLD 103;
  3275. A I 4.0;
  3276. = L 0.7;
  3277. BLD 103;
  3278. A M 2.5;
  3279. = L 1.0;
  3280. BLD 103;
  3281. A M 13.0;
  3282. = L 1.1;
  3283. BLD 103;
  3284. CALL FB 3 , DB 53 (
  3285. Central_Local := L 0.0,
  3286. LB_Start := L 0.1,
  3287. LB_Stop := L 0.2,
  3288. Emergency_Stop := L 0.3,
  3289. Single_Start := L 0.4,
  3290. Sequential_Start := L 0.5,
  3291. Contactor := L 0.6,
  3292. Circuit_Breaker := L 0.7,
  3293. Clock := L 1.0,
  3294. reset := L 1.1,
  3295. Delay_Time := T 20,
  3296. ON_Timer_1 := T 21,
  3297. Off_Timer_1 := T 51,
  3298. Off_Time_1 := DB50.DBW 38,
  3299. ON_Timer_2 := T 22,
  3300. ON_Time_2 := DB50.DBW 36,
  3301. Off_Timer_2 := T 23,
  3302. Off_Time_2 := DB50.DBW 40,
  3303. Contactor_Fault := DB2.DBX 2.7,
  3304. CB_Fault := DB2.DBX 3.0,
  3305. Motor_ON := Q 20.2);
  3306. NOP 0;
  3307. NETWORK
  3308. TITLE =
  3309. A I 40.3;
  3310. = L 0.0;
  3311. BLD 103;
  3312. A I 4.2;
  3313. = L 0.1;
  3314. BLD 103;
  3315. A I 4.3;
  3316. = L 0.2;
  3317. BLD 103;
  3318. A I 4.1;
  3319. = L 0.3;
  3320. BLD 103;
  3321. A I 42.5;
  3322. = L 0.4;
  3323. BLD 103;
  3324. A M 21.1;
  3325. = L 0.5;
  3326. BLD 103;
  3327. A I 4.3;
  3328. = L 0.6;
  3329. BLD 103;
  3330. A I 4.5;
  3331. = L 0.7;
  3332. BLD 103;
  3333. A M 2.5;
  3334. = L 1.0;
  3335. BLD 103;
  3336. A M 13.0;
  3337. = L 1.1;
  3338. BLD 103;
  3339. CALL FB 3 , DB 61 (
  3340. Central_Local := L 0.0,
  3341. LB_Start := L 0.1,
  3342. LB_Stop := L 0.2,
  3343. Emergency_Stop := L 0.3,
  3344. Single_Start := L 0.4,
  3345. Sequential_Start := L 0.5,
  3346. Contactor := L 0.6,
  3347. Circuit_Breaker := L 0.7,
  3348. Clock := L 1.0,
  3349. reset := L 1.1,
  3350. Delay_Time := T 24,
  3351. ON_Timer_1 := T 25,
  3352. ON_Time_1 := 0,
  3353. Off_Timer_1 := T 26,
  3354. Off_Time_1 := DB50.DBW 20,
  3355. ON_Timer_2 := T 27,
  3356. ON_Time_2 := DB50.DBW 18,
  3357. Off_Timer_2 := T 28,
  3358. Off_Time_2 := DB50.DBW 22,
  3359. Contactor_Fault := DB2.DBX 3.2,
  3360. CB_Fault := DB2.DBX 3.3,
  3361. Motor_ON := Q 20.3);
  3362. NOP 0;
  3363. NETWORK
  3364. TITLE =
  3365. A I 40.3;
  3366. = L 0.0;
  3367. BLD 103;
  3368. A I 4.7;
  3369. = L 0.1;
  3370. BLD 103;
  3371. A I 5.0;
  3372. = L 0.2;
  3373. BLD 103;
  3374. A I 4.6;
  3375. = L 0.3;
  3376. BLD 103;
  3377. A I 42.6;
  3378. = L 0.4;
  3379. BLD 103;
  3380. A M 21.1;
  3381. = L 0.5;
  3382. BLD 103;
  3383. A I 5.1;
  3384. = L 0.6;
  3385. BLD 103;
  3386. A I 5.2;
  3387. = L 0.7;
  3388. BLD 103;
  3389. A M 2.5;
  3390. = L 1.0;
  3391. BLD 103;
  3392. A M 13.0;
  3393. = L 1.1;
  3394. BLD 103;
  3395. CALL FB 3 , DB 62 (
  3396. Central_Local := L 0.0,
  3397. LB_Start := L 0.1,
  3398. LB_Stop := L 0.2,
  3399. Emergency_Stop := L 0.3,
  3400. Single_Start := L 0.4,
  3401. Sequential_Start := L 0.5,
  3402. Contactor := L 0.6,
  3403. Circuit_Breaker := L 0.7,
  3404. Clock := L 1.0,
  3405. reset := L 1.1,
  3406. Delay_Time := T 29,
  3407. ON_Timer_1 := T 30,
  3408. ON_Time_1 := DB50.DBW 30,
  3409. Off_Timer_1 := T 31,
  3410. Off_Time_1 := DB50.DBW 34,
  3411. ON_Timer_2 := T 32,
  3412. ON_Time_2 := DB50.DBW 32,
  3413. Off_Timer_2 := T 33,
  3414. Off_Time_2 := 0,
  3415. Contactor_Fault := DB2.DBX 3.5,
  3416. CB_Fault := DB2.DBX 3.6,
  3417. Motor_ON := Q 20.4);
  3418. NOP 0;
  3419. NETWORK
  3420. TITLE =
  3421. A I 40.3;
  3422. = L 0.0;
  3423. BLD 103;
  3424. A I 5.4;
  3425. = L 0.1;
  3426. BLD 103;
  3427. A I 5.5;
  3428. = L 0.2;
  3429. BLD 103;
  3430. A I 5.3;
  3431. = L 0.3;
  3432. BLD 103;
  3433. A I 42.7;
  3434. = L 0.4;
  3435. BLD 103;
  3436. A M 21.1;
  3437. = L 0.5;
  3438. BLD 103;
  3439. A I 5.6;
  3440. = L 0.6;
  3441. BLD 103;
  3442. A I 5.7;
  3443. = L 0.7;
  3444. BLD 103;
  3445. A M 2.5;
  3446. = L 1.0;
  3447. BLD 103;
  3448. A M 13.0;
  3449. = L 1.1;
  3450. BLD 103;
  3451. CALL FB 3 , DB 63 (
  3452. Central_Local := L 0.0,
  3453. LB_Start := L 0.1,
  3454. LB_Stop := L 0.2,
  3455. Emergency_Stop := L 0.3,
  3456. Single_Start := L 0.4,
  3457. Sequential_Start := L 0.5,
  3458. Contactor := L 0.6,
  3459. Circuit_Breaker := L 0.7,
  3460. Clock := L 1.0,
  3461. reset := L 1.1,
  3462. Delay_Time := T 34,
  3463. ON_Timer_1 := T 35,
  3464. ON_Time_1 := DB50.DBW 42,
  3465. Off_Timer_1 := T 36,
  3466. Off_Time_1 := DB50.DBW 46,
  3467. ON_Timer_2 := T 37,
  3468. ON_Time_2 := DB50.DBW 44,
  3469. Off_Timer_2 := T 38,
  3470. Contactor_Fault := DB2.DBX 4.0,
  3471. CB_Fault := DB2.DBX 4.1,
  3472. Motor_ON := Q 20.5);
  3473. NOP 0;
  3474. NETWORK
  3475. TITLE =
  3476. A DB51.DBX 20.4;
  3477. FP M 14.0;
  3478. JNB _001;
  3479. L MW 8;
  3480. L 1;
  3481. +I ;
  3482. T MW 8;
  3483. _001: NOP 0;
  3484. END_FUNCTION
  3485. ORGANIZATION_BLOCK OB 1
  3486. TITLE = "Main Program Sweep (Cycle)"
  3487. VERSION : 0.1
  3488. VAR_TEMP
  3489. OB1_EV_CLASS : BYTE ; //Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1)
  3490. OB1_SCAN_1 : BYTE ; //1 (Cold restart scan 1 of OB 1), 3 (Scan 2-n of OB 1)
  3491. OB1_PRIORITY : BYTE ; //Priority of OB Execution
  3492. OB1_OB_NUMBR : BYTE ; //1 (Organization block 1, OB1)
  3493. OB1_RESERVED_1 : BYTE ; //Reserved for system
  3494. OB1_RESERVED_2 : BYTE ; //Reserved for system
  3495. OB1_PREV_CYCLE : INT ; //Cycle time of previous OB1 scan (milliseconds)
  3496. OB1_MIN_CYCLE : INT ; //Minimum cycle time of OB1 (milliseconds)
  3497. OB1_MAX_CYCLE : INT ; //Maximum cycle time of OB1 (milliseconds)
  3498. OB1_DATE_TIME : DATE_AND_TIME ; //Date and time OB1 started
  3499. END_VAR
  3500. BEGIN
  3501. NETWORK
  3502. TITLE =
  3503. CALL FC 4 ;
  3504. NOP 0;
  3505. NETWORK
  3506. TITLE =
  3507. CALL FC 1 ;
  3508. NOP 0;
  3509. NETWORK
  3510. TITLE =
  3511. CALL FC 2 ;
  3512. NOP 0;
  3513. NETWORK
  3514. TITLE =
  3515. CALL FC 3 ;
  3516. NOP 0;
  3517. NETWORK
  3518. TITLE =
  3519. CALL FC 5 ;
  3520. NOP 0;
  3521. NETWORK
  3522. TITLE =
  3523. CALL FC 7 ;
  3524. NOP 0;
  3525. NETWORK
  3526. TITLE =
  3527. CALL FB 4 , DB 50 ;
  3528. NOP 0;
  3529. END_ORGANIZATION_BLOCK
  3530. ORGANIZATION_BLOCK OB 82
  3531. VERSION : 0.1
  3532. VAR_TEMP
  3533. TEMP0 : BYTE ;
  3534. TEMP1 : BYTE ;
  3535. TEMP2 : BYTE ;
  3536. TEMP3 : BYTE ;
  3537. TEMP4 : BYTE ;
  3538. TEMP5 : BYTE ;
  3539. TEMP6 : WORD ;
  3540. TEMP7 : BOOL ;
  3541. TEMP8 : BOOL ;
  3542. TEMP9 : BOOL ;
  3543. TEMP10 : BOOL ;
  3544. TEMP11 : BOOL ;
  3545. TEMP12 : BOOL ;
  3546. TEMP13 : BOOL ;
  3547. TEMP14 : BOOL ;
  3548. TEMP15 : BYTE ;
  3549. TEMP16 : BOOL ;
  3550. TEMP17 : BOOL ;
  3551. TEMP18 : BOOL ;
  3552. TEMP19 : BOOL ;
  3553. TEMP20 : BOOL ;
  3554. TEMP21 : BOOL ;
  3555. TEMP22 : BOOL ;
  3556. TEMP23 : BOOL ;
  3557. TEMP24 : BOOL ;
  3558. TEMP25 : BOOL ;
  3559. TEMP26 : BOOL ;
  3560. TEMP27 : BOOL ;
  3561. TEMP28 : BOOL ;
  3562. TEMP29 : BOOL ;
  3563. TEMP30 : BOOL ;
  3564. TEMP31 : BOOL ;
  3565. TEMP32 : DATE_AND_TIME ;
  3566. END_VAR
  3567. BEGIN
  3568. END_ORGANIZATION_BLOCK
  3569. ORGANIZATION_BLOCK OB 85
  3570. TITLE = "Organization Block (OB) Not Loaded Fault"
  3571. VERSION : 0.1
  3572. VAR_TEMP
  3573. OB85_EV_CLASS : BYTE ; //16#35 Event class 3
  3574. OB85_FLT_ID : BYTE ; //16#XX, Fault identification code
  3575. OB85_PRIORITY : BYTE ; //Priority of OB Execution
  3576. OB85_OB_NUMBR : BYTE ; //85 (Organization block 85, OB85)
  3577. OB85_RESERVED_1 : BYTE ; //Reserved for system
  3578. OB85_RESERVED_2 : BYTE ; //Reserved for system
  3579. OB85_RESERVED_3 : INT ; //Reserved for system
  3580. OB85_ERR_EV_CLASS : BYTE ; //Class of event causing error
  3581. OB85_ERR_EV_NUM : BYTE ; //Number of event causing error
  3582. OB85_OB_PRIOR : BYTE ; //Priority of OB causing error
  3583. OB85_OB_NUM : BYTE ; //Number of OB causing error
  3584. OB85_DATE_TIME : DATE_AND_TIME ; //Date and time OB85 started
  3585. END_VAR
  3586. BEGIN
  3587. END_ORGANIZATION_BLOCK
  3588. ORGANIZATION_BLOCK OB 86
  3589. VERSION : 0.1
  3590. VAR_TEMP
  3591. TEMP0 : BYTE ;
  3592. TEMP1 : BYTE ;
  3593. TEMP2 : BYTE ;
  3594. TEMP3 : BYTE ;
  3595. TEMP4 : BYTE ;
  3596. TEMP5 : BYTE ;
  3597. TEMP6 : WORD ;
  3598. TEMP7 : ARRAY [0 .. 31 ] OF BOOL ;
  3599. TEMP8 : DATE_AND_TIME ;
  3600. END_VAR
  3601. BEGIN
  3602. END_ORGANIZATION_BLOCK
  3603. ORGANIZATION_BLOCK OB 87
  3604. TITLE = "Communication Fault"
  3605. VERSION : 0.1
  3606. VAR_TEMP
  3607. OB87_EV_CLASS : BYTE ; //16#39 Event class 3
  3608. OB87_FLT_ID : BYTE ; //16#XX, Fault identifcation code
  3609. OB87_PRIORITY : BYTE ; //Priority of OB Execution
  3610. OB87_OB_NUMBR : BYTE ; //87 (Organization block 87, OB87)
  3611. OB87_RESERVED_1 : BYTE ; //Reserved for system
  3612. OB87_RESERVED_2 : BYTE ; //Reserved for system
  3613. OB87_RESERVED_3 : WORD ; //Reserved for system
  3614. OB87_RESERVED_4 : DWORD ; //Reserved for system
  3615. OB87_DATE_TIME : DATE_AND_TIME ; //Date and time OB87 started
  3616. END_VAR
  3617. BEGIN
  3618. END_ORGANIZATION_BLOCK
  3619. ORGANIZATION_BLOCK OB 121
  3620. TITLE = "Programming Error"
  3621. VERSION : 0.1
  3622. VAR_TEMP
  3623. OB121_EV_CLASS : BYTE ; //16#25, Event class 2, Entering event state, Internal fault event
  3624. OB121_SW_FLT : BYTE ; //16#XX Software programming fault
  3625. OB121_PRIORITY : BYTE ; //Priority of OB Execution
  3626. OB121_OB_NUMBR : BYTE ; //121 (Organization block 121, OB121)
  3627. OB121_BLK_TYPE : BYTE ; //16#88/8A/8B/8C/8E Type of block fault occured in
  3628. OB121_RESERVED_1 : BYTE ; //Reserved for system
  3629. OB121_FLT_REG : WORD ; //16#XX Specific register that caused fault
  3630. OB121_BLK_NUM : WORD ; //Number of block that programming fault occured in
  3631. OB121_PRG_ADDR : WORD ; //Address in block where programming fault occured
  3632. OB121_DATE_TIME : DATE_AND_TIME ; //Date and time OB121 started
  3633. END_VAR
  3634. BEGIN
  3635. END_ORGANIZATION_BLOCK
  3636. ORGANIZATION_BLOCK OB 122
  3637. VERSION : 0.1
  3638. VAR_TEMP
  3639. TEMP0 : BYTE ;
  3640. TEMP1 : BYTE ;
  3641. TEMP2 : BYTE ;
  3642. TEMP3 : BYTE ;
  3643. TEMP4 : BYTE ;
  3644. TEMP5 : BYTE ;
  3645. TEMP6 : WORD ;
  3646. TEMP7 : WORD ;
  3647. TEMP8 : WORD ;
  3648. TEMP9 : DATE_AND_TIME ;
  3649. END_VAR
  3650. BEGIN
  3651. END_ORGANIZATION_BLOCK