施耐德PLC讲座演示CC21_X_E.ppt
,ConceptV2.1Examples-Solutions-English,Preliminary,Concept2.1Examples-Solutions-Contents,Example1CreateaswitchingcircuitinFBDExample2SwitchingcircuitwithtimelimitinFBDExample3ThecutionOrderinFBDExample4SimpleswitchingcircuitinLDExample5SwitchingcircuitwithtimelimitinLDExample6SimpleswitchingcircuitwithDFBExample7SwitchingCircuitwithtimelimitbymodifyingaDFBExample8SwitchingcircuitwithMacroExample9DDTHandling,Example10Import,ExportExample11SFCHandlingExample12SwitchingCircuitasSequenceControlwithSFCExample13SimpleswitchingcircuitinILExample14SwitchingcircuitwithtimelimitinILExample15SimpleswitchingcircuitinSTExample16SwitchingcircuitwithtimelimitinSTExample17IndirectLoadinginSTwillbecontinuedlater,ExamplesGeneralRemarks,AllexamplesarecreatedforuseinConceptcoursesAllsolutionshavebeencreatedandtestedwithincourses.TheshownlogicplansandprogramsareusuallynottheonlysolutionsTheycanbeextendedbythestudenttofulfilltheirindividuelrequirementsTaketimeforyourownrcises,Example1CreateaswitchingcircuitinFBD,TrytounderstandthefunctionalityandinsertthegivenlogicintoaFBDsection.DrawalinkOT_RIinstedofthelinkMOT_LEandlookforthecutionorderAvoidthelink,makebothconnectionsbyvariablenameslowerlogic.LookforthecutionorderCreateaprojectandsectiondescriptionaswellascommentstothesection,Example1SolutionACreateaswitchingcircuitinFBD,Example1SolutionBCreateaswitchingcircuitinFBD,Example1SolutionCLookfortheFFBcutionorder,Example2Switchingcircuitwithtimelimit,Modifyexample1sothatastarteddirectionwillbeswitchedoff,afteranindividualtimehasbeenelapsed.Insertonetimerforeachdirectionsothattheleftdirectionisrunning5sandtherightdirection10s.InasecondsteptheprevioussolutionshouldbeextendedwhenoneoutputswitchesofftheotherhastobeswitchedonIfthereareanyquestionsaboutfunctionalitiesoftimersandotherthings,trytousethehelpfunction.,Example2SolutionSwitchingcircuitwithtimelimit,Example3ThecutionOrder,ChangethepriorityofbothoutputsbychangingtheFFB-cutionorder.WatchthecutionnumbersoftheotherFFBs.bycreatingtwonewsectionsOnesectionwiththelogicfortheleftturnOnesectionwiththelogicfortherightturnChangethecutionorderandcheckthefunctionality,Example3SolutionThecutionOrder,Example4LadderDiagramLDSimpleswitchingcircuit,Createasimpleswitchingcircuitreferringtoexample1FBDsON_RI,ON_LE,STOPOutputsMOT_RI,MOT_LEIfyouhavecreatedanewsectioninanexistingproject,youmayhaveoverlappingaddressesormultiassignmentofvariablesThenthinkaboutdisablingofsections.,Example4SimpleswitchingcircuitwithLD-Solution,Example5LadderDiagramLDSimpleswitchingcircuitwithtimelimitation,Modifyexample4sothatastarteddirectionwillbeswitchedoff,afteranindividualtimehasbeenelapsed.Insertonetimerforeachdirectioninthatway,thattheleftdirectionisrunning5sandtherightdirection10s.Inasecondsteptheprevioussolutionshouldbeextendedwhenoneoutputswitchesofftheotherwillbeswitchedonautomatically.Ifyouhaveoverlappingaddressesormultiassignmentofvariables,thinkaboutdisablingofsection.Ifthereareanyquestionsaboutfunctionalitiesoftimersandotherthings,usethehelpfunction.,Example5Ex4withtimelimitationLD-Solution,Example6SwitchingcircuitwithDFB,CreateaDFBwithonlyonesectionbecausethelogicforleftandrightdirectionisthesameSavetheDFBunderx\concept\dfbwiththeprojectnameviceversaInserttheDFBviceversatwiceinanewConceptprojectoneDFBfortheleftdirectiononeDFBfortherightdirectionDownloadandtestthenewproject,Example6SolutionSwitchingcircuitwithDFB,,CreatedwithConceptDFB,CreatedwithConcept,,Example7ModifyingaDFBSwitchingCircuitwithtimelimitation,ModifytheDFBofexample6byaddingatimer.ByinstantiationthisDFBhastocontroltwodifferentdirectionswithdifferenttimues.Createtherequired-/outputvariablesDefineforthetimerpinaninitialvalueSavethemodifiedDFBStartagainConceptDownloadtheprogramwiththeDFBfromExample6.,Example7SolutionConceptDFBSectionSolution3asDFB,,,CreatedwithConceptDFB,CreatedwithConcept,Example8SwitchingcircuitwithMacro,CreateaMacrowithforonlyonedirection.SavetheMacrounderx\concept\dfbwiththeprojectnameMOT1.macInserttheMacroMOT1.mactwiceinanewConceptprojectoneMacrofortheleftdirectiononeMacrofortherightdirectionWatchtheVariableEditorDownloadandtestthenewproject,Example8SolutionSwitchingcircuitwithMacro,CreatedwithConceptDFB,CreatedwithConcept,,,Example9DDTHandling,ChangetheDFBsolutionofrcise7ReplacethetwolinksbetweenthetwodirectionsbyonelinkwiththehelpofaderiveddatatypeDDT.Forthiscreateanewdatatype“versus“andanewDFB“revolve“bymodifyingtheexistingDFB“viceversa“.ReplacethethreeDFBsStart,Stop,Timesetupvaluebyone.Forthismodifythenewdatatype“versus“-“inpe“anddefineanewDFB“turn“bymodifyingtheexistingDFB“revolve“.CreateafurtherDFB“mot_in“,whoswitchesthethreestooneoutput.ThinkaboutthedifferentnamesforDFBs,DDTs,sandoutputs.,Example9Solution1DDTHandling,1.DDTs,createdwithConceptDTY,Example9Solution1DDTHandling,DFBRevolve,createdwithConceptDFB,Example9Solution1DDTHandling,CallofDFBRevolve,createdwithConcept,Example9Solution2DDTHandling,2.DDTs,createdwithConceptDTY,Example9Solution2DDTHandling,DFBTurn,createdwithConceptDFB,,Example9Solution2DDTHandling,DFBIN_MOT,createdwithConceptDFB,Example9Solution2DDTHandling,,CallofDFBTurnandIN_MOT,createdwithConcept,Example10Import,Export,ExportallandselectedVariabledeclarationsofyourproject,andimportthemtoanewproject.ExportoneSectionandimportthisintoanewproject.Comparetheimportresults..Lookatallexportfileswiththehelpofthefilemanager.,Example10SolutionImport,Exportofexample1asIL,PROGRAMMotor_Left_RightVARRightRS;LeftRS;Motor_Left_RightSECT_CTRL;MOT_LEATQX1BOOL;MOT_RIATQX2BOOL;ON_LEATIX2BOOL;ON_RIATIX3BOOL;STOPATIX1BOOL;END_VARLDON_LEANDNMOT_RISTLeft.S,LDSTOPSTNLeft.R1CALLeftLDLeft.Q1STMOT_LELDON_RIANDNMOT_LESTRight.SLDSTOPSTNRight.R1CALRightLDRight.Q1STMOT_RIEND_PROGRAM,Example11SFCHandling,CreateanewSFCsectionforanysequenceloopProgramfirstasimpleloop.Theoutputsofexample5canbeusedastransitions.Considerthereactionoftheloopwithdifferentsupervisiontimesandstepdelaytimes.Inthesecondpartextendtheloopwithalternativeandparallelbranches.Inbothpartsyoushouldworkwithanimation.IfthereareanyquestionstothefunctionalityofSFC,remembertherearecomprehensivehelpfunctionsavailable.,Example11SolutionSFCHandling,Solutionforplaying,Example12SwitchingCircuitasSequenceControlwithSFC,Theproblemdefinitionofexample2hastobesolvedwiththematterofSFCDefineandprogramfirstallrequiredstepswiththeiractionsandtransitions.AttentionBetweenchangingthedirectiontheremustbeabreakof4and6secondsrespectively.SubsequentlydefineandprogramforarealisticoperationtherequiredlogicfortransitionsandactionsinseperateFBDsections.Thefirsttestoftheprogramshouldbedonewiththeanimationpanel.,Example12SwitchingCircuitasSequenceControlwithSFC-proposalforsolution,,,,LogicforTransitions,LogicforActions,Sequence,Start,Break,Left,,,R-TRIG,,,,RS-FF,AND,,,,,,,,,,,,,,,FBDSection,FBDSection,SFCSection,Example12SolutionSwitchingCircuitasSequenceControlwithSFCTransitions,Example12SolutionSwitchingCircuitasSequenceControlwithSFCSequence,Example12SolutionSwitchingCircuitasSequenceControlwithSFCActions,Example12SolutionSwitchingCircuitasSequenceControlwithSFCActions,Spentyourtime,tofindamorerealisticsolutionwithactionsectionsandtransitionsections,Example13InstructionListILSimpleswitchingcircuit,Createasimpleswitchingcircuitreferringtoexample1FBDsON_RI,ON_LE,STOPOutputsMOT_RI,MOT_LEIfyouhaveoverlappingaddressesormultiassignmentofvariables,trydisablingtheothersections.,Example13_1/2SolutionsSimpleswitchingcircuitwithIL,Example14InstructionListILSimpleswitchingcircuitwithtimelimitation,Modifyexample12sothatastarteddirectionwillbeswitchedoff,afteranindividualtimehasbeenelapsed.Insertonetimerforeachdirectioninthatway,thattheleftdirectionisrunning5sandtherightdirection10s.Inasecondsteptheprevioussolutionshouldbeextendedwhenoneoutputswitchesofftheotherhastobeswitchedonautomatically.Ifyouhaveoverlappingaddressesormultiassignmentofvariables,thinkaboutdisablingofsection.Ifthereareanyquestionsaboutfunctionalitiesoftimersandotherthings,thinkforthehelpfunction.,Example14_1SolutionSimpleswitchingcircuitwithtimelimitationwithIL,Example14_2SolutionSimpleswitchingcircuitwithtimelimitationwithIL,Example15StructuredTextSTSimpleswitchingcircuit,Createasimpleswitchingcircuitreferringtoexample1FBDsON_RI,ON_LE,STOPOutputsMOT_RI,MOT_LEIfyouhaveoverlappingaddressesormultiassignmentofvariables,thinkaboutdisablingofsection.,Example15SolutionSimpleswitchingcircuitwithST,Example16StructuredTextSTSimpleswitchingcircuitwithtimelimitation,Modifyexample14sothatastarteddirectionwillbeswitchedoff,afteranindividualtimehasbeenelapsed.Insertonetimerforeachdirectioninthatway,thattheleftdirectionisrunning5sandtherightdirection10s.Inasecondsteptheprevioussolutionshouldbeextendedwhenoneoutputswitchesofftheotherhastobeswitchedonautomatically.Ifyouhaveoverlappingaddressesormultiassignmentofvariables,thinkaboutdisablingofsection.Ifthereareanyquestionsaboutfunctionalitiesoftimersandotherthings,usethehelpfunction.,Example16SolutionSimpleswitchingcircuitwithtimelimitationwithST,Example17StructuredTextSTDFBforindirectLoading,CreateaDFBforindirectloadingThecontentsofoneof11wordaddressesWordareacanbedefinedbyyourselfhavetobeloadedintoanotherwordaddress-CONTDefinefirstthederiveddatatypeW_ARR11onlyforConceptV2.1RDefinenexttherequiredDFBCallforthenewDFBonConceptandtesttheProgram,Example17SolutionDFBforIndirectLoadingLA5,,ConceptDFB,Concept,RDEConcept,ConceptDDT,Example18,Willbecontinuedlater,