- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
LabVIEW string/array Type
录入:edatop.com 点击:
LabVIEW CLN调用dll时,接口只能是c99的类型,不可以使用c++的string类型。 int32 len; LStrHandle elm[1]; int arraySize = (*strArray)->len; LStrHandle h = (*strArray)->elm[0]; int curStrSize = LStrLen(*h); char *curStr = ( char *)LStrBuf(*h); int len = strlen(curStr);
——————————————————————————————————————————————

例子如下:

LabVIEW有其定义的string类型: LStrHandle。
————————————————————————————————————————————————————--------------------------------------------------------------------------------------------
C++的code如下:
#include "extcode.h"
// "extcode.h" 的路径是在C:Program FilesNational InstrumentsLabVIEW 2009cintools 里面。如果想用到extcode里面的一些函数,需要链接库labview.lib
typedef struct {
} **LStrArrHd1;
extern "C" _declspec (dllexport ) void strArrayTest(LStrArrHd1 strArray);
void strArrayTest(LStrArrHd1 strArray)
{
}
dll的parameter属性如下:

——————————————————————————————————————————————
Labview具体的string、array类型如下:


例子如下:


上一篇:labview实现PC与单片机之间的串口通信
下一篇:labview做上位机