Hello to eveyone. I am trying to write a MATLAB code able to use the DLL library of WaveVision5 from Texas Instruments, in order to control my ADC Development board. I am just trying now to call a function from the DLL, in order to see if the library is up and working.
Of course there is a little bit to have a look at what kind of data I will need, for example the function which I am trying to call is taking in input some kind of data defined inside the library header.
Now my function is taking in input: * A pointer to a ulong (which on my MATLAB should be a int32) * A pointer to a null terminated string * A pointer to a structure composed by four ulong.
typedef struct { /** Major */ WvWord Major; /** Minor */ WvWord Minor; /** Release */ WvWord Release; /** Build */ WvWord Build; } WvVersionNumber;
Now the problem is that I have created the first two pointers without problems, but it seems like I am not able to create a pointer to a structure containing more than 3 elements, for instance:
sm = struct('p1', int32(0), 'p2', int32(0), 'p3', int32(0), 'p4', int32(0));sp = libpointer('c_struct',sm);
I receive the followind error:
A field does not match one in the struct.Error in libpointer (line 18) ptr=lib.pointer(varargin{:});Error in ADC_test (line 34)sp = libpointer('c_struct',sm);
Instead if I just get rid of one of those fields inside the structure, everything looks fine.
I suppose that using c_struct is not the best way to do this, how can I create the wanted pointer? Any ideas?
Best Regards, Giovanni
Best Answer