Pointer to pointer with LabVIEW 4.1? 
Author Message
 Pointer to pointer with LabVIEW 4.1?

Hi there!

If I have a pointer to a data structure, how can I make labview 4.1 read
data from that memory address?

The situation is that I'd like to call the CAPI_GET_MESSAGE function in
the capi2032.dll via the "Call Library Function" node. The function
prototype is

  DWORD APIENTRY CAPI_GET_MESSAGE( DWORD AppID, PVOID* ppCAPIMessage );

where DWORD = unsigned 32-bit integer,
PVOID = pointer to any memory location.

So the second argument needs to be a pointer to a pointer, that is the
function expects a pointer to the memory location where CAPI should
place
the pointer to the retreived message.

Now LabVIEW does not have a pointer data type, but since a pointer is
nothing but an unsigned 32-bit integer, I could replace "PVOID*" by
"UInt32*".

So I can call the function, but how do I handle the returned address
afterwards?

Regards,
Carsten.



Thu, 26 Jul 2001 03:00:00 GMT  
 Pointer to pointer with LabVIEW 4.1?
Hi Carsten,

I am fighting with the same kind of problem, so I know just a partial answer
to your question. Note that I am using LabVIEW 5.0. The problem with the
double pointer is that LabVIEW allows you to read only byte or 16 bit word,
so there is no way to read 32 bit word. The thing works if you define the
parameter type as ARRAY  and the array format as ARRAY HANDLE. The problem
is that I can't pass the array length, so it returns one billion elements (I
think it fills up the buffer allocated for the LabVIEW) and blows the
memory. On my machine it works only in "Highlight execution" mode (I
truncate the array to the length I need), on the other machine it works fine
in normal mode...
 Next I am going to try to pass the length of the array parameter somehow.
Remember that the order of the parameters in "Call Function" from top to the
bottom does matter. It has to be the same as the order in C code.

Good luck and please let me know if you find the solution.
Alex.

Quote:

> Hi there!

> If I have a pointer to a data structure, how can I make LabVIEW 4.1 read
> data from that memory address?

> The situation is that I'd like to call the CAPI_GET_MESSAGE function in
> the capi2032.dll via the "Call Library Function" node. The function
> prototype is

>   DWORD APIENTRY CAPI_GET_MESSAGE( DWORD AppID, PVOID* ppCAPIMessage );

> where DWORD = unsigned 32-bit integer,
> PVOID = pointer to any memory location.

> So the second argument needs to be a pointer to a pointer, that is the
> function expects a pointer to the memory location where CAPI should
> place
> the pointer to the retreived message.

> Now LabVIEW does not have a pointer data type, but since a pointer is
> nothing but an unsigned 32-bit integer, I could replace "PVOID*" by
> "UInt32*".

> So I can call the function, but how do I handle the returned address
> afterwards?

> Regards,
> Carsten.



Mon, 06 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ISO C Binding: Pointer to a pointer of pointers: ***argv

2. Pointer to functions in Digital Fortran 4.1, how?

3. Pointers to pointers possible?

4. A pointer to an array of pointers

5. pointers and pointers.

6. Returning Pointer To Pointer From Function

7. Implementing pointers to pointers in Ada

8. pointer to pointer to field / dynamic field

9. A couple of simple pointer questions (targets, arrays of pointers)

10. Deallocation of a pointer which points to a type containing allocated pointers

11. fortran 90/95 pointers vs C pointers

12. pointers to pointers

 

 
Powered by phpBB® Forum Software