Teststand基础教程

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

©NationalInstrumentsCorporation5-1TestStandI:IntroductionCourseManualLesson5CreatingCodeModulesinExternalEnvironmentsIntroductionThislessondescribeshowtocreatecodemodulesinexternalenvironmentsforuseinTestStandandhowdataistransferredfromTestStandtootherenvironments.ThislessonalsodescribestheLabVIEWandLabWindows/CVItestdevelopmentenvironments,howtopassdatatoTestStandfromtheseenvironments,andhowtodebugthesecodemodulesdirectlyfromTestStand.Lesson5:CreatingCodeModulesinExternalEnvironmentsInthislesson,youwilllearn:•HowdataispassedbetweenTestStandandexternalcodemodules•TocreatecodemodulesinLabVIEWandLabWindows/CVI•TodebuganexternalLabVIEWorLabWindows/CVIcodemodulefromTestStand•TomodifycodetemplatesLesson5CreatingCodeModulesinExternalEnvironmentsTestStandI: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:•LabVIEW•LabWindows/CVI•AnyenvironmentcapableofcreatingaDLL,EXE,ActiveXautomationserver,orsubroutineEachtypeofcodemoduleusesadifferentadapterwhichactsto:•Executecodemodules•Stepintocodemodules•GeneratecodemodulesusingtemplatesLesson5CreatingCodeModulesinExternalEnvironments©NationalInstrumentsCorporation5-3TestStandI:IntroductionCourseManualDataTransferinTestStandTherearetwowaystopassdatabetweenanexternalcodemoduleandTestStand:PassinganarbitrarynumberofparametersusingtheLabVIEWAdapter,LabWindows/CVIAdapter,C/C++DLLAdapter,.NETAdapter,ActiveX/COMAdapter,orSequenceAdapter.UsingtheTestStandActiveXAutomationAPI.DataTransferinTestStandPassdatafromanexternalcodemoduletoTestStandinoneofthefollowingways:•Passanarbitrarynumberofparameters•UsetheTestStandActiveXAutomationAPILesson5CreatingCodeModulesinExternalEnvironmentsTestStandI:IntroductionCourseManual5-4ni.comMethod1—PassingParametersDirectlyTheLabVIEW,LabWindows/CVI,C/C++DLL,.NET,ActiveX/COM,andSequenceAdapterscanspecifyatypeandarbitrarynumberofparametersthatshouldbepassedfromthecodemodulebacktoTestStand.ParameterspassthedataamongcodemodulesandTestStand.Method1—PassingParametersDirectly•LabVIEWAdapter•LabWindows/CVIAdapter•C/C++DLLAdapter•.NETAdapter•ActiveX/COMAdapter•SequenceAdapterCodeModuleTestStandEngineData1Data2DataSpaceData1Data2DataSpaceLesson5CreatingCodeModulesinExternalEnvironments©NationalInstrumentsCorporation5-5TestStandI:IntroductionCourseManualPassingParameters–LabVIEWTestStand3.0allowsuserstocallanarbitraryVIandpassTestStanddatadirectlythroughtheterminalsontheVIconnectorpane.TestStandautomaticallyloadstheVIicon,connectorpaneinformation,andanyVIhelpintotheSpecifyModuledialogboxsoyoucanseeexactlywhatparameterstheLabVIEWVIexpectsandpasstheappropriatevalues.NoteYoumusthaveLabVIEW7.0orlaterinstalledtousemanyoftheTestStand3.0LabVIEWAdapterfeatures.PassingParameters-LabVIEWLesson5CreatingCodeModulesinExternalEnvironmentsTestStandI:IntroductionCourseManual5-6ni.comPassingParameters–LabVIEWAdvancedSettingsClicktheAdvancedSettingsbuttonontheEditLabVIEWVICalldialogboxtoconfigureTestStandforremoteexecution.Usingahostname,ausercanspecifyaparticularmachinetoexecutetheVI.TheremotehostcanbeanotherPCoraReal-TimeModuletarget.PassingParameters–LabVIEWAdvancedSettingsLesson5CreatingCodeModulesinExternalEnvironments©NationalInstrumentsCorporation5-7TestStandI:IntroductionCourseManualPassingParameters–LabWindows/CVITheLabWindows/CVIAdapterallowsyoutocalldifferentkindsofCVImodules,forexampleDLL,object,source,andstaticlibrary,andprovidestheabilitytostepintoCVIcodedirectlyfromTestStand.UsingtheLabWindows/CVIAdapter,youcancallfunctionswithuserdefinedfunctionprototypes.TheLabWindows/CVIAdapterallowsyoutopassavarietyofdatatypesfromTestStandtoLabWindows/CVI.PassingParameters–LabWindows/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

1 / 70
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功