您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > Teststand基础教程
©NationalInstrumentsCorporation5-1TestStandI:IntroductionCourseManualLesson5CreatingCodeModulesinExternalEnvironmentsIntroductionThislessondescribeshowtocreatecodemodulesinexternalenvironmentsforuseinTestStandandhowdataistransferredfromTestStandtootherenvironments.ThislessonalsodescribestheLabVIEWandLabWindows/CVItestdevelopmentenvironments,howtopassdatatoTestStandfromtheseenvironments,andhowtodebugthesecodemodulesdirectlyfromTestStand.Lesson5:CreatingCodeModulesinExternalEnvironmentsInthislesson,youwilllearn:HowdataispassedbetweenTestStandandexternalcodemodulesTocreatecodemodulesinLabVIEWandLabWindows/CVITodebuganexternalLabVIEWorLabWindows/CVIcodemodulefromTestStandTomodifycodetemplatesLesson5CreatingCodeModulesinExternalEnvironmentsTestStandI:IntroductionCourseManual5-2ni.comCreatingCodeModulesinExternalEnvironments(Continued)TestStandisaflexibletestingenvironmentthatcancalltestswritteninawidevarietyoflanguages.TestStandcancallanycodemoduletypeforwhichithasanadapter.TheadapterisaninterfacethatallowstheTestStandEnginetoexecuteacodemoduleand,insomecases,communicatewithaspecificprogramminglanguageorfileformat.TestStandincludesadaptersforLabVIEW,LabWindows/CVI,DLLs,.NETAssemblies,ActiveX/COMautomationservers,HTBasicsubroutines,andTestStandsequences.Additionally,youcancallWindowsexecutable(.exe)filesusingabuilt-insteptype.CreatingCodeModulesinExternalEnvironments(Continued)Youcancreatetestsin:LabVIEWLabWindows/CVIAnyenvironmentcapableofcreatingaDLL,EXE,ActiveXautomationserver,orsubroutineEachtypeofcodemoduleusesadifferentadapterwhichactsto:ExecutecodemodulesStepintocodemodulesGeneratecodemodulesusingtemplatesLesson5CreatingCodeModulesinExternalEnvironments©NationalInstrumentsCorporation5-3TestStandI:IntroductionCourseManualDataTransferinTestStandTherearetwowaystopassdatabetweenanexternalcodemoduleandTestStand:PassinganarbitrarynumberofparametersusingtheLabVIEWAdapter,LabWindows/CVIAdapter,C/C++DLLAdapter,.NETAdapter,ActiveX/COMAdapter,orSequenceAdapter.UsingtheTestStandActiveXAutomationAPI.DataTransferinTestStandPassdatafromanexternalcodemoduletoTestStandinoneofthefollowingways:PassanarbitrarynumberofparametersUsetheTestStandActiveXAutomationAPILesson5CreatingCodeModulesinExternalEnvironmentsTestStandI:IntroductionCourseManual5-4ni.comMethod1—PassingParametersDirectlyTheLabVIEW,LabWindows/CVI,C/C++DLL,.NET,ActiveX/COM,andSequenceAdapterscanspecifyatypeandarbitrarynumberofparametersthatshouldbepassedfromthecodemodulebacktoTestStand.ParameterspassthedataamongcodemodulesandTestStand.Method1PassingParametersDirectlyLabVIEWAdapterLabWindows/CVIAdapterC/C++DLLAdapter.NETAdapterActiveX/COMAdapterSequenceAdapterCodeModuleTestStandEngineData1Data2DataSpaceData1Data2DataSpaceLesson5CreatingCodeModulesinExternalEnvironments©NationalInstrumentsCorporation5-5TestStandI:IntroductionCourseManualPassingParameters–LabVIEWTestStand3.0allowsuserstocallanarbitraryVIandpassTestStanddatadirectlythroughtheterminalsontheVIconnectorpane.TestStandautomaticallyloadstheVIicon,connectorpaneinformation,andanyVIhelpintotheSpecifyModuledialogboxsoyoucanseeexactlywhatparameterstheLabVIEWVIexpectsandpasstheappropriatevalues.NoteYoumusthaveLabVIEW7.0orlaterinstalledtousemanyoftheTestStand3.0LabVIEWAdapterfeatures.PassingParameters-LabVIEWLesson5CreatingCodeModulesinExternalEnvironmentsTestStandI:IntroductionCourseManual5-6ni.comPassingParameters–LabVIEWAdvancedSettingsClicktheAdvancedSettingsbuttonontheEditLabVIEWVICalldialogboxtoconfigureTestStandforremoteexecution.Usingahostname,ausercanspecifyaparticularmachinetoexecutetheVI.TheremotehostcanbeanotherPCoraReal-TimeModuletarget.PassingParametersLabVIEWAdvancedSettingsLesson5CreatingCodeModulesinExternalEnvironments©NationalInstrumentsCorporation5-7TestStandI:IntroductionCourseManualPassingParameters–LabWindows/CVITheLabWindows/CVIAdapterallowsyoutocalldifferentkindsofCVImodules,forexampleDLL,object,source,andstaticlibrary,andprovidestheabilitytostepintoCVIcodedirectlyfromTestStand.UsingtheLabWindows/CVIAdapter,youcancallfunctionswithuserdefinedfunctionprototypes.TheLabWindows/CVIAdapterallowsyoutopassavarietyofdatatypesfromTestStandtoLabWindows/CVI.PassingParametersLabWindows/CVILesson5CreatingCodeModulesinExternalEnvironmentsTestStandI:IntroductionCourseManual5-8ni.comRefertopage5-26forinstructionsforExercise5-1A.Refertopage5-39forinstructionsforExercise5-1B.Exercise5-1Aor5-1BExercise5-1A:CreatingNumericLimitTestswithLabVIEWExercise5-1B:CreatingNumericLimitTestswithLabWindows/CVIObjective:TocreateaNumericLimitTestusingLabVIEWorLabWindows/CVIandpassthetestresultstoaTestStandstep.EstimatedTime:15minutesLesson5CreatingCodeModulesinExternalEnvironments©NationalInstrumentsCorporation5-9TestStandI:IntroductionCourseManualRefertopage5-46forinstructionsforExercise5-2A.Refertopage5-49forinstructionsforExercise5-2B.Exercise5-2Aor5-2BExercise5-2A:DebuggingTestsUsingLabVIEWExercise5-2B:DebuggingTestsUsingLabWindows/CVIObjective:TodebugcodemodulescompiledwithLabVIEWorLabWindows/CVI
本文标题:Teststand基础教程
链接地址:https://www.777doc.com/doc-4792948 .html