CLXtipsTask.docx
《CLXtipsTask.docx》由会员分享,可在线阅读,更多相关《CLXtipsTask.docx(20页珍藏版)》请在冰豆网上搜索。
CLXtipsTask
TaskModelinControlLogix
Introduction:
OptimizingtheProgramScantimecanhavesignificanteffectsonoverallperformanceofthesystemintermsofDataAcquisitionandControl.FastI/Ocardsandhighbandwidthdeterministicnetworkscanringdatafromthefieldtotheprocessor,butiftheprogramsarenotoptimized,theoutputscannotbeupdated.
ControlLogixhasbuiltingranularityintermsofprogrammanagement.Thislabusesaliveapplicationtodrivehomesomeofthespecificsofthemulti-taskmodelofControlLogix.
Objectives
1.MonitorandUnderstandScanTimeandtheoverheadtimesliceparameter.
2.Creatingperiodictaskandunderstandingtheeffectsofscanrateandpriorityandtheirinter-dependence.
3.Creatinganadditionalprograminoneofthetaskandunderstandingtheeffectsonscantime.
ToolsyouneedforthisLab
∙TwoControlLogixdemounitsconnectedoncontrolnet.
∙RSLogix5000
∙RSLinks2.2
FactsonScanTime:
ProgramScanTime:
Scantimeofindividualprogramwithinatask.Thistimerepresentsthetimeittakestoscantheprogram,notincludinginterruptions.
MaximumTaskScanTime:
MaximumScantimeaparticulartaskusedsincethetimeitwasscheduled.
TaskModelinControlLogix
Objective1-UnderstandingScanTimeandoverheadtimeslice
YourActions
StarttheProjectcalledPVCComponding_Lab.
1.
Expandthemaintaskintheorganizerandnoticethenumberofsubroutinesintheprogram.Asasidenote,noticesomeofthennuancesofthisactualapplication:
a.
Afairlylargenumberofuser-definedstructuresbeingusedinthisapplication.
b.ThevariousInputOutputmodules.
Anyway,goingbacktothetaskathand,selectthemaintaskandrightclickwithyourmouse.Godowntothepropertiesandthenclickontheconfigurationtab.
2.
NoticethescanTimesinmicroseconds.TheMaxrepresentsthemaximumtimethecontrollertooktoprocesstheentireprogramtillnow.Thelastindicatesthetimetakenbythelastscantooktoexecutetheprogram
TaskModelinControlLogix
Objective1-UnderstandingScanTimeandoverheadtimeslice
3.NotedownthisvaluesintheTaskModelWorkSheet1atSl.No.1
4.ResettheMaxScanandnoticetheupdatedmaximumscan.NotedownthesevaluesontheTaskModelWorkSheet1atSl.No.2
TaskModelWorkSheet1
SLNo
Activity
RecordedTime
1
MainTaskMaximumTimeinmicroSeconds
2
MainTaskMaximumTimeinmicrosecondsafterresetting.
5.
RightclicktoselectpropertiesunderthecontrollercalledPVC_Compounding.NowclickontheAdvancedtabinthefolder.NoticetheSystemOverheadtimeslice.ChangethesystemOverHeadtimeslicefrom10to90%(afterchangingpressapply)andmonitortheeffectthishasonthemaintaskscantime(afterrecordingtheeffectresetthemaximumtime).RecordyourobservationsintheWorkSheet2below:
TaskModelinControlLogix
Objective1-UnderstandingScanTimeandoverheadtimeslice
WorkSheet2
SLNo.
SystemOverHeadTimeSlice.
MainTaskMaximumTimeMicroSec.
1
10
2
20
3
30
4
40
5
50
6
60
7
70
8
80
9
90
6.Getintoadiscussionwithintheclasswiththehelpofyourinstructortovalidateyourfindings.Theauthor’scommentsonthiscanbefoundattheendofthislab.
FACTS:
TheLogix5000allowsyoutoallocateapercentageoftheCPUtimetoperformthebackgroundCPUfunctions(likeprogramterminalsupport,CommunicationswithHMI,Re-establishandmonitorIOconnectionsandstatus,ControlLogixmessagingetc).Bydefault,thistimeissetto10%.Whichmeansthatforevery10millisecondofcontinuoustaskexecution,amillisecondisassignedtotheCPUoverheadfunction.
TaskModelinControlLogix
Objective1-UnderstandingScanTimeandoverheadtimeslice
Analysis
Thedatarecordedinworksheet2canbeplottedasabove.Asweincreasetheoverheadtimesliceparameterthemaintasktimegoesonincreasing.SothereasonablevaluefortheOverHeadtimesliceparameterisintherangeof10%to35%.
Thereareapplicationswherenotonlythecontrollerhastohandlelotofcommunicationtaskbutalsoneedtoexecutesomesectionsoftheplantatadeterministicrate.Forexamplewewanttohaveanoverheadtimesliceof45%sothattheHMIdatagetsreportedatafasterrate.Thiswouldmeanwecan’texecutetheentireprogram(refertheplot)fasterthen4000microseconds.Butifwestillneedasectionoftheprogramtoexecuteatadeterministicrateweneedtoputthatpartoftheprograminaperiodictask.
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
YourActions
7.
Letusinvestigatewhatthisprogramachieves.Notethattheroutine“Master”controlsthenestingtotheotherroutinesthatyouseebelow.
8.
DoubleClickandopenthe“Master”routine.Youwillnoticethatthisroutineexecutestheentireprograminthreesections:
Sequencing,MixingandAuxiliaryoperations.
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
Youcanrightclickoneachofthesubroutinestocheckthecross-reference.
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
WewillassumethatitisveryimportanttoexecutethesectionsMixingandSequencingfasterthen4000microseconds.
9.Toachievedeterminismwedividethisprogramintotwoperiodictasksinthenextsection.
PeriodicTasks
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
TosaveontimeloadtheApplicationProgramnamedPVCCompounding_MultiProgramandmovetopoint19
10.TocreateClickontaskandrightclick,Navigateto[NewTask].Provideataskname(MixingOperation)andsayOK.
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
11.Similarlycreateanothertaskcalledsequencing.
12.NowgotothejustcreatedtaskcalledMixing_OperationandrightclickandnavigatetoNewProgram.ProvideanametotheprogramMixer_Section1_B.NowgobacktothecreatedtaskcalledmixingoperationandcreateanotherprogramcallitMixer_Section2_B.
13.CreateaprogramcalledIO_Section_1undertheperiodictaskMixing_Operation.
14.Nowremovetheassignedroutinefromthemainprogrambyrightclickingonthemainprogramandselecting
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
15.
Nowdragonesubroutineatatimeandputthemintorespectiveprogramsintheperiodictasks.Onceyoucompletethis,yourorganizershouldlooklikethis.
16.DeletethesubroutinecalledMaster.
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
17.Gotothemainprogramandrightclickandgotoproperties.Nowclickontheconfigurationtab.AsianthemainroutineastheMixer1.
18.Similarlyontheassignthefirstroutinestothemaininalltheprograms.
∙Mixing_Section1_BwithMix1_B4_Seq
∙I_O_Section1withA1_Seq
19.DownLoadtheprogramandGoOnLine.
FACT:
TheLogix5550providetheabilitytocreateupto32tasks
oneContinuosand31Periodic
Aperiodictaskcanbeconfiguredtoexecuteaslowas1mSec.Eventhoughthetaskistriggeredat1mstheoperatingsystemcausessomedelaybeforegivingthecontrolover.
AttheendofeachprogramtheoperatingsystemperformsanupdateofIOwhichtakessomeextraprocessingtime.
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
20.PullouttheformcalledTaskModelWorksheet3filedattheendofthislab.
21.NowrightclickonthemaintaskandnavigatetopropertiesandselecttheconfigurationTab.Similarlyopentheconfigurationtabsoftheothertwoperiodictasks.Arrangethemonthescreen.Yourscreenwilllooklikethis.
22.Setthepriorityofthemixingoperationtaskas1.Andthenchangetherateto1.5ms.
23.Monitortheeffectontheothertwotasks.RecordyourobservationsonTaskModelWorksheet3(onthenextpage).Forthevariousoptionsprintedintheformrecordyourobservations
24.Co-relateyourobservationstoyourunderstandingofthetaskmodel.
25.Engageageneraldiscussionwithyourpartnersandtheclasswiththehelpofyourinstructorontherecordedresults.
TASKMODELWORKSHEET3
MainTask
Sequencing
MixingOperations
LastScan
Priority
PeriodicRate
MaxRate
LastSan
Priority
PeriodicRate
MaxRate
LastScan
1
1.5
2
1
2
2
3.7
1
5
2
3.7
1
7
2
3.7
1
5
2
3.7
1
2
2
3.7
1
1.5
2
1.5
1
1.5
2
1.5
1
1.5
2
1.5
1
1.5
2
5
2
1.5
2
1.5
2
3
2
3
2
5
2
5
2
5
2
1.5
2
3
2
1.5
2
2
5
2
2
3
2
2
TaskModelinControlLogix
Objective2-Effectsofscanrateandpriority
Analysis
Usingperiodictaskwecanrunasectionoftheplantoraportionoftheprogramatapreconfigureddeterministicrate.
Thisaddsdeterminismandmodularityintheprogram.
TaskModelinControlLogix
Objective3-EffectofadditionalProgramonScanTime
YourActions
TosavetimepleaseloadtheprogramPVCcompoundingLab1applicationprogram
1.NowgotothecreatedtaskcalledMixingOperationandrightclickandnavigatetoNewProgram.ProvideanametotheprogramMixer_Section2_B.
Assignthefirstroutinestothemaininalltheprogram.
∙Mixing_Section2_BwithMix2_B4_Seq
2.Theorganizershouldappearasshownabove.
TaskModelinControlLogix
Objective3-EffectofadditionalProgra