LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Dll with Pointer of struct

Hi,
I would like use the following C-Code with Labview ( Dll function )

void function(*struct_pointer); // DLL FUNCTION

struct my_struct {
int a;
short b;
short c;
double *d;
double *e;
};

struct my_struct *struct_pointer;

function(&struct_pointer);

does anyone know how can I build the same struct with Labview??
Thanks
0 Kudos
Message 1 of 3
(3,279 Views)
Not at work and don't have LV here but, this should get you going. What you want to do is define a cluster that matches up the the structure you need.

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=5065000000080000009D3A0000&ECategory=LabVIEW.LabVIEW+General


Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(3,279 Views)
The previously mentioned Developer Zone discussion is an excellent source of information for such an application as yours. In addition, I will give you a number of other sources to reference.

First of all, there is a National Instruments Knowledge Base entitled Using LabVIEW, How Do I Control My Instrument that requires DLL functions that use pointers to compl... This very closely matches your questions. As it discusses, you will want to use LabVIEW clusters as the parameters you pass to the Call Library Function VI.

In addition, there is a Developer Zone discussion entitled Passing a Variety of Data Types from DLL to LabVIEW This discusses how to read the structures into LabVIEW from a DLL. These resources should help you get started building your application. Accessing DLLs in LabVIEW can be difficult at first, but once you have practiced it, it becomes much clearer and easier to do.
J.R. Allen
Message 3 of 3
(3,279 Views)