LabVIEW中的动态连接库调用

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

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

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

资源描述

:2006-12-10:(1963-),,,.E2mail:gohigh@sh163.netLabVIEW,(,200092):LabVIEWWin32,,LabVIEW,LabVIEW.:;LabVIEW;:TP313:A:1672-5581(2007)01-0122-05LabVIEW2baseddynamiclinklibrarycallZHAOJiong,LIULi2ping(SchoolofMechanicalEngineering,TongjiUniversity,Shanghai200092,China)Abstract:Anovelmethodofdynamiclinklibrary(DLL)callisdevelopedbasedonLabVIEWTM.Byprovid2ingdemonstrations,thelinkagebetweenLabVIEWTMandtheexternalcodesisdescribed.ItcanbefoundthatthesystemdevelopmentfunctionalityofLabVIEWTMhasbeenenhanced.Keywords:virtualinstrument;LabVIEW;dynamiclinklibrary(DLL)LabVIEW(LaboratoryVirtualInstrumentEngineering).GPIB,VXI,RS2232RS2485,.1LabVIEWLabVIEW,,.NILabVIEW,.,LabVIEW,,LabVIEW(CallLibraryFunctionNode,CLFN)(CodeInterfaceNode,CIN),CLab2VIEWG.,,LabVIEWCIN,C,.lsb,LabVIEWCIN,(VI),.,.CLFN,LabVIEW(DLL).DLLWindows,,.DLL,DLLCIN,LabVIEW,CIN.5120071CHINESEJOURNALOFCONSTRUCTIONMACHINERYVol.5No.1Jan.2007©1994-2007ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.[1,2]LabVIEW(VisualC++,VisualBasic).,Lab2VIEW:,;;.1,2.DLLs:DLLs.DLL,USER.32,,DLL,LabVIEW.DLL,,,LabVIEW.1Tab.1ClassificationandmatchingofthecharacterstringparametersLabVIEWCCstringPointerunsignedchar30PascalPointerunsignedchar3,255LabVIEWStringHandle:LStrPtrtypedefstruct{int32;unsignedcharstr[1];}cnt,str[0],1,DLLLabVIEWStringHandlePointerLStrHandleLStr,3LStrPtr,33LStrHandle;2(2)Tab.2TransmissionofthearrayparametersLabWIEWCArrayDataPointerint3arrayPointer,ArrayHandle:unsignedchar3,255LabVIEWStringHandle:LStrPtrArrayHandlePointertypedefstruct{int32dimSize[2];float32Numeric[1];}TD2,33TD2Hdl;typedefTD2;33TD2HdlPtrdimSize[0],dimSize[1],Numeric[0],ArrayHandle3LabVIEWWin32[3]WindowsXPUSER32.DLLMessageBox,.Lab2VIEWDLL(CallLibraryFunction,CLF).1.MessageBoxWindowsUSER32.DLL,Windows.MessageBox:intMessageBox(HWNDhWnd,//LPCTSTRlpText,//3211,:LabVIEW©1994-2007ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.);,int,Message2Box,hWnd,lpText,lpCaption,uType.32.:(1)HWNDhWnd:,,.hWnd.Windows32.(2)LPCTSRlpText:.LPCTSR32,WindowsC2style.(3)LPCTSRlpCaption:,.WindowsC2style.3Tab.3RelationdiagramOK1CANCEL2ABORT3RETRY4IGNORE5YES6NO7(4)UNITuType:,.UNIT32.,,.3:,LabVIEWUSER32.DLLMessageBoxVI.CallLibraryFunction,CallLibraryFunction,:CLFMessageBoxUSER32.DLL,C:\Windows\System\USER32.DLL.,CallingConventions.,FunctionNameMessageBoxA,RunInVIThread.CallingConventionsstdcall.MessageBox2Fig.2Figurationdiagram,,ParemeterType,returntype,typevoid,Mes2sageBox32.TypeNumeric,DataTypeUnSigned32$bitInteger.,MessageBoxhWnd,AddParameterAfter.DataTypeUnSigned32$bitInteger.Pass,.,PassC2style.2.LabVIEW3.4215©1994-2007ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.(MPC03A),HXB,PXI26225,LabVIEW,,.MPC03A,,.:typedefstruct{int32dimSize;uInt8Numeric[1];}TD2,33TD2Hdl;typedefstruct{int32dimSize;float32Numeric[1];}TD3,33TD3Hdl;externCint8LocatePackage(unsignedchar3,int163);externCint8Protocol(unsignedchar3,int163,TD13);int8LocatePackage(unsignedchar3string,int163length){int8err;for(i=0;i3length2PackageLength;i++)}int8Protocol(unsignedchar3string,int163length,TD23output){int32i,j,k;float32temp;if(3lengthPackageLength32)return0;5211,:LabVIEW©1994-2007ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.}.DLL(C++3.def):DESCRIPTIONfunctionsusedtoexplaintheserialcommunicationprotocolEXPORTS;ExplicitexportscangohereLocatePackage@1Protocol@2,sample.@1DLL,.4LabVIEWFig.4LabVIEWprogram,,,,DLL,Lab2VIEW.,,WaveformGraph.4.,LabVIEW,,Windows,,,LabVIEWWindows.4LabVIEWLabVIEW,LabVIEWG,.,,LabVIEW.:[1].LabVIEW[M].:,2003.YANGLeping.LabVIEWadvancedprogramming[M].Bejing:TsinghuaUniversityPress,2003.[2].LabVIEW7.1[M].:,2005.HOUGuoping.LabWIEW7.1programingandvirtualinstrumentdesign[M].Beijing:TsinghuaUniversityPress,2005.[3],.LabVIEWWin32(DLLs)[J].,2000,20(6):72-73.TAOYizheng,PANZhenxian.HowtocallWin32dynamiclinklibraryfromLabVIEW[J].ComputerApplication,2000,20(6):72-73.6215©1994-2007ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.

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

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

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

×
保存成功