123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858 |
- DATA_BLOCK DB 1
- TITLE =
- VERSION : 0.1
- STRUCT
- HandShake : BOOL ; //Temporary placeholder variable
- Profibus_Control : BOOL ;
- Alarm_Common : BOOL ;
- Central_Local : BOOL ;
- Feedback_Run : BOOL ;
- Profibus_Alarm : BOOL ;
- Spare_06 : BOOL ;
- Spare_07 : BOOL ;
- Rapping_51_Local : BOOL ;
- Spare_011 : BOOL ;
- Rapping_51_Return : BOOL ;
- Rapping_51_Ready : BOOL ;
- Rapping_52_Local : BOOL ;
- Spare_015 : BOOL ;
- Rapping_52_Return : BOOL ;
- Rapping_52_Ready : BOOL ;
- Rapping_53_Local : BOOL ;
- Spare_021 : BOOL ;
- Rapping_53_Return : BOOL ;
- Rapping_53_Ready : BOOL ;
- Rapping_61_Local : BOOL ;
- Spare_025 : BOOL ;
- Rapping_61_Return : BOOL ;
- Rapping_61_Ready : BOOL ;
- Rapping_62_Local : BOOL ;
- Spare_031 : BOOL ;
- Rapping_62_Return : BOOL ;
- Rapping_62_Ready : BOOL ;
- Rapping_63_Local : BOOL ;
- Spare_035 : BOOL ;
- Rapping_63_Return : BOOL ;
- Rapping_63_Ready : BOOL ;
- Rotary_71_Local : BOOL ;
- Rotary_71_Speed : BOOL ;
- Rotary_71_Return : BOOL ;
- Rotary_71_Ready : BOOL ;
- Rotary_72_Local : BOOL ;
- Rotary_72_Speed : BOOL ;
- Rotary_72_Return : BOOL ;
- Rotary_72_Ready : BOOL ;
- Rotary_81_Local : BOOL ;
- Rotary_81_Speed : BOOL ;
- Rotary_81_Return : BOOL ;
- Rotary_81_Ready : BOOL ;
- Rotary_82_Local : BOOL ;
- Rotary_82_Speed : BOOL ;
- Rotary_82_Return : BOOL ;
- Rotary_82_Ready : BOOL ;
- Circuit_Breaker_C1 : BOOL ;
- Circuit_Breaker_c2 : BOOL ;
- Trans_1_Ready : BOOL ;
- Trans_1_Fault : BOOL ;
- Trans_1_Return : BOOL ;
- Trans_2_Ready : BOOL ;
- Trans_2_Fault : BOOL ;
- Trans_2_Return : BOOL ;
- Trans_3_Ready : BOOL ;
- Trans_3_Fault : BOOL ;
- Trans_3_Return : BOOL ;
- spare8_9 : INT ;
- Field_1_KV : INT ;
- Field_1_mA : INT ;
- Field_2_KV : INT ;
- Field_2_mA : INT ;
- Field_3_KV : INT ;
- Field_3_mA : INT ;
- END_STRUCT ;
- BEGIN
- HandShake := FALSE;
- Profibus_Control := FALSE;
- Alarm_Common := FALSE;
- Central_Local := FALSE;
- Feedback_Run := FALSE;
- Profibus_Alarm := FALSE;
- Spare_06 := FALSE;
- Spare_07 := FALSE;
- Rapping_51_Local := FALSE;
- Spare_011 := FALSE;
- Rapping_51_Return := FALSE;
- Rapping_51_Ready := FALSE;
- Rapping_52_Local := FALSE;
- Spare_015 := FALSE;
- Rapping_52_Return := FALSE;
- Rapping_52_Ready := FALSE;
- Rapping_53_Local := FALSE;
- Spare_021 := FALSE;
- Rapping_53_Return := FALSE;
- Rapping_53_Ready := FALSE;
- Rapping_61_Local := FALSE;
- Spare_025 := FALSE;
- Rapping_61_Return := FALSE;
- Rapping_61_Ready := FALSE;
- Rapping_62_Local := FALSE;
- Spare_031 := FALSE;
- Rapping_62_Return := FALSE;
- Rapping_62_Ready := FALSE;
- Rapping_63_Local := FALSE;
- Spare_035 := FALSE;
- Rapping_63_Return := FALSE;
- Rapping_63_Ready := FALSE;
- Rotary_71_Local := FALSE;
- Rotary_71_Speed := FALSE;
- Rotary_71_Return := FALSE;
- Rotary_71_Ready := FALSE;
- Rotary_72_Local := FALSE;
- Rotary_72_Speed := FALSE;
- Rotary_72_Return := FALSE;
- Rotary_72_Ready := FALSE;
- Rotary_81_Local := FALSE;
- Rotary_81_Speed := FALSE;
- Rotary_81_Return := FALSE;
- Rotary_81_Ready := FALSE;
- Rotary_82_Local := FALSE;
- Rotary_82_Speed := FALSE;
- Rotary_82_Return := FALSE;
- Rotary_82_Ready := FALSE;
- Circuit_Breaker_C1 := FALSE;
- Circuit_Breaker_c2 := FALSE;
- Trans_1_Ready := FALSE;
- Trans_1_Fault := FALSE;
- Trans_1_Return := FALSE;
- Trans_2_Ready := FALSE;
- Trans_2_Fault := FALSE;
- Trans_2_Return := FALSE;
- Trans_3_Ready := FALSE;
- Trans_3_Fault := FALSE;
- Trans_3_Return := FALSE;
- spare8_9 := 0;
- Field_1_KV := 0;
- Field_1_mA := 0;
- Field_2_KV := 0;
- Field_2_mA := 0;
- Field_3_KV := 0;
- Field_3_mA := 0;
- END_DATA_BLOCK
- DATA_BLOCK DB 2
- TITLE =
- VERSION : 0.1
- STRUCT
- Emergency_Stop_71 : BOOL ;
- Speed_Switch_71 : BOOL ;
- Contactor_FB_71 : BOOL ;
- Circuit_Breaker_71 : BOOL ;
- Emergency_Stop_72 : BOOL ;
- Speed_Switch_72 : BOOL ;
- Contactor_FB_72 : BOOL ;
- Circuit_Breaker_72 : BOOL ;
- Emergency_Stop_81 : BOOL ;
- Speed_Switch_81 : BOOL ;
- Contactor_FB_81 : BOOL ;
- Circuit_Breaker_81 : BOOL ;
- Emergency_Stop_82 : BOOL ;
- Speed_Switch_82 : BOOL ;
- Contactor_FB_82 : BOOL ;
- Circuit_Breaker_82 : BOOL ;
- Emergency_Stop_51 : BOOL ;
- Contactor_FB_51 : BOOL ;
- Circuit_Breaker_51 : BOOL ;
- Emergency_Stop_52 : BOOL ;
- Contactor_FB_52 : BOOL ;
- Circuit_Breaker_52 : BOOL ;
- Emergency_Stop_53 : BOOL ;
- Contactor_FB_53 : BOOL ;
- Circuit_Breaker_53 : BOOL ;
- Emergency_Stop_61 : BOOL ;
- Contactor_FB_61 : BOOL ;
- Circuit_Breaker_61 : BOOL ;
- Emergency_Stop_62 : BOOL ;
- Contactor_FB_62 : BOOL ;
- Circuit_Breaker_62 : BOOL ;
- Emergency_Stop_63 : BOOL ;
- Contactor_FB_63 : BOOL ;
- Circuit_Breaker_63 : BOOL ;
- Circuit_Breaker_C1_Alarm : BOOL ;
- SPARE_1 : BOOL ;
- SPARE_2 : BOOL ;
- Circuit_Breaker_C4_Alarm : BOOL ;
- PROFIBUS_ALARM : BOOL ;
- END_STRUCT ;
- BEGIN
- Emergency_Stop_71 := FALSE;
- Speed_Switch_71 := FALSE;
- Contactor_FB_71 := FALSE;
- Circuit_Breaker_71 := FALSE;
- Emergency_Stop_72 := FALSE;
- Speed_Switch_72 := FALSE;
- Contactor_FB_72 := FALSE;
- Circuit_Breaker_72 := FALSE;
- Emergency_Stop_81 := FALSE;
- Speed_Switch_81 := FALSE;
- Contactor_FB_81 := FALSE;
- Circuit_Breaker_81 := FALSE;
- Emergency_Stop_82 := FALSE;
- Speed_Switch_82 := FALSE;
- Contactor_FB_82 := FALSE;
- Circuit_Breaker_82 := FALSE;
- Emergency_Stop_51 := FALSE;
- Contactor_FB_51 := FALSE;
- Circuit_Breaker_51 := FALSE;
- Emergency_Stop_52 := FALSE;
- Contactor_FB_52 := FALSE;
- Circuit_Breaker_52 := FALSE;
- Emergency_Stop_53 := FALSE;
- Contactor_FB_53 := FALSE;
- Circuit_Breaker_53 := FALSE;
- Emergency_Stop_61 := FALSE;
- Contactor_FB_61 := FALSE;
- Circuit_Breaker_61 := FALSE;
- Emergency_Stop_62 := FALSE;
- Contactor_FB_62 := FALSE;
- Circuit_Breaker_62 := FALSE;
- Emergency_Stop_63 := FALSE;
- Contactor_FB_63 := FALSE;
- Circuit_Breaker_63 := FALSE;
- Circuit_Breaker_C1_Alarm := FALSE;
- SPARE_1 := FALSE;
- SPARE_2 := FALSE;
- Circuit_Breaker_C4_Alarm := FALSE;
- PROFIBUS_ALARM := FALSE;
- END_DATA_BLOCK
- FUNCTION_BLOCK FB 1
- TITLE =One Way Motor
- VERSION : 0.1
- VAR_INPUT
- Central_Local : BOOL ;
- LB_Start : BOOL ;
- LB_Stop : BOOL ;
- Emergency_Stop : BOOL ;
- Single_Start : BOOL ;
- Group_Start : BOOL ;
- Group_Stop : BOOL ;
- Interlock : BOOL ;
- Speed_Switch : BOOL ;
- Contactor : BOOL ;
- Circuit_Breaker : BOOL ;
- Clock : BOOL ;
- reset : BOOL ;
- Delay_Time : TIMER ;
- Group_ON_Timer : TIMER ;
- ON_Delay : S5TIME ;
- Group_Off_Timer : TIMER ;
- Off_Delay : S5TIME ;
- END_VAR
- VAR_OUTPUT
- Speed_Switch_Fault : BOOL ;
- Contactor_Fault : BOOL ;
- CB_Fault : BOOL ;
- Interlock_Fault : BOOL ;
- Warning : BOOL ;
- Common_Alarm : BOOL ;
- Motor_ON : BOOL ;
- END_VAR
- VAR
- Temp1 : BOOL ;
- temp2 : BOOL ;
- temp3 : BOOL ;
- temp4 : BOOL ;
- temp5 : BOOL ;
- temp6 : BOOL ;
- temp7 : BOOL ;
- temp8 : BOOL ;
- temp9 : BOOL ;
- temp10 : BOOL ;
- temp11 : BOOL ;
- temp12 : BOOL ;
- temp13 : BOOL ;
- END_VAR
- BEGIN
- NETWORK
- TITLE =
- //If System Change to Local Mode then Motor Turn Off
- AN #Central_Local;
- FP #temp7;
- R #Temp1;
- NETWORK
- TITLE =Start by Local Box
- A #Emergency_Stop;
- AN #Central_Local;
- A #LB_Start;
- S #Temp1;
- A( ;
- ON #Emergency_Stop;
- O ;
- AN #Central_Local;
- AN #LB_Stop;
- O #temp8;
- ) ;
- R #Temp1;
- A #Temp1;
- = #Motor_ON;
- NETWORK
- TITLE =Start Single
- A #Emergency_Stop;
- A #Central_Local;
- A #Single_Start;
- S #Temp1;
- A( ;
- ON #Emergency_Stop;
- O( ;
- AN #Single_Start;
- FP #temp11;
- A #Central_Local;
- ) ;
- O #temp8;
- ) ;
- R #Temp1;
- A #Temp1;
- = #Motor_ON;
- NETWORK
- TITLE =
- A #Interlock;
- A #Central_Local;
- A #Group_Start;
- L #ON_Delay;
- SD #Group_ON_Timer;
- NETWORK
- TITLE =
- A #Central_Local;
- A( ;
- O #Group_Stop;
- O #Group_Start;
- ) ;
- L #Off_Delay;
- SF #Group_Off_Timer;
- NETWORK
- TITLE =
- A #Group_ON_Timer;
- A #Emergency_Stop;
- S #Temp1;
- A( ;
- ON #Emergency_Stop;
- O( ;
- AN #Group_Off_Timer;
- FP #temp12;
- ) ;
- O ;
- AN #Single_Start;
- A #Common_Alarm;
- A #Central_Local;
- ) ;
- R #Temp1;
- A #Temp1;
- = #Motor_ON;
- NETWORK
- TITLE =Delay for Checking Feedback
- A #Motor_ON;
- L S5T#5S;
- SD #Delay_Time;
- NETWORK
- TITLE =Checking Contactor Feedback
- AN #Contactor;
- A #Delay_Time;
- A #Motor_ON;
- S #temp3;
- A #reset;
- R #temp3;
- A #temp3;
- = #Contactor_Fault;
- NETWORK
- TITLE =Checking Speed Switch Feedback
- AN #Speed_Switch;
- A #Delay_Time;
- A #Motor_ON;
- S #temp4;
- A #reset;
- R #temp4;
- A #temp4;
- = #Speed_Switch_Fault;
- NETWORK
- TITLE =Checking Circuit Breaker Feedback
- A #Circuit_Breaker;
- S #temp5;
- A #reset;
- R #temp5;
- A #temp5;
- = #CB_Fault;
- NETWORK
- TITLE =Checking Interlocking
- AN #Interlock;
- A #Motor_ON;
- S #temp6;
- A #reset;
- R #temp6;
- A #temp6;
- = #Interlock_Fault;
- NETWORK
- TITLE =Make Common Alarm
- //If System in Central Mode Dont Check Interlock
- O #Contactor_Fault;
- O #Speed_Switch_Fault;
- O #CB_Fault;
- = #temp8;
- NETWORK
- TITLE =
- A #Interlock_Fault;
- A #Central_Local;
- O #temp8;
- = #Common_Alarm;
- NETWORK
- TITLE =Blancking Alarm
- A( ;
- O #Common_Alarm;
- ON #Emergency_Stop;
- ) ;
- A #Clock;
- = #Warning;
- END_FUNCTION_BLOCK
- DATA_BLOCK DB 71
- TITLE =
- VERSION : 0.0
- FB 1
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Group_Start := FALSE;
- Group_Stop := FALSE;
- Interlock := FALSE;
- Speed_Switch := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Delay_Time := T 0;
- Group_ON_Timer := T 0;
- ON_Delay := S5T#0MS;
- Group_Off_Timer := T 0;
- Off_Delay := S5T#0MS;
- Speed_Switch_Fault := FALSE;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Interlock_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := FALSE;
- temp10 := FALSE;
- temp11 := FALSE;
- temp12 := FALSE;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 72
- TITLE =
- VERSION : 0.0
- FB 1
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Group_Start := FALSE;
- Group_Stop := FALSE;
- Interlock := FALSE;
- Speed_Switch := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Delay_Time := T 0;
- Group_ON_Timer := T 0;
- ON_Delay := S5T#0MS;
- Group_Off_Timer := T 0;
- Off_Delay := S5T#0MS;
- Speed_Switch_Fault := FALSE;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Interlock_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := FALSE;
- temp10 := FALSE;
- temp11 := FALSE;
- temp12 := FALSE;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 81
- TITLE =
- VERSION : 0.0
- FB 1
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Group_Start := FALSE;
- Group_Stop := FALSE;
- Interlock := FALSE;
- Speed_Switch := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Delay_Time := T 0;
- Group_ON_Timer := T 0;
- ON_Delay := S5T#0MS;
- Group_Off_Timer := T 0;
- Off_Delay := S5T#0MS;
- Speed_Switch_Fault := FALSE;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Interlock_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := FALSE;
- temp10 := FALSE;
- temp11 := FALSE;
- temp12 := FALSE;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 82
- TITLE =
- VERSION : 0.0
- FB 1
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Group_Start := FALSE;
- Group_Stop := FALSE;
- Interlock := FALSE;
- Speed_Switch := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Delay_Time := T 0;
- Group_ON_Timer := T 0;
- ON_Delay := S5T#0MS;
- Group_Off_Timer := T 0;
- Off_Delay := S5T#0MS;
- Speed_Switch_Fault := FALSE;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Interlock_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := FALSE;
- temp10 := FALSE;
- temp11 := FALSE;
- temp12 := FALSE;
- temp13 := FALSE;
- END_DATA_BLOCK
- FUNCTION_BLOCK FB 3
- TITLE =Rapping Motor
- VERSION : 0.1
- VAR_INPUT
- Central_Local : BOOL ;
- LB_Start : BOOL ;
- LB_Stop : BOOL ;
- Emergency_Stop : BOOL ;
- Single_Start : BOOL ;
- Sequential_Start : BOOL ;
- Contactor : BOOL ;
- Circuit_Breaker : BOOL ;
- Clock : BOOL ;
- reset : BOOL ;
- Synchronize : BOOL ;
- Delay_Time : TIMER ;
- ON_Timer_1 : TIMER ;
- ON_Time_1 : INT ;
- Off_Timer_1 : TIMER ;
- Off_Time_1 : INT ;
- ON_Timer_2 : TIMER ;
- ON_Time_2 : INT ;
- Off_Timer_2 : TIMER ;
- Off_Time_2 : INT ;
- END_VAR
- VAR_OUTPUT
- Contactor_Fault : BOOL ;
- CB_Fault : BOOL ;
- Warning : BOOL ;
- Common_Alarm : BOOL ;
- Motor_ON : BOOL ;
- END_VAR
- VAR
- Temp1 : BOOL ;
- temp2 : BOOL ;
- temp3 : BOOL ;
- temp4 : BOOL ;
- temp5 : BOOL ;
- temp6 : BOOL ;
- temp7 : BOOL ;
- temp8 : BOOL ;
- temp9 : WORD ;
- temp10 : WORD ;
- temp11 : WORD ;
- temp12 : WORD ;
- temp13 : BOOL ;
- END_VAR
- VAR_TEMP
- TempS5 : S5TIME ;
- temp : INT ;
- END_VAR
- BEGIN
- NETWORK
- TITLE =
- //If System Change to Local Mode then Motor Turn Off
- AN #Central_Local;
- FP #temp2;
- R #Temp1;
- NETWORK
- TITLE =Start by Local Box
- A #Emergency_Stop;
- AN #Common_Alarm;
- AN #Central_Local;
- A #LB_Start;
- S #Temp1;
- A( ;
- ON #Emergency_Stop;
- O ;
- AN #Central_Local;
- AN #LB_Stop;
- O #Common_Alarm;
- ) ;
- R #Temp1;
- A #Temp1;
- = #Motor_ON;
- NETWORK
- TITLE =Start Single
- A #Emergency_Stop;
- AN #Common_Alarm;
- A #Central_Local;
- A #Single_Start;
- S #Temp1;
- A( ;
- ON #Emergency_Stop;
- O( ;
- AN #Single_Start;
- FP #temp3;
- A #Central_Local;
- ) ;
- O #Common_Alarm;
- ) ;
- R #Temp1;
- A #Temp1;
- = #Motor_ON;
- NETWORK
- TITLE =
- A #Motor_ON;
- L S5T#5S;
- SD #Delay_Time;
- NETWORK
- TITLE =
- A #Motor_ON;
- A #Delay_Time;
- AN #Contactor;
- S #Contactor_Fault;
- A #reset;
- R #Contactor_Fault;
- NOP 0;
- NETWORK
- TITLE =
- A #Circuit_Breaker;
- S #CB_Fault;
- A #reset;
- R #CB_Fault;
- NOP 0;
- NETWORK
- TITLE =
- ON #Emergency_Stop;
- O #Contactor_Fault;
- O #CB_Fault;
- = L 4.0;
- A L 4.0;
- BLD 102;
- = #Common_Alarm;
- A L 4.0;
- A #Clock;
- = #Warning;
- NETWORK
- TITLE =
- L #ON_Time_1;
- L 999;
- >=I ;
- = L 4.0;
- A( ;
- A( ;
- A L 4.0;
- JNB _001;
- L #ON_Time_1;
- L 10;
- /I ;
- T #temp;
- AN OV;
- SAVE ;
- CLR ;
- _001: A BR;
- ) ;
- JNB _002;
- L #temp;
- ITB ;
- T #temp9;
- AN OV;
- SAVE ;
- CLR ;
- _002: A BR;
- ) ;
- JNB _003;
- L #temp9;
- L W#16#3000;
- OW ;
- T #temp9;
- _003: NOP 0;
- A( ;
- AN L 4.0;
- JNB _004;
- L #ON_Time_1;
- ITB ;
- T #temp9;
- AN OV;
- SAVE ;
- CLR ;
- _004: A BR;
- ) ;
- JNB _005;
- L #temp9;
- L W#16#2000;
- OW ;
- T #temp9;
- _005: NOP 0;
- NETWORK
- TITLE =
- L #Off_Time_1;
- L 999;
- >=I ;
- = L 4.0;
- A( ;
- A( ;
- A L 4.0;
- JNB _006;
- L #Off_Time_1;
- L 10;
- /I ;
- T #temp;
- AN OV;
- SAVE ;
- CLR ;
- _006: A BR;
- ) ;
- JNB _007;
- L #temp;
- ITB ;
- T #temp10;
- AN OV;
- SAVE ;
- CLR ;
- _007: A BR;
- ) ;
- JNB _008;
- L #temp10;
- L W#16#3000;
- OW ;
- T #temp10;
- _008: NOP 0;
- A( ;
- AN L 4.0;
- JNB _009;
- L #Off_Time_1;
- ITB ;
- T #temp10;
- AN OV;
- SAVE ;
- CLR ;
- _009: A BR;
- ) ;
- JNB _00a;
- L #temp10;
- L W#16#2000;
- OW ;
- T #temp10;
- _00a: NOP 0;
- NETWORK
- TITLE =
- L #ON_Time_2;
- L 999;
- >=I ;
- = L 4.0;
- A( ;
- A( ;
- A L 4.0;
- JNB _00b;
- L #ON_Time_2;
- L 10;
- /I ;
- T #temp;
- AN OV;
- SAVE ;
- CLR ;
- _00b: A BR;
- ) ;
- JNB _00c;
- L #temp;
- ITB ;
- T #temp11;
- AN OV;
- SAVE ;
- CLR ;
- _00c: A BR;
- ) ;
- JNB _00d;
- L #temp11;
- L W#16#3000;
- OW ;
- T #temp11;
- _00d: NOP 0;
- A( ;
- AN L 4.0;
- JNB _00e;
- L #ON_Time_2;
- ITB ;
- T #temp11;
- AN OV;
- SAVE ;
- CLR ;
- _00e: A BR;
- ) ;
- JNB _00f;
- L #temp11;
- L W#16#2000;
- OW ;
- T #temp11;
- _00f: NOP 0;
- NETWORK
- TITLE =
- L #Off_Time_2;
- L 999;
- >=I ;
- = L 4.0;
- A( ;
- A( ;
- A L 4.0;
- JNB _010;
- L #Off_Time_2;
- L 10;
- /I ;
- T #temp;
- AN OV;
- SAVE ;
- CLR ;
- _010: A BR;
- ) ;
- JNB _011;
- L #temp;
- ITB ;
- T #temp12;
- AN OV;
- SAVE ;
- CLR ;
- _011: A BR;
- ) ;
- JNB _012;
- L #temp12;
- L W#16#3000;
- OW ;
- T #temp12;
- _012: NOP 0;
- A( ;
- AN L 4.0;
- JNB _013;
- L #Off_Time_2;
- ITB ;
- T #temp12;
- AN OV;
- SAVE ;
- CLR ;
- _013: A BR;
- ) ;
- JNB _014;
- L #temp12;
- L W#16#2000;
- OW ;
- T #temp12;
- _014: NOP 0;
- NETWORK
- TITLE =
- A #Synchronize;
- FP #temp8;
- NOT ;
- AN #Off_Timer_2;
- A #Central_Local;
- A #Sequential_Start;
- = #temp4;
- NETWORK
- TITLE =
- L #temp9;
- T #TempS5;
- NOP 0;
- NETWORK
- TITLE =
- A #temp4;
- L #TempS5;
- SD #ON_Timer_1;
- NETWORK
- TITLE =
- A #ON_Timer_1;
- A #Central_Local;
- A #Sequential_Start;
- = #temp5;
- NETWORK
- TITLE =
- L #temp10;
- T #TempS5;
- NOP 0;
- NETWORK
- TITLE =
- A #temp5;
- L #TempS5;
- SD #Off_Timer_1;
- NETWORK
- TITLE =
- A #Off_Timer_1;
- A #Central_Local;
- A #Sequential_Start;
- = #temp6;
- NETWORK
- TITLE =
- L #temp11;
- T #TempS5;
- NOP 0;
- NETWORK
- TITLE =
- A #temp6
- L #temp11
- SD #ON_Timer_2
- A #temp6;
- L #TempS5;
- SD #ON_Timer_2;
- NETWORK
- TITLE =
- A #ON_Timer_2;
- A #Central_Local;
- A #Sequential_Start;
- = #temp7;
- NETWORK
- TITLE =
- L #temp12;
- T #TempS5;
- NOP 0;
- NETWORK
- TITLE =
- A #temp7;
- L #TempS5;
- SD #Off_Timer_2;
- NETWORK
- TITLE =
- A #Synchronize;
- FP #temp13;
- JC next;
- NETWORK
- TITLE =
- A #Central_Local;
- A #Emergency_Stop;
- A #Sequential_Start;
- A( ;
- A( ;
- X #ON_Timer_1;
- X #Off_Timer_1;
- ) ;
- NOT ;
- ) ;
- AN #ON_Timer_2;
- O #Temp1;
- = #Motor_ON;
- NETWORK
- TITLE =
- next: A #temp13;
- = #temp13;
- END_FUNCTION_BLOCK
- DATA_BLOCK DB 51
- TITLE =
- VERSION : 0.0
- FB 3
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Sequential_Start := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Synchronize := FALSE;
- Delay_Time := T 0;
- ON_Timer_1 := T 0;
- ON_Time_1 := 0;
- Off_Timer_1 := T 0;
- Off_Time_1 := 0;
- ON_Timer_2 := T 0;
- ON_Time_2 := 0;
- Off_Timer_2 := T 0;
- Off_Time_2 := 0;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := W#16#0;
- temp10 := W#16#0;
- temp11 := W#16#0;
- temp12 := W#16#0;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 52
- TITLE =
- VERSION : 0.0
- FB 3
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Sequential_Start := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Synchronize := FALSE;
- Delay_Time := T 0;
- ON_Timer_1 := T 0;
- ON_Time_1 := 0;
- Off_Timer_1 := T 0;
- Off_Time_1 := 0;
- ON_Timer_2 := T 0;
- ON_Time_2 := 0;
- Off_Timer_2 := T 0;
- Off_Time_2 := 0;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := W#16#0;
- temp10 := W#16#0;
- temp11 := W#16#0;
- temp12 := W#16#0;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 53
- TITLE =
- VERSION : 0.0
- FB 3
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Sequential_Start := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Synchronize := FALSE;
- Delay_Time := T 0;
- ON_Timer_1 := T 0;
- ON_Time_1 := 0;
- Off_Timer_1 := T 0;
- Off_Time_1 := 0;
- ON_Timer_2 := T 0;
- ON_Time_2 := 0;
- Off_Timer_2 := T 0;
- Off_Time_2 := 0;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := W#16#0;
- temp10 := W#16#0;
- temp11 := W#16#0;
- temp12 := W#16#0;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 61
- TITLE =
- VERSION : 0.0
- FB 3
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Sequential_Start := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Synchronize := FALSE;
- Delay_Time := T 0;
- ON_Timer_1 := T 0;
- ON_Time_1 := 0;
- Off_Timer_1 := T 0;
- Off_Time_1 := 0;
- ON_Timer_2 := T 0;
- ON_Time_2 := 0;
- Off_Timer_2 := T 0;
- Off_Time_2 := 0;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := W#16#0;
- temp10 := W#16#0;
- temp11 := W#16#0;
- temp12 := W#16#0;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 62
- TITLE =
- VERSION : 0.0
- FB 3
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Sequential_Start := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Synchronize := FALSE;
- Delay_Time := T 0;
- ON_Timer_1 := T 0;
- ON_Time_1 := 0;
- Off_Timer_1 := T 0;
- Off_Time_1 := 0;
- ON_Timer_2 := T 0;
- ON_Time_2 := 0;
- Off_Timer_2 := T 0;
- Off_Time_2 := 0;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := W#16#0;
- temp10 := W#16#0;
- temp11 := W#16#0;
- temp12 := W#16#0;
- temp13 := FALSE;
- END_DATA_BLOCK
- DATA_BLOCK DB 63
- TITLE =
- VERSION : 0.0
- FB 3
- BEGIN
- Central_Local := FALSE;
- LB_Start := FALSE;
- LB_Stop := FALSE;
- Emergency_Stop := FALSE;
- Single_Start := FALSE;
- Sequential_Start := FALSE;
- Contactor := FALSE;
- Circuit_Breaker := FALSE;
- Clock := FALSE;
- reset := FALSE;
- Synchronize := FALSE;
- Delay_Time := T 0;
- ON_Timer_1 := T 0;
- ON_Time_1 := 0;
- Off_Timer_1 := T 0;
- Off_Time_1 := 0;
- ON_Timer_2 := T 0;
- ON_Time_2 := 0;
- Off_Timer_2 := T 0;
- Off_Time_2 := 0;
- Contactor_Fault := FALSE;
- CB_Fault := FALSE;
- Warning := FALSE;
- Common_Alarm := FALSE;
- Motor_ON := FALSE;
- Temp1 := FALSE;
- temp2 := FALSE;
- temp3 := FALSE;
- temp4 := FALSE;
- temp5 := FALSE;
- temp6 := FALSE;
- temp7 := FALSE;
- temp8 := FALSE;
- temp9 := W#16#0;
- temp10 := W#16#0;
- temp11 := W#16#0;
- temp12 := W#16#0;
- temp13 := FALSE;
- END_DATA_BLOCK
- FUNCTION FC 6 : VOID
- TITLE =
- VERSION : 0.1
- VAR_INPUT
- Input_Bit0 : BOOL ;
- Input_Bit1 : BOOL ;
- Input_Bit2 : BOOL ;
- Input_Bit3 : BOOL ;
- END_VAR
- VAR_OUTPUT
- Output_Bit0 : BOOL ;
- Output_Bit1 : BOOL ;
- Output_Bit2 : BOOL ;
- Output_Bit3 : BOOL ;
- END_VAR
- BEGIN
- NETWORK
- TITLE =
- A #Input_Bit0;
- = #Output_Bit0;
- NETWORK
- TITLE =
- A #Input_Bit1;
- = #Output_Bit1;
- NETWORK
- TITLE =
- A #Input_Bit2;
- = #Output_Bit2;
- NETWORK
- TITLE =
- A #Input_Bit3;
- = #Output_Bit3;
- END_FUNCTION
- FUNCTION FC 20 : VOID
- TITLE =
- VERSION : 0.1
- VAR_INPUT
- MAX : INT ;
- MIN : INT ;
- END_VAR
- VAR_IN_OUT
- INPUT_VALUE : INT ;
- END_VAR
- BEGIN
- NETWORK
- TITLE =
- L #INPUT_VALUE;
- L #MAX;
- >=I ;
- = L 0.0;
- A L 0.0;
- JNB _001;
- L #MAX;
- T #INPUT_VALUE;
- _001: NOP 0;
- AN L 0.0;
- A( ;
- L #INPUT_VALUE;
- L #MIN;
- <=I ;
- ) ;
- JNB _002;
- L #MIN;
- T #INPUT_VALUE;
- _002: NOP 0;
- END_FUNCTION
- FUNCTION FC 1 : VOID
- TITLE =
- VERSION : 0.1
- BEGIN
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 8.3;
- = L 0.1;
- BLD 103;
- A I 8.4;
- = L 0.2;
- BLD 103;
- A I 8.2;
- = L 0.3;
- BLD 103;
- A I 41.6;
- = L 0.4;
- BLD 103;
- A M 21.0;
- = L 0.5;
- BLD 103;
- A Q 21.5;
- = L 0.6;
- BLD 103;
- A I 40.4;
- = L 0.7;
- BLD 103;
- A I 8.5;
- = L 1.0;
- BLD 103;
- A I 8.6;
- = L 1.1;
- BLD 103;
- A I 8.7;
- = L 1.2;
- BLD 103;
- A M 2.6;
- = L 1.3;
- BLD 103;
- A M 13.0;
- = L 1.4;
- BLD 103;
- CALL FB 1 , DB 71 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Group_Start := L 0.5,
- Group_Stop := L 0.6,
- Interlock := L 0.7,
- Speed_Switch := L 1.0,
- Contactor := L 1.1,
- Circuit_Breaker := L 1.2,
- Clock := L 1.3,
- reset := L 1.4,
- Delay_Time := T 39,
- Group_ON_Timer := T 40,
- ON_Delay := S5T#5S,
- Group_Off_Timer := T 41,
- Off_Delay := S5T#7S,
- Speed_Switch_Fault := DB2.DBX 0.1,
- Contactor_Fault := DB2.DBX 0.2,
- CB_Fault := DB2.DBX 0.3,
- Motor_ON := Q 21.3);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 9.1;
- = L 0.1;
- BLD 103;
- A I 9.2;
- = L 0.2;
- BLD 103;
- A I 9.0;
- = L 0.3;
- BLD 103;
- A I 41.7;
- = L 0.4;
- BLD 103;
- A M 21.0;
- = L 0.5;
- BLD 103;
- A Q 21.6;
- = L 0.6;
- BLD 103;
- A I 40.4;
- = L 0.7;
- BLD 103;
- A I 9.3;
- = L 1.0;
- BLD 103;
- A I 9.4;
- = L 1.1;
- BLD 103;
- A I 9.5;
- = L 1.2;
- BLD 103;
- A M 2.6;
- = L 1.3;
- BLD 103;
- A M 13.0;
- = L 1.4;
- BLD 103;
- CALL FB 1 , DB 72 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Group_Start := L 0.5,
- Group_Stop := L 0.6,
- Interlock := L 0.7,
- Speed_Switch := L 1.0,
- Contactor := L 1.1,
- Circuit_Breaker := L 1.2,
- Clock := L 1.3,
- reset := L 1.4,
- Delay_Time := T 42,
- Group_ON_Timer := T 43,
- ON_Delay := S5T#2S,
- Group_Off_Timer := T 44,
- Off_Delay := S5T#10S,
- Speed_Switch_Fault := DB2.DBX 0.5,
- Contactor_Fault := DB2.DBX 0.6,
- CB_Fault := DB2.DBX 0.7,
- Motor_ON := Q 21.4);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 9.7;
- = L 0.1;
- BLD 103;
- A I 12.0;
- = L 0.2;
- BLD 103;
- A I 9.6;
- = L 0.3;
- BLD 103;
- A I 42.0;
- = L 0.4;
- BLD 103;
- A M 21.0;
- = L 0.5;
- BLD 103;
- A M 21.0;
- = L 0.6;
- BLD 103;
- A Q 21.3;
- = L 0.7;
- BLD 103;
- A I 12.1;
- = L 1.0;
- BLD 103;
- A I 12.2;
- = L 1.1;
- BLD 103;
- A I 12.3;
- = L 1.2;
- BLD 103;
- A M 2.6;
- = L 1.3;
- BLD 103;
- A M 13.0;
- = L 1.4;
- BLD 103;
- CALL FB 1 , DB 81 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Group_Start := L 0.5,
- Group_Stop := L 0.6,
- Interlock := L 0.7,
- Speed_Switch := L 1.0,
- Contactor := L 1.1,
- Circuit_Breaker := L 1.2,
- Clock := L 1.3,
- reset := L 1.4,
- Delay_Time := T 45,
- Group_ON_Timer := T 46,
- ON_Delay := S5T#4S,
- Group_Off_Timer := T 47,
- Off_Delay := S5T#10S,
- Speed_Switch_Fault := DB2.DBX 1.1,
- Contactor_Fault := DB2.DBX 1.2,
- CB_Fault := DB2.DBX 1.3,
- Motor_ON := Q 21.5);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 12.5;
- = L 0.1;
- BLD 103;
- A I 12.6;
- = L 0.2;
- BLD 103;
- A I 12.4;
- = L 0.3;
- BLD 103;
- A I 42.1;
- = L 0.4;
- BLD 103;
- A M 21.0;
- = L 0.5;
- BLD 103;
- A M 21.0;
- = L 0.6;
- BLD 103;
- A Q 21.4;
- = L 0.7;
- BLD 103;
- A I 12.7;
- = L 1.0;
- BLD 103;
- A I 13.0;
- = L 1.1;
- BLD 103;
- A I 13.1;
- = L 1.2;
- BLD 103;
- A M 2.6;
- = L 1.3;
- BLD 103;
- A M 13.0;
- = L 1.4;
- BLD 103;
- CALL FB 1 , DB 82 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Group_Start := L 0.5,
- Group_Stop := L 0.6,
- Interlock := L 0.7,
- Speed_Switch := L 1.0,
- Contactor := L 1.1,
- Circuit_Breaker := L 1.2,
- Clock := L 1.3,
- reset := L 1.4,
- Delay_Time := T 48,
- Group_ON_Timer := T 49,
- ON_Delay := S5T#5S,
- Group_Off_Timer := T 50,
- Off_Delay := S5T#4S,
- Speed_Switch_Fault := DB2.DBX 1.5,
- Contactor_Fault := DB2.DBX 1.6,
- CB_Fault := DB2.DBX 1.7,
- Motor_ON := Q 21.6);
- NOP 0;
- END_FUNCTION
- FUNCTION_BLOCK FB 2
- TITLE =Scale Data
- VERSION : 0.1
- VAR_INPUT
- PIW_INPUT : INT ;
- FULL_SCALE_INSTRUMENT : DINT ;
- FULL_SCALE_REAL : DINT ;
- Defult_Setting : BOOL ;
- END_VAR
- VAR_OUTPUT
- OUTPUT_MESSUR : DINT ;
- PERCENT : DINT ;
- END_VAR
- VAR_IN_OUT
- Gain : DINT ;
- Offset : DINT ;
- END_VAR
- VAR_TEMP
- TEMP1 : DINT ;
- TEMP2 : DINT ;
- TEMP3 : DINT ;
- TEMP4 : DINT ;
- TEMP5 : DINT ;
- END_VAR
- BEGIN
- NETWORK
- TITLE =
- NETWORK
- TITLE =
- L #PIW_INPUT;
- ITD ;
- T #TEMP1;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- = L 20.0;
- A( ;
- A( ;
- A( ;
- A L 20.0;
- JNB _001;
- L #TEMP1;
- L #Offset;
- -D ;
- T #TEMP5;
- AN OV;
- SAVE ;
- CLR ;
- _001: A BR;
- ) ;
- JNB _002;
- L #TEMP5;
- L #FULL_SCALE_INSTRUMENT;
- *D ;
- T #TEMP2;
- AN OV;
- SAVE ;
- CLR ;
- _002: A BR;
- ) ;
- JNB _003;
- L #TEMP2;
- L #Gain;
- /D ;
- T #TEMP3;
- AN OV;
- SAVE ;
- CLR ;
- _003: A BR;
- ) ;
- JNB _004;
- L #TEMP3;
- L L#1;
- *D ;
- T #OUTPUT_MESSUR;
- _004: NOP 0;
- A( ;
- A L 20.0;
- JNB _005;
- L #TEMP3;
- L L#100;
- *D ;
- T #TEMP4;
- AN OV;
- SAVE ;
- CLR ;
- _005: A BR;
- ) ;
- JNB _006;
- L #TEMP4;
- L #FULL_SCALE_REAL;
- /D ;
- T #PERCENT;
- _006: NOP 0;
- A L 20.0;
- A( ;
- L #Gain;
- L L#35000;
- >D ;
- ) ;
- JNB _007;
- L L#35000;
- T #Gain;
- _007: NOP 0;
- A L 20.0;
- A( ;
- L #Gain;
- L L#6000;
- <D ;
- ) ;
- JNB _008;
- L L#6000;
- T #Gain;
- _008: NOP 0;
- A L 20.0;
- A( ;
- L #Offset;
- L L#7000;
- >D ;
- ) ;
- JNB _009;
- L L#7000;
- T #Offset;
- _009: NOP 0;
- A L 20.0;
- A( ;
- L #Offset;
- L L#-7000;
- <D ;
- ) ;
- JNB _00a;
- L L#-7000;
- T #Offset;
- _00a: NOP 0;
- NETWORK
- TITLE =
- A( ;
- A #Defult_Setting;
- JNB _00b;
- L L#0;
- T #Offset;
- SET ;
- SAVE ;
- CLR ;
- _00b: A BR;
- ) ;
- JNB _00c;
- L L#27648;
- T #Gain;
- _00c: NOP 0;
- END_FUNCTION_BLOCK
- FUNCTION FC 2 : VOID
- TITLE =
- VERSION : 0.1
- BEGIN
- NETWORK
- TITLE =
- A M 2.5;
- FP M 10.7;
- JNB _001;
- L MW 4;
- L 1;
- +I ;
- T MW 4;
- _001: NOP 0;
- NETWORK
- TITLE =
- A M 5.2;
- = L 0.0;
- BLD 103;
- A I 40.2;
- = L 0.1;
- BLD 103;
- A M 13.1;
- = L 0.2;
- BLD 103;
- A I 40.3;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 0.0,
- Output_Bit1 := DB1.DBX 0.1,
- Output_Bit2 := DB1.DBX 0.2,
- Output_Bit3 := DB1.DBX 0.3);
- NOP 0;
- NETWORK
- TITLE =
- A M 13.3;
- = L 0.0;
- BLD 103;
- A M 13.4;
- = L 0.1;
- BLD 103;
- A M 10.3;
- = L 0.2;
- BLD 103;
- A M 10.3;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 0.4,
- Output_Bit1 := DB1.DBX 0.5,
- Output_Bit2 := DB1.DBX 0.6,
- Output_Bit3 := DB1.DBX 0.7);
- NOP 0;
- NETWORK
- TITLE =
- A I 0.2;
- = L 0.0;
- BLD 103;
- A M 10.3;
- = L 0.1;
- BLD 103;
- A I 0.5;
- = L 0.2;
- BLD 103;
- AN I 0.6;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 1.0,
- Output_Bit1 := DB1.DBX 1.1,
- Output_Bit2 := DB1.DBX 1.2,
- Output_Bit3 := DB1.DBX 1.3);
- NOP 0;
- NETWORK
- TITLE =
- A I 0.7;
- = L 0.0;
- BLD 103;
- A M 10.3;
- = L 0.1;
- BLD 103;
- A I 1.2;
- = L 0.2;
- BLD 103;
- AN I 1.3;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 1.4,
- Output_Bit1 := DB1.DBX 1.5,
- Output_Bit2 := DB1.DBX 1.6,
- Output_Bit3 := DB1.DBX 1.7);
- NOP 0;
- NETWORK
- TITLE =
- A I 1.4;
- = L 0.0;
- BLD 103;
- A M 10.3;
- = L 0.1;
- BLD 103;
- A I 1.7;
- = L 0.2;
- BLD 103;
- AN I 4.0;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 2.0,
- Output_Bit1 := DB1.DBX 2.1,
- Output_Bit2 := DB1.DBX 2.2,
- Output_Bit3 := DB1.DBX 2.3);
- NOP 0;
- NETWORK
- TITLE =
- A I 4.1;
- = L 0.0;
- BLD 103;
- A M 10.3;
- = L 0.1;
- BLD 103;
- A I 4.4;
- = L 0.2;
- BLD 103;
- AN I 4.5;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 2.4,
- Output_Bit1 := DB1.DBX 2.5,
- Output_Bit2 := DB1.DBX 2.6,
- Output_Bit3 := DB1.DBX 2.7);
- NOP 0;
- NETWORK
- TITLE =
- A I 4.6;
- = L 0.0;
- BLD 103;
- A M 10.3;
- = L 0.1;
- BLD 103;
- A I 5.1;
- = L 0.2;
- BLD 103;
- AN I 5.2;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 3.0,
- Output_Bit1 := DB1.DBX 3.1,
- Output_Bit2 := DB1.DBX 3.2,
- Output_Bit3 := DB1.DBX 3.3);
- NOP 0;
- NETWORK
- TITLE =
- A I 5.3;
- = L 0.0;
- BLD 103;
- A M 10.3;
- = L 0.1;
- BLD 103;
- A I 5.6;
- = L 0.2;
- BLD 103;
- AN I 5.7;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 3.4,
- Output_Bit1 := DB1.DBX 3.5,
- Output_Bit2 := DB1.DBX 3.6,
- Output_Bit3 := DB1.DBX 3.7);
- NOP 0;
- NETWORK
- TITLE =
- A I 8.2;
- = L 0.0;
- BLD 103;
- A I 8.5;
- = L 0.1;
- BLD 103;
- A I 8.6;
- = L 0.2;
- BLD 103;
- AN I 8.7;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 4.0,
- Output_Bit1 := DB1.DBX 4.1,
- Output_Bit2 := DB1.DBX 4.2,
- Output_Bit3 := DB1.DBX 4.3);
- NOP 0;
- NETWORK
- TITLE =
- A I 9.0;
- = L 0.0;
- BLD 103;
- A I 9.3;
- = L 0.1;
- BLD 103;
- A I 9.4;
- = L 0.2;
- BLD 103;
- AN I 9.5;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 4.4,
- Output_Bit1 := DB1.DBX 4.5,
- Output_Bit2 := DB1.DBX 4.6,
- Output_Bit3 := DB1.DBX 4.7);
- NOP 0;
- NETWORK
- TITLE =
- A I 9.6;
- = L 0.0;
- BLD 103;
- A I 12.1;
- = L 0.1;
- BLD 103;
- A I 12.2;
- = L 0.2;
- BLD 103;
- AN I 12.3;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 5.0,
- Output_Bit1 := DB1.DBX 5.1,
- Output_Bit2 := DB1.DBX 5.2,
- Output_Bit3 := DB1.DBX 5.3);
- NOP 0;
- NETWORK
- TITLE =
- A I 12.4;
- = L 0.0;
- BLD 103;
- A I 12.7;
- = L 0.1;
- BLD 103;
- A I 13.0;
- = L 0.2;
- BLD 103;
- AN I 13.1;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 5.4,
- Output_Bit1 := DB1.DBX 5.5,
- Output_Bit2 := DB1.DBX 5.6,
- Output_Bit3 := DB1.DBX 5.7);
- NOP 0;
- NETWORK
- TITLE =
- A I 0.0;
- = L 0.0;
- BLD 103;
- A I 0.1;
- = L 0.1;
- BLD 103;
- A M 10.2;
- = L 0.2;
- BLD 103;
- A M 10.2;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB1.DBX 6.0,
- Output_Bit1 := DB1.DBX 6.1,
- Output_Bit2 := DB1.DBX 6.2,
- Output_Bit3 := DB1.DBX 6.3);
- NOP 0;
- NETWORK
- TITLE =
- A( ;
- A( ;
- A( ;
- L DB1.DBB 0;
- T QB 40;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _002;
- L DB1.DBB 1;
- T QB 41;
- SET ;
- SAVE ;
- CLR ;
- _002: A BR;
- ) ;
- JNB _003;
- L DB1.DBB 2;
- T QB 42;
- SET ;
- SAVE ;
- CLR ;
- _003: A BR;
- ) ;
- JNB _004;
- L DB1.DBB 3;
- T QB 43;
- _004: NOP 0;
- NETWORK
- TITLE =
- A( ;
- A( ;
- A( ;
- L DB1.DBB 4;
- T QB 44;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _005;
- L DB1.DBB 5;
- T QB 45;
- SET ;
- SAVE ;
- CLR ;
- _005: A BR;
- ) ;
- JNB _006;
- L DB1.DBB 6;
- T QB 46;
- SET ;
- SAVE ;
- CLR ;
- _006: A BR;
- ) ;
- JNB _007;
- L DB1.DBB 7;
- T QB 47;
- _007: NOP 0;
- NETWORK
- TITLE =
- A( ;
- A( ;
- A( ;
- L DB1.DBB 8;
- T QB 48;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _008;
- L DB1.DBB 9;
- T QB 49;
- SET ;
- SAVE ;
- CLR ;
- _008: A BR;
- ) ;
- JNB _009;
- L DB1.DBB 10;
- T QB 50;
- SET ;
- SAVE ;
- CLR ;
- _009: A BR;
- ) ;
- JNB _00a;
- L DB1.DBB 11;
- T QB 51;
- _00a: NOP 0;
- NETWORK
- TITLE =
- A( ;
- A( ;
- A( ;
- L DB1.DBB 12;
- T QB 52;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _00b;
- L DB1.DBB 13;
- T QB 53;
- SET ;
- SAVE ;
- CLR ;
- _00b: A BR;
- ) ;
- JNB _00c;
- L DB1.DBB 14;
- T QB 54;
- SET ;
- SAVE ;
- CLR ;
- _00c: A BR;
- ) ;
- JNB _00d;
- L DB1.DBB 15;
- T QB 55;
- _00d: NOP 0;
- NETWORK
- TITLE =
- A( ;
- A( ;
- A( ;
- L DB1.DBB 16;
- T QB 56;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _00e;
- L DB1.DBB 17;
- T QB 57;
- SET ;
- SAVE ;
- CLR ;
- _00e: A BR;
- ) ;
- JNB _00f;
- L DB1.DBB 18;
- T QB 58;
- SET ;
- SAVE ;
- CLR ;
- _00f: A BR;
- ) ;
- JNB _010;
- L DB1.DBB 19;
- T QB 59;
- _010: NOP 0;
- NETWORK
- TITLE =
- A( ;
- L DB1.DBB 20;
- T QB 60;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _011;
- L DB1.DBB 21;
- T QB 61;
- _011: NOP 0;
- END_FUNCTION
- FUNCTION FC 3 : VOID
- TITLE =
- VERSION : 0.1
- BEGIN
- NETWORK
- TITLE =Handshake Fault
- A I 40.0;
- L S5T#10S;
- SS T 2;
- NOP 0;
- NOP 0;
- NOP 0;
- A T 2;
- = L 0.0;
- AN L 0.0;
- = M 13.4;
- A L 0.0;
- BLD 102;
- = DB2.DBX 4.6;
- NETWORK
- TITLE =Motors Faults
- A( ;
- O DB51.DBX 20.3;
- O DB52.DBX 20.3;
- O DB53.DBX 20.3;
- O DB61.DBX 20.3;
- O DB62.DBX 20.3;
- O DB63.DBX 20.3;
- O DB71.DBX 12.5;
- O DB72.DBX 12.5;
- O DB81.DBX 12.5;
- O DB82.DBX 12.5;
- ) ;
- NOT ;
- = M 13.1;
- NETWORK
- TITLE =
- AN I 0.2;
- = L 0.0;
- BLD 103;
- AN I 0.7;
- = L 0.1;
- BLD 103;
- AN I 1.4;
- = L 0.2;
- BLD 103;
- AN I 4.1;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB2.DBX 2.0,
- Output_Bit1 := DB2.DBX 2.3,
- Output_Bit2 := DB2.DBX 2.6,
- Output_Bit3 := DB2.DBX 3.1);
- NOP 0;
- NETWORK
- TITLE =
- AN I 4.6;
- = L 0.0;
- BLD 103;
- AN I 5.3;
- = L 0.1;
- BLD 103;
- AN I 8.2;
- = L 0.2;
- BLD 103;
- AN I 9.0;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB2.DBX 3.4,
- Output_Bit1 := DB2.DBX 3.7,
- Output_Bit2 := DB2.DBX 0.0,
- Output_Bit3 := DB2.DBX 0.4);
- NOP 0;
- NETWORK
- TITLE =
- AN I 9.6;
- = L 0.0;
- BLD 103;
- AN I 12.4;
- = L 0.1;
- BLD 103;
- AN I 0.0;
- = L 0.2;
- BLD 103;
- AN I 0.1;
- = L 0.3;
- BLD 103;
- CALL FC 6 (
- Input_Bit0 := L 0.0,
- Input_Bit1 := L 0.1,
- Input_Bit2 := L 0.2,
- Input_Bit3 := L 0.3,
- Output_Bit0 := DB2.DBX 1.0,
- Output_Bit1 := DB2.DBX 1.4,
- Output_Bit2 := DB2.DBX 4.2,
- Output_Bit3 := DB2.DBX 4.5);
- NOP 0;
- END_FUNCTION
- FUNCTION_BLOCK FB 4
- TITLE =Calculat Timeing Priode
- VERSION : 0.1
- VAR_INPUT
- C1ON : INT ; //Collecting 1 ON Time
- C1Off : INT ; //Collecting 1 Off Time
- D1ON : INT ; //Discharge 1 ON Time
- C2ON : INT ; //Collecting 2 ON Time
- D2ON : INT ; //Discharge 2 ON Time
- C3ON : INT ; //Collecting 3 ON Time
- D3ON : INT ; //Discharge 3 ON Time
- END_VAR
- VAR_OUTPUT
- C1ON_1 : INT ; //Collecting 1 ON Time
- C1Off_1 : INT ; //Collecting 1 Off Time
- D1ON_1 : INT ; //Discharge 1 ON Time
- D1Off_1 : INT ; //Discharge 1 Off Time 1
- D1Off_2 : INT ; //Discharge 1 Off Time 2
- C2ON_1 : INT ; //Collecting 2 ON Time
- C2Off_1 : INT ; //Collecting 2 Off Time 1
- C2Off_2 : INT ; //Collecting 2 Off Time 2
- D2ON_1 : INT ; //Discharge 2 ON Time 1
- D2ON_2 : INT ; //Discharge 2 ON Time 2
- D2Off_1 : INT ; //Discharge 2 Off Time
- C3ON_1 : INT ; //Collecting 3 ON Time
- C3Off_1 : INT ; //Collecting 3 Off Time 1
- C3Off_2 : INT ; //Collecting 3 Off Time 2
- D3ON_1 : INT ; //Discharge 3 ON Time 1
- D3ON_2 : INT ; //Discharge 3 ON Time 2
- D3Off_1 : INT ; //Discharge 3 Off Time
- END_VAR
- VAR_TEMP
- temp1 : INT ;
- temp2 : INT ;
- temp3 : INT ;
- temp4 : INT ;
- END_VAR
- BEGIN
- NETWORK
- TITLE =
- A( ;
- A( ;
- L #C1ON;
- T #C1ON_1;
- SET ;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _001;
- L #C2ON;
- T #C2ON_1;
- SET ;
- SAVE ;
- CLR ;
- _001: A BR;
- ) ;
- JNB _002;
- L #C3ON;
- T #C3ON_1;
- _002: NOP 0;
- NETWORK
- TITLE =
- A( ;
- L #C1Off;
- L 1;
- /I ;
- T #C1Off_1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _003;
- L #D1ON;
- T #D1ON_1;
- _003: NOP 0;
- NETWORK
- TITLE =Field 1 Discharg Off Time 1&2
- A( ;
- L #C1Off;
- L #D1ON;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _004;
- L #temp1;
- L 2;
- /I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _004: A BR;
- = L 8.0;
- A( ;
- A L 8.0;
- JNB _005;
- L #temp1;
- L #C1ON;
- +I ;
- T #temp2;
- AN OV;
- SAVE ;
- CLR ;
- _005: A BR;
- ) ;
- JNB _006;
- L #temp2;
- L 1;
- /I ;
- T #D1Off_1;
- _006: NOP 0;
- A L 8.0;
- JNB _007;
- L #temp1;
- L 1;
- /I ;
- T #D1Off_2;
- _007: NOP 0;
- NETWORK
- TITLE =Field 2 Collecting Off Time 1
- A( ;
- L #C1Off;
- L #C2ON;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _008;
- L #temp1;
- L 2;
- /I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _008: A BR;
- = L 8.0;
- A L 8.0;
- JNB _009;
- L #temp1;
- L #C1ON;
- +I ;
- T #C2Off_1;
- _009: NOP 0;
- A L 8.0;
- JNB _00a;
- L #temp1;
- L #C1ON;
- +I ;
- T #temp2;
- _00a: NOP 0;
- NETWORK
- TITLE =Field 2 Collecting Off Time 2
- A( ;
- A( ;
- A( ;
- A( ;
- L #C1ON;
- L #C1Off;
- +I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _00b;
- L #temp1;
- L 2;
- *I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _00b: A BR;
- ) ;
- JNB _00c;
- L #temp1;
- L #C2ON;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _00c: A BR;
- ) ;
- JNB _00d;
- L #temp1;
- L #temp2;
- -I ;
- T #temp2;
- AN OV;
- SAVE ;
- CLR ;
- _00d: A BR;
- ) ;
- JNB _00e;
- L #temp2;
- L 1;
- /I ;
- T #C2Off_2;
- _00e: NOP 0;
- NETWORK
- TITLE =Field 2 Discharge Off Time
- A( ;
- A( ;
- A( ;
- L #C1ON;
- L #C1Off;
- +I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _00f;
- L #temp1;
- L 2;
- *I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _00f: A BR;
- ) ;
- JNB _010;
- L #temp1;
- T #temp2;
- SET ;
- SAVE ;
- CLR ;
- _010: A BR;
- ) ;
- JNB _011;
- L #temp1;
- L #D2ON;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _011: A BR;
- = L 8.0;
- A L 8.0;
- JNB _012;
- L #temp1;
- L 1;
- /I ;
- T #D2Off_1;
- _012: NOP 0;
- A L 8.0;
- JNB _013;
- L #temp1;
- T #temp3;
- _013: NOP 0;
- NETWORK
- TITLE =Field 2 Discharge ON Time 1
- A( ;
- A( ;
- A( ;
- L #C1Off;
- L #temp1;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _014;
- L #temp1;
- L 2;
- /I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _014: A BR;
- ) ;
- JNB _015;
- L #temp1;
- L #C1ON;
- +I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _015: A BR;
- ) ;
- JNB _016;
- L #temp1;
- L 1;
- /I ;
- T #D2ON_1;
- _016: NOP 0;
- NETWORK
- TITLE =Field 2 Discharge ON Time 2
- A( ;
- A( ;
- L #temp2;
- L #temp1;
- -I ;
- T #temp2;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _017;
- L #temp2;
- L #temp3;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _017: A BR;
- ) ;
- JNB _018;
- L #temp1;
- L 1;
- /I ;
- T #D2ON_2;
- _018: NOP 0;
- NETWORK
- TITLE =Field 3 Collecting Off Time 2
- A( ;
- L #C1Off;
- L #C3ON;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _019;
- L #temp1;
- L 2;
- /I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _019: A BR;
- = L 8.0;
- A( ;
- A L 8.0;
- JNB _01a;
- L #temp1;
- L #C1ON;
- +I ;
- T #temp3;
- AN OV;
- SAVE ;
- CLR ;
- _01a: A BR;
- ) ;
- JNB _01b;
- L #temp3;
- L 1;
- /I ;
- T #C3Off_2;
- _01b: NOP 0;
- A L 8.0;
- JNB _01c;
- L #temp1;
- L #C1ON;
- +I ;
- T #temp2;
- _01c: NOP 0;
- NETWORK
- TITLE =Field 3 Collecting Off Time 1
- A( ;
- A( ;
- L #C1Off;
- L #C1ON;
- +I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _01d;
- L #temp1;
- L #temp2;
- +I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _01d: A BR;
- ) ;
- JNB _01e;
- L #temp1;
- L 1;
- /I ;
- T #C3Off_1;
- _01e: NOP 0;
- NETWORK
- TITLE =Field 3 Discharge Off Time
- A( ;
- A( ;
- A( ;
- L #C1ON;
- L #C1Off;
- +I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _01f;
- L #temp1;
- L 2;
- *I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _01f: A BR;
- ) ;
- JNB _020;
- L #temp1;
- T #temp2;
- SET ;
- SAVE ;
- CLR ;
- _020: A BR;
- ) ;
- JNB _021;
- L #temp1;
- L #D3ON;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _021: A BR;
- = L 8.0;
- A L 8.0;
- JNB _022;
- L #temp1;
- T #temp3;
- _022: NOP 0;
- A L 8.0;
- JNB _023;
- L #temp1;
- L 1;
- /I ;
- T #D3Off_1;
- _023: NOP 0;
- NETWORK
- TITLE =Field 3 Discharge ON Time 2
- A( ;
- A( ;
- L #C1Off;
- L #temp3;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _024;
- L #temp1;
- L 2;
- /I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _024: A BR;
- ) ;
- JNB _025;
- L #temp1;
- L 1;
- /I ;
- T #D3ON_2;
- _025: NOP 0;
- NETWORK
- TITLE =Field 3 Discharge ON Time 1
- A( ;
- A( ;
- L #temp2;
- L #temp1;
- -I ;
- T #temp2;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _026;
- L #temp2;
- L #temp3;
- -I ;
- T #temp1;
- AN OV;
- SAVE ;
- CLR ;
- _026: A BR;
- ) ;
- JNB _027;
- L #temp1;
- L 1;
- /I ;
- T #D3ON_1;
- _027: NOP 0;
- END_FUNCTION_BLOCK
- DATA_BLOCK DB 50
- TITLE =
- VERSION : 0.0
- FB 4
- BEGIN
- C1ON := 0;
- C1Off := 0;
- D1ON := 0;
- C2ON := 0;
- D2ON := 0;
- C3ON := 0;
- D3ON := 0;
- C1ON_1 := 0;
- C1Off_1 := 0;
- D1ON_1 := 0;
- D1Off_1 := 0;
- D1Off_2 := 0;
- C2ON_1 := 0;
- C2Off_1 := 0;
- C2Off_2 := 0;
- D2ON_1 := 0;
- D2ON_2 := 0;
- D2Off_1 := 0;
- C3ON_1 := 0;
- C3Off_1 := 0;
- C3Off_2 := 0;
- D3ON_1 := 0;
- D3ON_2 := 0;
- D3Off_1 := 0;
- END_DATA_BLOCK
- FUNCTION FC 4 : VOID
- TITLE =
- VERSION : 0.1
- BEGIN
- NETWORK
- TITLE =
- A M 2.5;
- AN M 2.5;
- = M 10.3;
- A M 10.3;
- NOT ;
- = M 10.2;
- NETWORK
- TITLE =
- O I 40.1;
- O M 10.1;
- = M 13.0;
- NETWORK
- TITLE =
- A( ;
- A M 13.2;
- FP M 16.0;
- JNB _001;
- L MB 20;
- T MB 15;
- SET ;
- SAVE ;
- CLR ;
- _001: A BR;
- ) ;
- JNB _002;
- L 0;
- T MB 20;
- _002: NOP 0;
- NETWORK
- TITLE =
- A M 13.2;
- FN M 16.1;
- JNB _003;
- L MB 15;
- T MB 20;
- _003: NOP 0;
- NETWORK
- TITLE =
- O I 41.2;
- O I 41.1;
- = M 21.0;
- NETWORK
- TITLE =
- A I 41.2;
- A Q 21.5;
- A Q 21.5;
- = M 21.1;
- NETWORK
- TITLE =
- A I 41.2;
- A M 21.1;
- O ;
- A I 41.3;
- A I 40.3;
- = M 21.2;
- NETWORK
- TITLE =
- A M 21.2;
- A I 41.2;
- L S5T#5S;
- SD T 52;
- NETWORK
- TITLE =
- A T 52;
- A I 41.2;
- O ;
- A I 41.4;
- A I 40.3;
- = M 21.3;
- NETWORK
- TITLE =
- A M 21.3;
- A I 41.2;
- L S5T#5S;
- SD T 53;
- NETWORK
- TITLE =
- A T 53;
- A I 41.2;
- O ;
- A I 41.5;
- A I 40.3;
- = M 21.4;
- END_FUNCTION
- FUNCTION FC 5 : VOID
- TITLE =Chek Data to Load in Range
- VERSION : 0.1
- VAR_TEMP
- Discharge_ON_Time : INT ;
- Discharge_ON_2 : INT ;
- END_VAR
- BEGIN
- NETWORK
- TITLE =Field 1 Collecting Rapping ON Time
- CALL FC 20 (
- MAX := 120,
- MIN := 20,
- INPUT_VALUE := DB50.DBW 0);
- NOP 0;
- NETWORK
- TITLE =Field 1 Collecting Rapping Off Time
- CALL FC 20 (
- MAX := 2500,
- MIN := 1000,
- INPUT_VALUE := DB50.DBW 2);
- NOP 0;
- NETWORK
- TITLE =
- A( ;
- A( ;
- A( ;
- L DB50.DBW 0;
- L DB50.DBW 2;
- +I ;
- T #Discharge_ON_Time;
- AN OV;
- SAVE ;
- CLR ;
- A BR;
- ) ;
- JNB _001;
- L #Discharge_ON_Time;
- L DB50.DBW 0;
- +I ;
- T #Discharge_ON_2;
- AN OV;
- SAVE ;
- CLR ;
- _001: A BR;
- ) ;
- JNB _002;
- L #Discharge_ON_Time;
- L DB50.DBW 4;
- -I ;
- T MW 54;
- AN OV;
- SAVE ;
- CLR ;
- _002: A BR;
- ) ;
- JNB _003;
- L #Discharge_ON_Time;
- L 2;
- *I ;
- T #Discharge_ON_Time;
- _003: NOP 0;
- NETWORK
- TITLE =Field 1 Discharge Rapping ON Time
- CALL FC 20 (
- MAX := DB50.DBW 2,
- MIN := 1000,
- INPUT_VALUE := DB50.DBW 4);
- NOP 0;
- NETWORK
- TITLE =Field 2 Collecting Rapping ON Time
- CALL FC 20 (
- MAX := 120,
- MIN := 20,
- INPUT_VALUE := DB50.DBW 6);
- NOP 0;
- NETWORK
- TITLE =
- L #Discharge_ON_Time;
- L DB50.DBW 6;
- -I ;
- T MW 50;
- NOP 0;
- NETWORK
- TITLE =Field 2 Discharge Rapping ON Time
- CALL FC 20 (
- MAX := #Discharge_ON_Time,
- MIN := #Discharge_ON_2,
- INPUT_VALUE := DB50.DBW 8);
- NOP 0;
- NETWORK
- TITLE =
- L #Discharge_ON_Time;
- L DB50.DBW 8;
- -I ;
- T MW 56;
- NOP 0;
- NETWORK
- TITLE =Field 3 Collecting Rapping ON Time
- CALL FC 20 (
- MAX := 120,
- MIN := 20,
- INPUT_VALUE := DB50.DBW 10);
- NOP 0;
- NETWORK
- TITLE =
- L #Discharge_ON_Time;
- L DB50.DBW 10;
- -I ;
- T MW 52;
- NOP 0;
- NETWORK
- TITLE =Field 3 Discharge Rapping ON Time
- CALL FC 20 (
- MAX := #Discharge_ON_Time,
- MIN := #Discharge_ON_2,
- INPUT_VALUE := DB50.DBW 12);
- NOP 0;
- NETWORK
- TITLE =
- L #Discharge_ON_Time;
- L DB50.DBW 12;
- -I ;
- T MW 58;
- NOP 0;
- END_FUNCTION
- FUNCTION FC 7 : VOID
- TITLE =
- VERSION : 0.1
- BEGIN
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 0.3;
- = L 0.1;
- BLD 103;
- A I 0.4;
- = L 0.2;
- BLD 103;
- A I 0.2;
- = L 0.3;
- BLD 103;
- A I 42.2;
- = L 0.4;
- BLD 103;
- A M 21.1;
- = L 0.5;
- BLD 103;
- A I 0.5;
- = L 0.6;
- BLD 103;
- A I 0.6;
- = L 0.7;
- BLD 103;
- A M 2.5;
- = L 1.0;
- BLD 103;
- A M 13.0;
- = L 1.1;
- BLD 103;
- CALL FB 3 , DB 51 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Sequential_Start := L 0.5,
- Contactor := L 0.6,
- Circuit_Breaker := L 0.7,
- Clock := L 1.0,
- reset := L 1.1,
- Delay_Time := T 10,
- ON_Timer_1 := T 11,
- ON_Time_1 := DB50.DBW 14,
- Off_Timer_1 := T 12,
- Off_Time_1 := DB50.DBW 16,
- ON_Timer_2 := T 13,
- Off_Timer_2 := T 14,
- Contactor_Fault := DB2.DBX 2.1,
- CB_Fault := DB2.DBX 2.2,
- Motor_ON := Q 20.0);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 1.0;
- = L 0.1;
- BLD 103;
- A I 1.1;
- = L 0.2;
- BLD 103;
- A I 0.7;
- = L 0.3;
- BLD 103;
- A I 42.3;
- = L 0.4;
- BLD 103;
- A M 21.1;
- = L 0.5;
- BLD 103;
- A I 1.2;
- = L 0.6;
- BLD 103;
- A I 1.3;
- = L 0.7;
- BLD 103;
- A M 2.5;
- = L 1.0;
- BLD 103;
- A M 13.0;
- = L 1.1;
- BLD 103;
- CALL FB 3 , DB 52 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Sequential_Start := L 0.5,
- Contactor := L 0.6,
- Circuit_Breaker := L 0.7,
- Clock := L 1.0,
- reset := L 1.1,
- Delay_Time := T 15,
- ON_Timer_1 := T 16,
- Off_Timer_1 := T 17,
- Off_Time_1 := DB50.DBW 26,
- ON_Timer_2 := T 18,
- ON_Time_2 := DB50.DBW 24,
- Off_Timer_2 := T 19,
- Off_Time_2 := DB50.DBW 28,
- Contactor_Fault := DB2.DBX 2.4,
- CB_Fault := DB2.DBX 2.5,
- Motor_ON := Q 20.1);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 1.5;
- = L 0.1;
- BLD 103;
- A I 1.6;
- = L 0.2;
- BLD 103;
- A I 1.4;
- = L 0.3;
- BLD 103;
- A I 42.4;
- = L 0.4;
- BLD 103;
- A M 21.1;
- = L 0.5;
- BLD 103;
- A I 1.7;
- = L 0.6;
- BLD 103;
- A I 4.0;
- = L 0.7;
- BLD 103;
- A M 2.5;
- = L 1.0;
- BLD 103;
- A M 13.0;
- = L 1.1;
- BLD 103;
- CALL FB 3 , DB 53 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Sequential_Start := L 0.5,
- Contactor := L 0.6,
- Circuit_Breaker := L 0.7,
- Clock := L 1.0,
- reset := L 1.1,
- Delay_Time := T 20,
- ON_Timer_1 := T 21,
- Off_Timer_1 := T 51,
- Off_Time_1 := DB50.DBW 38,
- ON_Timer_2 := T 22,
- ON_Time_2 := DB50.DBW 36,
- Off_Timer_2 := T 23,
- Off_Time_2 := DB50.DBW 40,
- Contactor_Fault := DB2.DBX 2.7,
- CB_Fault := DB2.DBX 3.0,
- Motor_ON := Q 20.2);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 4.2;
- = L 0.1;
- BLD 103;
- A I 4.3;
- = L 0.2;
- BLD 103;
- A I 4.1;
- = L 0.3;
- BLD 103;
- A I 42.5;
- = L 0.4;
- BLD 103;
- A M 21.1;
- = L 0.5;
- BLD 103;
- A I 4.3;
- = L 0.6;
- BLD 103;
- A I 4.5;
- = L 0.7;
- BLD 103;
- A M 2.5;
- = L 1.0;
- BLD 103;
- A M 13.0;
- = L 1.1;
- BLD 103;
- CALL FB 3 , DB 61 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Sequential_Start := L 0.5,
- Contactor := L 0.6,
- Circuit_Breaker := L 0.7,
- Clock := L 1.0,
- reset := L 1.1,
- Delay_Time := T 24,
- ON_Timer_1 := T 25,
- ON_Time_1 := 0,
- Off_Timer_1 := T 26,
- Off_Time_1 := DB50.DBW 20,
- ON_Timer_2 := T 27,
- ON_Time_2 := DB50.DBW 18,
- Off_Timer_2 := T 28,
- Off_Time_2 := DB50.DBW 22,
- Contactor_Fault := DB2.DBX 3.2,
- CB_Fault := DB2.DBX 3.3,
- Motor_ON := Q 20.3);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 4.7;
- = L 0.1;
- BLD 103;
- A I 5.0;
- = L 0.2;
- BLD 103;
- A I 4.6;
- = L 0.3;
- BLD 103;
- A I 42.6;
- = L 0.4;
- BLD 103;
- A M 21.1;
- = L 0.5;
- BLD 103;
- A I 5.1;
- = L 0.6;
- BLD 103;
- A I 5.2;
- = L 0.7;
- BLD 103;
- A M 2.5;
- = L 1.0;
- BLD 103;
- A M 13.0;
- = L 1.1;
- BLD 103;
- CALL FB 3 , DB 62 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Sequential_Start := L 0.5,
- Contactor := L 0.6,
- Circuit_Breaker := L 0.7,
- Clock := L 1.0,
- reset := L 1.1,
- Delay_Time := T 29,
- ON_Timer_1 := T 30,
- ON_Time_1 := DB50.DBW 30,
- Off_Timer_1 := T 31,
- Off_Time_1 := DB50.DBW 34,
- ON_Timer_2 := T 32,
- ON_Time_2 := DB50.DBW 32,
- Off_Timer_2 := T 33,
- Off_Time_2 := 0,
- Contactor_Fault := DB2.DBX 3.5,
- CB_Fault := DB2.DBX 3.6,
- Motor_ON := Q 20.4);
- NOP 0;
- NETWORK
- TITLE =
- A I 40.3;
- = L 0.0;
- BLD 103;
- A I 5.4;
- = L 0.1;
- BLD 103;
- A I 5.5;
- = L 0.2;
- BLD 103;
- A I 5.3;
- = L 0.3;
- BLD 103;
- A I 42.7;
- = L 0.4;
- BLD 103;
- A M 21.1;
- = L 0.5;
- BLD 103;
- A I 5.6;
- = L 0.6;
- BLD 103;
- A I 5.7;
- = L 0.7;
- BLD 103;
- A M 2.5;
- = L 1.0;
- BLD 103;
- A M 13.0;
- = L 1.1;
- BLD 103;
- CALL FB 3 , DB 63 (
- Central_Local := L 0.0,
- LB_Start := L 0.1,
- LB_Stop := L 0.2,
- Emergency_Stop := L 0.3,
- Single_Start := L 0.4,
- Sequential_Start := L 0.5,
- Contactor := L 0.6,
- Circuit_Breaker := L 0.7,
- Clock := L 1.0,
- reset := L 1.1,
- Delay_Time := T 34,
- ON_Timer_1 := T 35,
- ON_Time_1 := DB50.DBW 42,
- Off_Timer_1 := T 36,
- Off_Time_1 := DB50.DBW 46,
- ON_Timer_2 := T 37,
- ON_Time_2 := DB50.DBW 44,
- Off_Timer_2 := T 38,
- Contactor_Fault := DB2.DBX 4.0,
- CB_Fault := DB2.DBX 4.1,
- Motor_ON := Q 20.5);
- NOP 0;
- NETWORK
- TITLE =
- A DB51.DBX 20.4;
- FP M 14.0;
- JNB _001;
- L MW 8;
- L 1;
- +I ;
- T MW 8;
- _001: NOP 0;
- END_FUNCTION
- ORGANIZATION_BLOCK OB 1
- TITLE = "Main Program Sweep (Cycle)"
- VERSION : 0.1
- VAR_TEMP
- OB1_EV_CLASS : BYTE ; //Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1)
- OB1_SCAN_1 : BYTE ; //1 (Cold restart scan 1 of OB 1), 3 (Scan 2-n of OB 1)
- OB1_PRIORITY : BYTE ; //Priority of OB Execution
- OB1_OB_NUMBR : BYTE ; //1 (Organization block 1, OB1)
- OB1_RESERVED_1 : BYTE ; //Reserved for system
- OB1_RESERVED_2 : BYTE ; //Reserved for system
- OB1_PREV_CYCLE : INT ; //Cycle time of previous OB1 scan (milliseconds)
- OB1_MIN_CYCLE : INT ; //Minimum cycle time of OB1 (milliseconds)
- OB1_MAX_CYCLE : INT ; //Maximum cycle time of OB1 (milliseconds)
- OB1_DATE_TIME : DATE_AND_TIME ; //Date and time OB1 started
- END_VAR
- BEGIN
- NETWORK
- TITLE =
- CALL FC 4 ;
- NOP 0;
- NETWORK
- TITLE =
- CALL FC 1 ;
- NOP 0;
- NETWORK
- TITLE =
- CALL FC 2 ;
- NOP 0;
- NETWORK
- TITLE =
- CALL FC 3 ;
- NOP 0;
- NETWORK
- TITLE =
- CALL FC 5 ;
- NOP 0;
- NETWORK
- TITLE =
- CALL FC 7 ;
- NOP 0;
- NETWORK
- TITLE =
- CALL FB 4 , DB 50 ;
- NOP 0;
- END_ORGANIZATION_BLOCK
- ORGANIZATION_BLOCK OB 82
- VERSION : 0.1
- VAR_TEMP
- TEMP0 : BYTE ;
- TEMP1 : BYTE ;
- TEMP2 : BYTE ;
- TEMP3 : BYTE ;
- TEMP4 : BYTE ;
- TEMP5 : BYTE ;
- TEMP6 : WORD ;
- TEMP7 : BOOL ;
- TEMP8 : BOOL ;
- TEMP9 : BOOL ;
- TEMP10 : BOOL ;
- TEMP11 : BOOL ;
- TEMP12 : BOOL ;
- TEMP13 : BOOL ;
- TEMP14 : BOOL ;
- TEMP15 : BYTE ;
- TEMP16 : BOOL ;
- TEMP17 : BOOL ;
- TEMP18 : BOOL ;
- TEMP19 : BOOL ;
- TEMP20 : BOOL ;
- TEMP21 : BOOL ;
- TEMP22 : BOOL ;
- TEMP23 : BOOL ;
- TEMP24 : BOOL ;
- TEMP25 : BOOL ;
- TEMP26 : BOOL ;
- TEMP27 : BOOL ;
- TEMP28 : BOOL ;
- TEMP29 : BOOL ;
- TEMP30 : BOOL ;
- TEMP31 : BOOL ;
- TEMP32 : DATE_AND_TIME ;
- END_VAR
- BEGIN
- END_ORGANIZATION_BLOCK
- ORGANIZATION_BLOCK OB 85
- TITLE = "Organization Block (OB) Not Loaded Fault"
- VERSION : 0.1
- VAR_TEMP
- OB85_EV_CLASS : BYTE ; //16#35 Event class 3
- OB85_FLT_ID : BYTE ; //16#XX, Fault identification code
- OB85_PRIORITY : BYTE ; //Priority of OB Execution
- OB85_OB_NUMBR : BYTE ; //85 (Organization block 85, OB85)
- OB85_RESERVED_1 : BYTE ; //Reserved for system
- OB85_RESERVED_2 : BYTE ; //Reserved for system
- OB85_RESERVED_3 : INT ; //Reserved for system
- OB85_ERR_EV_CLASS : BYTE ; //Class of event causing error
- OB85_ERR_EV_NUM : BYTE ; //Number of event causing error
- OB85_OB_PRIOR : BYTE ; //Priority of OB causing error
- OB85_OB_NUM : BYTE ; //Number of OB causing error
- OB85_DATE_TIME : DATE_AND_TIME ; //Date and time OB85 started
- END_VAR
- BEGIN
- END_ORGANIZATION_BLOCK
- ORGANIZATION_BLOCK OB 86
- VERSION : 0.1
- VAR_TEMP
- TEMP0 : BYTE ;
- TEMP1 : BYTE ;
- TEMP2 : BYTE ;
- TEMP3 : BYTE ;
- TEMP4 : BYTE ;
- TEMP5 : BYTE ;
- TEMP6 : WORD ;
- TEMP7 : ARRAY [0 .. 31 ] OF BOOL ;
- TEMP8 : DATE_AND_TIME ;
- END_VAR
- BEGIN
- END_ORGANIZATION_BLOCK
- ORGANIZATION_BLOCK OB 87
- TITLE = "Communication Fault"
- VERSION : 0.1
- VAR_TEMP
- OB87_EV_CLASS : BYTE ; //16#39 Event class 3
- OB87_FLT_ID : BYTE ; //16#XX, Fault identifcation code
- OB87_PRIORITY : BYTE ; //Priority of OB Execution
- OB87_OB_NUMBR : BYTE ; //87 (Organization block 87, OB87)
- OB87_RESERVED_1 : BYTE ; //Reserved for system
- OB87_RESERVED_2 : BYTE ; //Reserved for system
- OB87_RESERVED_3 : WORD ; //Reserved for system
- OB87_RESERVED_4 : DWORD ; //Reserved for system
- OB87_DATE_TIME : DATE_AND_TIME ; //Date and time OB87 started
- END_VAR
- BEGIN
- END_ORGANIZATION_BLOCK
- ORGANIZATION_BLOCK OB 121
- TITLE = "Programming Error"
- VERSION : 0.1
- VAR_TEMP
- OB121_EV_CLASS : BYTE ; //16#25, Event class 2, Entering event state, Internal fault event
- OB121_SW_FLT : BYTE ; //16#XX Software programming fault
- OB121_PRIORITY : BYTE ; //Priority of OB Execution
- OB121_OB_NUMBR : BYTE ; //121 (Organization block 121, OB121)
- OB121_BLK_TYPE : BYTE ; //16#88/8A/8B/8C/8E Type of block fault occured in
- OB121_RESERVED_1 : BYTE ; //Reserved for system
- OB121_FLT_REG : WORD ; //16#XX Specific register that caused fault
- OB121_BLK_NUM : WORD ; //Number of block that programming fault occured in
- OB121_PRG_ADDR : WORD ; //Address in block where programming fault occured
- OB121_DATE_TIME : DATE_AND_TIME ; //Date and time OB121 started
- END_VAR
- BEGIN
- END_ORGANIZATION_BLOCK
- ORGANIZATION_BLOCK OB 122
- VERSION : 0.1
- VAR_TEMP
- TEMP0 : BYTE ;
- TEMP1 : BYTE ;
- TEMP2 : BYTE ;
- TEMP3 : BYTE ;
- TEMP4 : BYTE ;
- TEMP5 : BYTE ;
- TEMP6 : WORD ;
- TEMP7 : WORD ;
- TEMP8 : WORD ;
- TEMP9 : DATE_AND_TIME ;
- END_VAR
- BEGIN
- END_ORGANIZATION_BLOCK
|