LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass a void *pointer to a dll in LabView

I did read previous posts on the matter and tried just about everything, inlcuding defining the pointer as a U32 int.

What I am trying to do is program FLASH using WindRiver VisionPROBE EST...

I do have some sucesses... 🐵
I can open a connection to the EST, initialize it, start & stop the target. No problem here..

Here are some additional details:




I can't read memory, write to the target register or program the FLASH, yet. Any advice on how to get further with this? Typically, when doing this using WR's visionClick sw, we need to use a register file which sets up the target. I have not seen any reference to this in their API.

I can convert to CVI if necessary. I am using the dll's from WindRi
ver. I'd prefer keeping everything in LV, but LW-CVI is fine.

My problem is that I am not sure if I am passing void pointers back & forth correctly. For instance, I need to call a function which returns a status, as follows:


status = EST_WriteTargetRegister (long handle, Unsign int register, void * value)


How do I pass the "void * value" to the input of a Call Library FUnction Node. I did try "Adapt to type" which does give a "void * value", and I tried both "Handles by Value" & "Pointers to Handles".

When I change the input value to anything other than "Adpapt To Type", I get a violation error. >:o(

Has anyone successfully automated WindRiver's EST?

- Thanks -

JLV"
Message 1 of 7
(5,838 Views)
Hi,

Have you tried passing a I32, but selecting "Pointer To Value"?

Is there any description about the "void *pointer"? Could it be a callback
function?

Regards,

Wiebe.


"JoeLabView" wrote in message
news:506500000008000000B0AC0000-1066448259000@exchange.ni.com...
> I did read previous posts on the matter and tried just about
> everything, inlcuding defining the pointer as a U32 int.
>
> What I am trying to do is program FLASH using WindRiver VisionPROBE
> EST...
>
> I do have some sucesses... 🐵
> I can open a connection to the EST, initialize it, start & stop the
> target. No problem here..
>
> Here are some additional details:
>
>
>
>
> I can't read memory, write to the target register or program the
> FLASH, yet. Any advice on how to get f
urther with this? Typically,
> when doing this using WR's visionClick sw, we need to use a register
> file which sets up the target. I have not seen any reference to this
> in their API.
>
> I can convert to CVI if necessary. I am using the dll's from
> WindRiver. I'd prefer keeping everything in LV, but LW-CVI is fine.
>
> My problem is that I am not sure if I am passing void pointers back &
> forth correctly. For instance, I need to call a function which
> returns a status, as follows:
>
>
> status = EST_WriteTargetRegister (long handle, Unsign int register,
> void * value)
>
>
> How do I pass the "void * value" to the input of a Call Library
> FUnction Node. I did try "Adapt to type" which does give a "void *
> value", and I tried both "Handles by Value" & "Pointers to Handles".
>
> When I change the input value to anything other than "Adpapt To Type",
> I get a violation error. >:o(
>
> Has anyone successfully automated WindRiver's EST?
>
> - Thanks -
>
> JLV"
0 Kudos
Message 2 of 7
(5,838 Views)
I tried that & it did not work...
I also tried U16 as recommended in the API documentation.... no success :o(

According to the API, "The reason a void pointer is used instead of a particular UINT type variable is because of the variable register sizes..."
Message 3 of 7
(5,838 Views)
I finally got it working

🐵

The trick was to use an array...
Message 4 of 7
(5,838 Views)

Hi All,

 

I have a C based Dll which has 8 functions. One of these function is; 

DLLDIR BOOL  FSUIPC_ReadAndProcess(DWORD dwOffset, DWORD dwSize, void *pDest, DWORD *pdwResult);

 

there is void *pDest variable and I have to pass some value in it and after all calculation I will reach calculated result from pDest again. I instantiated void pointer because I can send kind of type (i.e double, int, unsigned int, char, boolean and etc.)  So I used automatic import wizard of NI and I have imported my dll functions as kinds of VIs. But there is some problem as you can see from the attached image. Automatic importing wizard instantiated the pDest varible as U32, but this is void * so it can be DBL, U16, .. . . . What should I do in Call Library Function Node to accept all kind of variable type to pass as a void pointer to dll.

 

Best Regards.

 

 Umit Uzun

0 Kudos
Message 5 of 7
(5,201 Views)

Hi, Umit. Were you successful?

I'm having a similar problem now. A (black box) dll with lots of functions, many of which have void * x  arguments.

 

I just read this tutorial on C++ and it helped me a lot:

http://www.cplusplus.com/doc/tutorial/pointers/

 

So as you see, the import wizard is right. void * something is an integer. It is a pointer (=address = integer) to something that has no determined size yet. But it is a pointer and as such a number.

 

I'll let you know if I succeed.

Message 6 of 7
(5,075 Views)

Hi Javier;

 

Unfortunately I hadn't found any solution about void* and then achieve this operation using same VI in receiving different 

type of variable 😞 I know this is not sufficient but it have resolved my problem temproraly. If you would achieve please let

 me know.

 

Regards. 

0 Kudos
Message 7 of 7
(5,063 Views)