LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL "pointer to an array of pointers to buffers to contain the appropriate strings"

Hi there,
I'm new to DLL's using LabView.
Now I have to do the settings for the following function:
------------------------------------------------
FT_ListDevices
Get information concerning the devices currently connected. This function can return such information as the number of devices connected, and device strings such as serial number and product description.
FT_STATUS FT_ListDevices ( PVOID pvArg1,PVOID pvArg2, DWORD dwFlags )
Parameters
pvArg1
Meaning depends on dwFlags
pvArg2
Meaning depends on dwFlags
dwFlags
Determines format of returned information
Return Value
FT_OK if successful, otherwise the return value is an FT error code.
Remarks
This function can be us
ed in a number of ways to return different types of information.
It can be used to return device string information for all connected devices. If FT_LIST_ALL bit is set in dwFlags, the parameter pvArg1 is interpreted as a pointer to an array of pointers to buffers to contain the appropriate strings, and the parameter pvArg2 is interpreted as a pointer to a DWORD location to store the number of devices currently connected. Note that, for pvArg1, the last entry in the array of pointers to buffers should be a NULL pointer so the array will contain one more location than the number of devices connected.
------------------------------------------------
I don't know which type of argument I have to choose for this argument: "pointer to an array of pointers to buffers to contain the appropriate strings"

Can anyone help me?

THX a lot!

Greets LabViewFreak
0 Kudos
Message 1 of 4
(3,043 Views)
LabViewFreak wrote:

> I don't know which type of argument I have to choose for this
> argument: "pointer to an array of pointers to buffers to contain the
> appropriate strings"

There isn't any LabVIEW type which can do this. You need to write a
wrapper DLL which translates between LabVIEW types and this DLL types.

There is also no clear way in dealing with that. As it seems does the
DLL actually allocate the string buffers inside the pointer array. If
that is the case then the information you have provided is not enough.
You also need to know how the memory needs to be deallocated afterwards.
There is also no inforamtion as to how the calling application can find
out how large the pointer array should be on entry or how it will see
that the array it pass
ed was to small.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 4
(3,043 Views)
Thanks for your answer!
It seems I have to ask an informatics engineer who can write me such a wrapper DLL, because I can't... 😞

Greets LabViewFreak
0 Kudos
Message 3 of 4
(3,043 Views)
Hi,

I've a library that has some usefull (at least I think so) solutions to
several dll problems:

+ creating a callback dll
+ reserving data so LabVIEW doesn't release it at will
+ getting pointers to this data

And a few others... One of the functions is getting an array of pointers to
string elements in a string array.

If you're interrested, drop me a mail. The code will be available soon on
our website (you should be able to get it from my email, remove capitals).

Regards,

Wiebe.






"LabViewFreak" wrote in message
news:50650000000800000020F00000-1079395200000@exchange.ni.com...
> Hi there,
> I'm new to DLL's using LabView.
> Now I have to do the settings for the following function:
> ------------------------------------------------
> FT_ListDevices
> Get information concerning the devices currently connected. This
> function can return such information as the number of devices
> connected, and device strings such as serial number and product
> description.
> FT_STATUS FT_ListDevices ( PVOID pvArg1,PVOID pvArg2, DWORD dwFlags )
> Parameters
> pvArg1
> Meaning depends on dwFlags
> pvArg2
> Meaning depends on dwFlags
> dwFlags
> Determines format of returned information
> Return Value
> FT_OK if successful, otherwise the return value is an FT error code.
> Remarks
> This function can be used in a number of ways to return different
> types of information.
> It can be used to return device string information for all connected
> devices. If FT_LIST_ALL bit is set in dwFlags, the parameter pvArg1 is
> interpreted as a pointer to an array of pointers to buffers to contain
> the appropriate strings, and the parameter pvArg2 is interpreted as a
> pointer to a DWORD location to store the number of devices currently
> connected. Note that, for pvArg1, the last entry in the array of
> pointers to buffers should be a NULL pointer so the array will contain
> one more location than the number of devices connected.
> ------------------------------------------------
> I don't know which type of argument I have to choose for this
> argument: "pointer to an array of pointers to buffers to contain the
> appropriate strings"
>
> Can anyone help me?
>
> THX a lot!
>
> Greets LabViewFreak
0 Kudos
Message 4 of 4
(3,043 Views)