首页 labview数组和簇的应用教程.pdf

labview数组和簇的应用教程.pdf

labview数组和簇的应用教程.pdf

上传者: 寒江雪 2014-02-23 评分1 评论0 下载1 收藏0 阅读量286 暂无简介 简介 举报

简介:本文档为《labview数组和簇的应用教程pdf》,可适用于软件工程领域,主题内容包含wwwnicomExercise:ArraysandClustersOverviewThisexercisewillgooverhowtocreat符等。

wwwnicomExercise:ArraysandClustersOverviewThisexercisewillgooverhowtocreatearraysandclustersYouwillalsolearnabouthowtopassdatatoandfromarraysandhowtobundleandunbundleclustersGoalUnderstandthebasicbehaviorofarraysandclustersintheLabVIEWenvironmentDescription ThisexerciseconsistsofaseriesoftasksinwhichwillwalkyouthroughhowdataispassedtoandfromarraysIndexingarrayswillbeexploredindetailHowtobundledatawillbeexplainedaswellashowtounbundleinformationfromclustersArraysDescriptionYouaregivenaVIandaskedtoenhanceitforavarietyofpurposesForeachpartofthisexercise,beginwiththeArrayInvestigationvilocatedatthebottomofthispageThefrontpanelofthisVIisshowninthefigurebelowThenextfigureshowstheblockdiagramofthisVIThisexerciseisdividedintopartsYouaregiventhescenarioforeachpartfirstRefertotheendofthisexercisefordetailedimplementationinstructionsforeachpartPart : Iterate, Modify, and Graph ArrayModifytheArrayInvestigationVIsothatafterthearrayiscreated,thearrayisindexedintoForLoopswhereyoumultiplyeachelementofthearraybyandcoerceeachelementtothenearestwholenumberGraphtheresultingDarraytoanintensitygraphPart : Simplified Iterate, Modify, and Graph ArrayModifytheArrayInvestigationVIorthesolutionfromParttoaccomplishthesamegoalswithoutusingthenestedForLoopsPart : Create Subset ArraysModifytheArrayInvestigationVIsothattheVIcreatesanewarraythatcontainsthecontentsofthethirdrow,andanothernewarraythatcontainsthecontentsofthesecondcolumnPart : ImplementationModifytheArrayInvestigationVIsothatafterthearrayiscreated,thearrayisindexedintoForLoopswhereyoumultiplyeachelementofthearraybyandcoerceeachelementtothenearestwholenumberGraphtheresultingDarrayonanintensitygraphOpenlocatedatthebottomofthispageArray InvestigationviSavetheVIasArray Investigation Part viAddantothefrontpaneloftheVIandautoscaletheXandYaxes,asshowninthefigurebelowToautoscaletheaxes,rightclicktheintensitygraphandselectintensity graphXandScaleAutoScale XY ScaleAutoScale Y:Document TypeTutorial:YesNI Supported:Jul,Publish DatewwwnicomOpentheblockdiagramoftheVIInthefollowingsteps,youcreateablockdiagramsimilartothenextfigureIteratetheArrayAddatotherightoftheexistingcodeFor LoopAddasecondinsidethefirstFor LoopFor LoopWiretheterminaltotheinteriorborderThiscreatesanautoindexedinputtunnelonbothForLoopsarray indicatorFor LoopMultiplyeachelementofthearraybyAddafunctiontotheinteriorMultiplyFor LoopWiretheindexedinputtunneltotheinputofthefunctionxMultiplyRightclicktheinputandselectfromtheshortcutmenuyCreateConstantEnterintheconstantRoundeachelementtothenearestwholenumberAddafunctiontotherightofthefunctionRound To NearestMultipleWiretheoutputofthefunctiontotheinputofthefunctionMultiplyRound To NearestCreateaDarrayontheoutputoftheForLoopstorecreatethemodifiedarrayWiretheoutputofthefunctiontotheouterThiscreatesanautoindexedoutputtunnelonbothForLoops Round To NearestFor LoopWiretheoutputarraytotheindicatorIntensity GraphSwitchtothefrontpanelSavetheVIEntervaluesforRowsandColumnsRuntheVIPart : ImplementationModifyParttoaccomplishthesamegoalswithoutusingthenestedForLoopsOpenifitisnotstillopenArray Investigation Part viSavetheVIas Array Investigation Part viOpentheblockdiagramRightclicktheborderoftheinteriorForLoop,containingthefunctionandthefunction,andselectMultiplyRound to NearestRemove For LoopwwwnicomRightclicktheborderoftheremainingandselectfromtheshortcutmenuYourblockdiagramshouldresemblethefigurebelowFor LoopRemove For LoopSavetheVISwitchtothefrontpanelEntervaluesforRowsandColumnsRuntheVINoticethattheVIbehavesthesameasthesolutionforPartThisisbecausemathematicalfunctionsarepolymorphicForexample,becausetheinputoftheMultiplyfunctionisaxtwodimensionalarray,andtheinputisascalar,thefunctionmultiplieseachelementinthearraybythescalar,andoutputsanarrayofthesamedimensionastheinputyMultiplyxPart : ImplementationModifyArrayInvestigationVIsothattheVIcreatesanewarraythatcontainsthecontentsofthethirdrow,andanothernewarraythatcontainsthecontentsofthesecondcolumnOpenlocatedatthebottomofthispageArray InvestigationviSavetheVIasArrayInvestigation Part viOpentheblockdiagramoftheVIInthefollowingsteps,youbuildablockdiagramsimilartothatshowninthenextfigureRetrievethethirdrowofdatafromArrayusingtheIndexArrayfunctionAddthefunctiontotheblockdiagramIndex ArrayWiretotheinputofthefunctionArrayarrayIndex ArrayTip:TheIndexArrayfunctionacceptsanndimensionalarrayAfteryouwiretheinputarraytotheIndexArrayfunction,theinputandoutputterminalnameschangetomatchthedimensionofthearraywiredTherefore,wiretheinputarraytotheIndexArrayfunctionbeforewiringanyotherterminalsRightclicktheinputoftheIndexArrayfunctionindex(row)SelectfromtheshortcutmenuCreateConstantEnterintheconstanttoretrievethethirdrowRememberthattheindexbeginsatzeroRightclicktheoutputofthefunctionsubarrayIndex ArraySelectfromtheshortcutmenu CreateIndicatorNametheindicatorThird RowRetrievethesecondcolumnofdatafromtheArrayusingtheIndexArrayfunctionAddanotherfunctiontotheblockdiagramIndex ArrayWiretotheinputofthefunctionArrayarrayIndex ArrayRightclicktheinputofthefunctiondisable index(col)Index ArraySelectCreateConstantEnterintheconstanttoretrievethesecondcolumnbecausetheindexbeginsatzeroRightclicktheoutputofthefunctionsubarrayIndex ArraySelectCreateIndicatorNametheindicatorSecond ColumnSavetheVIwwwnicomSwitchtothefrontpanelEntervaluesforRowsandColumnsRuntheVIClustersOpenablankVISavetheVIasCluster ExperimentviInthefollowingsteps,youcreateafrontpanelsimilartothefigurebelowAddaStothefrontpanelwindowtop buttonAddaNindicatortothefrontpanelwindowumericAddatothefrontpanelRound LEDRenametheLEDBoolean Createaclusternamed,containingaClusternumeric control, two toggle switches, and a slide controlAddatothefrontpanelCluster ShellAddacontroltotheclusterNumericAddtwototheclusterVertical Toggle SwitchesRenametheBooleantoggleswitchesto Boolean AddatotheclusterHorizontal Fill SlideCreate,containingthesamecontentsasCluster,butindicatorsinsteadofcontrolsModified ClusterCreateacopyofClusterRelabelthecopyModified ClusterRightclicktheshellof,andselectfromtheshortcutmenuModified ClusterChange to IndicatorCreate,containingaandaSmall ClusterBoolean indicatornumeric indicatorCreateacopyofModified ClusterRelabelthecopySmall ClusterDeletethesecondtoggleswitchDeletethehorizontalfillslideindicatorRightclickSmallClusterandselectAutosizingSize to FitRelabelthenumericindicatortovalueSlideResizetheclusterasneededVerifytheclusterorderofCluster, Modified Cluster, and Small ClusterRightclicktheboundaryofandselectfromtheshortcutmenuClusterReorder Controls in ClusterwwwnicomConfirmtheclusterordershowninthefigurebelowClickthebuttononthetoolbartosettheclusterorderandexittheclusterordereditmodeConfirmRightclicktheboundaryofandselectfromtheshortcutmenuModified ClusterReorder Controlsin ClusterConfirmtheclusterordersshowninthefigurebelowshouldhavethesameclusterorderasModified ClusterClusterClickthebuttononthetoolbartosettheclusterorderandexittheclusterordereditmodeConfirmRightclicktheboundaryofandselectfromtheshortcutmenuClickthebuttononthetoolbartosettheclusterorderandexittheclusterorderSmall ClusterReorder Controls in ClusterOKeditmodeConfirmtheclusterordersshowninthefigurebelowInthefollowingsteps,buildtheblockdiagramshowninthenextfigureAddthefromtheStructurespalettetotheblockdiagramWhile LoopDisassembleClusterAddthefunctiontotheblockdiagramUnbundleWiretotheinputofthetoresizethefunctionautomaticallyClusterUnbundle functionAssembleSmallClusterAddthefunctiontotheblockdiagramBundleWirethefunctionasshowninthefigureaboveBundleAssembleModifiedClusterAddthefunctiontotheblockdiagramUnbundle by NameWirethetothefunctionClusterUnbundle by NameResizethefunctiontohavetwooutputterminalsUnbundle by NameSelectinthefirstnode,andinthesecondnodeIfalabelnameisnotcorrect,usetheOperatingtooltoselectthecorrectitemNumericBoolean AddthefunctiontotheblockdiagramIncrementWiretheoutputofthefunctiontotheinputofthefunctionThisfunctionaddsonetothevalueofNumeric Unbundle By NameIncrementNumericAddthefunctiontotheblockdiagramNotWiretheoutputofthefunctiontotheinputofthefunctionThisfunctionreturnsthelogicaloppositeofthevalueofBooleanBooleanUnbundle By NamexNotwwwnicomAddthefunctiontotheblockdiagramBundle by NameWiretotheinputClusterinput clusterResizethisfunctiontohavetwoinputterminalsSelectinthefirstnodeandinthesecondnodeIfalabelnameisnotcorrect,usethetooltoselectthecorrectitemNumericBooleanOperatingWiretheoutputofthefunctiontoIncrementNumericWiretheoutputofthefunctiontoNotBooleanWiretheoutputofthefunctiontotheindicatorBundle By NameModified ClusterAddafunctiontoprovidetheprocessorwithtimetocompleteothertaskswaitAddthefunctiontotheblockdiagramWait Until Next ms MultipleRightclicktheterminalofthefunctionmillisecondmultipleWait Until Next ms MultipleSelectfromtheshortcutmenuCreateConstantEnterintheconstantCompletetheblockdiagramandwiretheobjectsasshowninthepreviousfigureSavetheVIDisplaythefrontpanelRuntheVIEnterdifferentvaluesinClusterandnoticehowvaluesenteredinClusteraffecttheModifiedClusterandSmallClusterindicatorsIsthisthebehavioryouexpectedClicktheStopbuttonwhenyouaredoneChangetheclusterorderofModifiedClusterRuntheVIHowdidthechangedorderaffectthebehaviorClosetheVIDonotsavechangesTutorialVideoArrays,Clusters,andTextBasedNodesModulesHomeFIRSTCommunityDownloadsarrayinvestigationviarrayinvpartsolutionviclusterexpsolutionviarrayinvpartsolutionviarrayinvpartsolutionviLegalThistutorial(this"tutorial")wasdevelopedbyNationalInstruments("NI")AlthoughtechnicalsupportofthistutorialmaybemadeavailablebyNationalInstruments,thecontentinthistutorialmaynotbecompletelytestedandverified,andNIdoesnotguaranteeitsqualityinanywayorthatNIwillcontinuetosupportthiscontentwitheachnewrevisionofrelatedproductsanddriversTHISTUTORIALISPROVIDED"ASIS"WITHOUTWARRANTYOFANYKINDANDSUBJECTTOCERTAINRESTRICTIONSASMORESPECIFICALLYSETFORTHINNICOM'STERMSOFUSE()http:nicomlegaltermsofuseunitedstatesus

职业精品

(汽车)产品营销策划书范文.doc

HH牙膏营销方案策划书.doc

加班管理人力资源考勤管理系统方案.doc

物品采购管理制度-正式.doc

用户评论

0/200
    暂无评论
上传我的资料

精彩专题

相关资料换一换

资料评价:

/ 6
所需积分:1 立即下载

意见
反馈

返回
顶部