LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to make a call to a dll to have labview return a buffer filled with data stored in an array. The proble

m that I am having is that to do this I need to fill two different structures, one containing a pointer to a double, which I don't think I can do without perhaps a wrapper function. The biggest problem is that I don't know how to even go about doing this.I have two structures that I need to fill in order to read a block of data from a given DLL which are

typedef struct CHBL_ORDER_T {
INT32 lBlock; // block number, set by user (typical 0)
INT16 sChan; // channel number, set by user
UINT16 usFlags; // only DATA_1OFN at the moment
INT32 lChSR; // channel sampling rate, returned by open
INT32 lFirstMP; // BSR MP not greater than "open sta
rt"
INT32 lBuffLen; // required CHSR based buffer size
INT32 lIncr; // distance between two buffered values
UINT16 usMask; // Mask used before Shift
INT8 chShift; // number of right shifts
} CHBL_ORDER, *PCHBL_ORDER;

typedef struct CHBL_FETCH_T {
double *pdblMin; // min or 1 of n array
double *pdblMax; // max array (either solo or along with MINMAX
INT32 lPos; // (set by user), returned by fetch
INT32 lNum; // (set by user), returned by fetch
} CHBL_FETCH, *PCHBL_FETCH;

I am trying to do the data block access with labview on page 18 of the attached pdf document.

I also have a c code exapmle attached in the zip file, the function in c i am trying to do is in Sample2Dlg.cpp
if anyone can help me out I would greatly appreciate it.
Download All
0 Kudos
Message 1 of 2
(2,783 Views)
m that I am having is that to do this I need to fill two different structures, one containing a pointer to a double, which I don't think I can do without perhaps a wrapper function. The biggest problem is that I don't know how to even go about doing this.I believe you are right about needing to create a wrapper DLL. To do this, just create a DLL which includes a function that accepts a double. Then, it uses this to make a pointer to that double and send it to your original DLL. When that function returns, you return this info to LabVIEW in form of a regular double. Basically, there is just one more layer of code which you use for translation between LabVIEW and the DLL you are currently using. You need to create that layer.
J.R. Allen
0 Kudos
Message 2 of 2
(2,783 Views)