Labview调用DLL的时候,输入参数为一个结构体(簇),但结构体中还包含有结构体(簇),可以这样做吗?

2025-06-28 08:56:43
推荐回答(1个)
回答1:

应该是可以的。

之前做过将DLL中的结构体中的结构体输出到LabVIEW中(就是簇中嵌套簇的格式)的实际案例,如下所示,但没做过用簇中嵌套簇做输入的例子。

loadmeter   [ out ]

Specify the pointer to the array of ODBSVLOAD structure to store the servo
load meter data. The number of array must be equal to "*data_num". The ODBSVLOAD
structure is as follows.

typedef struct odbsvload {
    LOADELM     svload;     /* servo load meter data */
} ODBSVLOAD ;

svload

The LOADELM structure for servo load meter data.

And the LOADELM structure is as follows.

typedef struct loadelm {
    long    data;    /* load meter data */
    short   dec;     /* place of decimal point */
    short   unit;    /* unit */
    char    name;    /* axis name */
    char    suff1;   /* subscript of axis name 1 */
    char    suff2;   /* subscript of axis name 2 */
    char    reserve; /* */
} LOADELM;