关闭

关闭

关闭

封号提示

内容

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

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

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

上传者: 寒江雪 2014-02-23 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《labview数组和簇的应用教程pdf》,可适用于IT/计算机领域,主题内容包含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

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/6
1下载券 下载 加入VIP, 送下载券

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部