ST-7PRO2BlockCallsandMulti-instanceModelPage1SITRAINTrainingforAutomationandDrives…………….............................................................................2STEP7…..…….................................................................................................3…........................................................4………….........................................................................................................5….....................................................................6………………...................................................................7……….................................................................................8………….........................................................................................9.......................................................................................10FB.................................................................................................11FB……………...............................................................................12…………...................................................................136..........................................................................146.1a——.................................................................................156.1b——........................................................................................16..............................................................................................17…................................................................18STEP7””………...............................................................................19.........................................................................................206.2....................................................................216.2a...................................................................22FB1”Station”………..............................................................................................23FB2“Transport”……...........................................................................................246.2b3........................................................................................25...........................................................................................…26Date:2010-7-5File:PRO2_06E.1SIMATICS7SiemensAG2001.Allrightsreserved.SITRAINTrainingforAutomationandDrivesST-7PRO2BlockCallsandMulti-instanceModelPage2SITRAINTrainingforAutomationandDrivesSTEP7STEP7FCFB••“”DB••••“”Date:2010-7-5File:PRO2_06E.2SIMATICS7SiemensAG2001.Allrightsreserved.SITRAINTrainingforAutomationandDrivesll•ll••OB111FB1FB2FB10FC5SFC.....CALLFB1,DB2Start:=I0.0Stop:=I0.1Motor_on:=Q12.0Speed:=QW14..FB10.0inStartBOOL0.1inStopBOOL2.0outMotor_onBOOL4.0outSpeedINT6.0statSpeed_oldINT0.0tempCalc_1INT...A#StartAN#Stop=#Motor_on.DB2OB1Date:05-1-10File:PRO2_06E.2SIMATICS7SiemensAG2001.Allrightsreserved.SITRAINTrainingforAutomationandDrivesll•ll••OB111FB1FB2FB10FC5SFC.....CALLFB1,DB2Start:=I0.0Stop:=I0.1Motor_on:=Q12.0Speed:=QW14..FB10.0inStartBOOL0.1inStopBOOL2.0outMotor_onBOOL4.0outSpeedINT6.0statSpeed_oldINT0.0tempCalc_1INT...A#StartAN#Stop=#Motor_on.DB2OB1ST-7PRO2BlockCallsandMulti-instanceModelPage3SITRAINTrainingforAutomationandDrivesSTEP7STEP7,STEP7•OBFBFCDB.OBFBFCDBCPU•SFBSFCSDBSFBSFCCPUPLCSDBCPUSDBHW-CONFIGNETPROSDB————CPUSTOPSTEP7•STEP7OBFBFCDBCPUDate:2010-7-5File:PRO2_06E.3SIMATICS7SiemensAG2001.Allrightsreserved.SITRAINTrainingforAutomationandDrivesSTEP7OB--027-FB--FC--DB-DB-SFB-FBCPUSFC-FBCPUSDB-ST-7PRO2BlockCallsandMulti-instanceModelPage4SITRAINTrainingforAutomationandDrivesFBFCFBFC//FBFC//FC/FBPLCPOINTERANYPLCSTLLADFBDSCLDate:2010-7-5File:PRO2_06E.4SIMATICS7SiemensAG2001.Allrightsreserved.SITRAINTrainingforAutomationandDrivesMotorENENOStart...0.0StartBOOLFALSE0.1StopBOOLTRUE2.0SpeedINT02.0Motor_onBOOLFALSE8.0SetpointINT010.0/EMER_OFFBOOLFALSE.......................SetpointEMER_OFFMotor_onStop/lCaller-BlocklBlock-Callerl/Caller-Block“shell”l“”l§§POINTERANYl§PLCSpeedST-7PRO2BlockCallsandMulti-instanceModelPage5SITRAINTrainingforAutomationandDrivesSTEP7/IEC61131IEC61131-3•RET_VAL•••“”STEP7STEP5Date:2010-7-5File:PRO2_06E.5SIMATICS7SiemensAG2001.Allrightsreserved.SITRAINTrainingforAutomationandDrivesl/lIEC61131-3llRET_VALllCALLFC10On_1:=I0.1On_2:=I0.2Off:=Q8.0FC10On_1BOOLOn_2BOOLOffBOOL......A#On_1A#On_2=#Off...ST-7PRO2BlockCallsandMulti-instanceModelPage6SITRAINTrainingforAutomationandDrivesFCCALLFC//24FCCALLSTL/LAD/FBDFCFCAOn_1CPUBFCFC“”FC.•FC•DBDate:2010-7-5File:PRO2_06E.6SIMATICS7SiemensAG2001.Allrightsreserved.SITRAINTrainingforAutomationandDrivesOB1FC10CALLFC10On_1:=I0.1On_2:=I0.2Off:=Q8.0On_1BOOLOn_2BOOLOffBOOL......A#On_1A#On_2=#Off...OB1BLD1=L20.0UCFC10P#I0.1P#I0.2P#Q8.0BLD210010010...IB0lllST-7PRO2BlockCallsandMulti-instanceModelPage7SITRAINTrainingforAutomationandDrivesARRAYSTRUCT“”ARRAYSTRUCTDATE_AND_TIMESTRINGSTL/LAD/FBDFCFCDBPOINTERPOINTERCALLVLStackPOINTER•View-BlockProperties•ARRAYSTRUCTDate:2010-7-5File:PRO2_06E.7SIMATICS7SiemensAG2001.Allr