LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call C/C++ DLL with structures in the parameter from labview 8.0

Hi, In my C code DLL. I have interface: GetQbidDataFromOracle(char *config_file, char *serial_number, ORACLE_API_QBID_DATA *qbid_data);
Which ORACLE_API_QBID_DATA is a structure as below:
struct OracleQbidData
{
  char pwa_sn[CIMSVR_STRLEN+1];
  char unit_sn[CIMSVR_STRLEN+1];
  char product_code[CIMSVR_STRLEN+1];
  char clei_code[CIMSVR_STRLEN+1];
  char part_num[CIMSVR_STRLEN+1];
  char hw_ver[CIMSVR_STRLEN+1];
  char model_type[CIMSVR_STRLEN+1];
  char bom_rev[CIMSVR_STRLEN+1];
  char mac_addr[CIMSVR_STRLEN+1];
  char num_mac[CIMSVR_STRLEN+1];
  char fsan_num[CIMSVR_STRLEN+1];
};
 
How can I call this from Labview? How do I specify the type?
0 Kudos
Message 1 of 2
(2,671 Views)

Hi JoyWang,

In order to use a DLL in LabVIEW you will need to use the call Library Function Node.vi to load the dll.  You can pass the structure as a cluster but you will have to make sure the elements inside map to the proper data types in LabVIEW.  This KnowledgeBase walks through how to pass a cluster to a dll from LabVIEW.  I hope this helps you out.

Regards,

Michael
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(2,642 Views)