Showing results for 
Search instead for 
Did you mean: 

Calling a C/C++ dll from LabView (dll has pointers)


I'm new to LabView and was wondering if anyone could help me out or point me to a tutorial on how to pass a LabVIEW cluster to a dll.


my dll has the following struct and i'm trying to populate this in LV, so I've created a LabVIEW cluster that I plan on passing to the DLL so that the DLL can then populate it....



I'm using the Call Library Function Node in LabVIEW to call the "get_board_info" function that is in my dll  (extern "C" short CCONV acq_get_board_info(short count, myStruct_board_info *info);



here is the struct from the dll:




char name[32];

short type;

short irq;

char en_first_gain;

long first_gain_max;

char computer_ctrl;

char pad[3];



the dll also returns an error code of either "success"

I'm not real sure how to pass the LV cluster to the dll





0 Kudos
Message 1 of 2



Below are a few links to KBs providing information on achieving this.  


AE KB 43GBTHSN: Passing an Array of Clusters From LabVIEW to a DLL

AE KB 38LB2BVM: How Do I Pass a NULL Pointer to a DLL?



There is also a DevZone that may also help as well and provides an example.  This example was written in LV 5.0.  So it can only be open in LV from 5.0 - 8.2.  However, if you save it in LV 8.2, you will be able to open it in 8.6.


Using Structures in a DLL with Clusters in LabVIEW



This KB could be helpful for troublshooting.


AE KB 1GRBRNU0: Cannot Access the Members of a Cluster Passed to a Shared Library (DLL)



Take a look at these documents and see if they provide you with enough information.


Mike S
0 Kudos
Message 2 of 2