NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Use of type libraries and custom data types in TestStand 3.1

Consider the following example in CVI 7.0:

#include <cvidef.h>

typedef struct
{
    int                         t_err;
    unsigned int                err_flags;
    int                         err_code;
    char                        err_msg[1024];
} TEST_ERROR;


int DLLEXPORT DLLSTDCALL   NfctConnect  (int iPortType, int iComPort, int iBaudRate, TEST_ERROR * tstError);

I want to call this function from TestStand 3.1 using the CVI Standard Adapter.

I created a function panel from the header file then I generated a DLL that contains the type library as an embedded resource. Using OLE/COM object viewer I can confirm that the definitions are correct. In TestStand however, all basic types are recognized but the structure is rejected as not being a TestStand type.

However, a C structure is supposed to be assimilated as a container in TestStand. Do I have to manually create a custom data type in TestStand to match my C structure or TestStand can automatically create the container based on the information in the type library (because this information is available it won't be difficult for TestStand to do this automatically)?


 

0 Kudos
Message 1 of 2
(2,743 Views)
Hi Spoli,

At the current time the only adapter that gives you the option to automatically create a container for a given parameter is the LabVIEW adapter. In your case you will need to manually create the container that matches your C struct. I apologize for the inconvenience.

One thing you can do to see this feature in future versions is make a Product Suggestion on our website. Our R&D engineers are always looking for good feedback.

Have a good one Spoli,

Dan Weiland
Applications Engineer
National Instruments
Dan Weiland
0 Kudos
Message 2 of 2
(2,725 Views)