LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call library function

I'm trying to use the call library function to call a Windows DLL
function. (specifically RtlMoveMemory in kernel32.dll). This function
basically operates like memcpy. It copies from one memory location to
another. This function needs a pointer to the destination, a pointer to
the source and a size argument. I have the address for the source in a
control in my VI so I pass that by value.

My question is...How do i tell the function that the destination is an
indicator/control on my VI? How can I pass a pointer to a
control/indicator on my VI? I have tried wiring a control to the Call
Library input for the destination argument with the Pass Value and Pass
Pointer to Value. Neither of these have worked.

If this is all confu
sing and makes no sense, here is a simple
explanation of what I am trying to do:
Copy data from a known address in memory to a control/indicator on my
VI.

Thanks,
Stephen
0 Kudos
Message 1 of 4
(3,256 Views)
Stephen Gray wrote:

> I'm trying to use the call library function to call a Windows DLL
> function. (specifically RtlMoveMemory in kernel32.dll). This function
> basically operates like memcpy. It copies from one memory location to
> another. This function needs a pointer to the destination, a pointer to
> the source and a size argument. I have the address for the source in a
> control in my VI so I pass that by value.
>
> My question is...How do i tell the function that the destination is an
> indicator/control on my VI? How can I pass a pointer to a
> control/indicator on my VI? I have tried wiring a control to the Call
> Library input for the destination argument with the Pass Value and Pass
> Pointer to Value. Neither of these have worked.
>
>
If this is all confusing and makes no sense, here is a simple
> explanation of what I am trying to do:
> Copy data from a known address in memory to a control/indicator on my
> VI.
>
> Thanks,
> Stephen

These things described in Code reference manual. Basically you'll have
to write CIN wrapper to make it, because LV uses it's own memory manager
functions.

I'd recommend to find another way to copy your data from one block of
memory to another. E.g. passing memory handle and it's size to LV memory
manager function, copy it to another place and assign LV string handle
to it.

--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
sergey_acs@levsha.ru
http://acs.levsha.ru
0 Kudos
Message 2 of 4
(3,256 Views)
Stephen,

Let say you have a string. So the output of the DLL is a pointer to the
string. In the Call Library you can select the output as a pointer to string
(the output will change into a string!). Now you can just wire the output
(sting) to a string indicator. If you want to place the text (on the
location of the pointer to the sting) in a control, use a local variable of
the control.

Same applies to arrays.

Hope this helpes,

Wiebe Walstra.


--
AIR technical Automation
www.air.nl


"Stephen Gray" wrote in message
news:3A4B7425.A7BC07EF@swri.org...
I'm trying to use the call library function to call a Windows DLL
function. (specifically RtlMoveMemory in kernel32.dll). This function
basically operates like memcpy. It copies from one memo
ry location to
another. This function needs a pointer to the destination, a pointer to
the source and a size argument. I have the address for the source in a
control in my VI so I pass that by value.

My question is...How do i tell the function that the destination is an
indicator/control on my VI? How can I pass a pointer to a
control/indicator on my VI? I have tried wiring a control to the Call
Library input for the destination argument with the Pass Value and Pass
Pointer to Value. Neither of these have worked.

If this is all confusing and makes no sense, here is a simple
explanation of what I am trying to do:
Copy data from a known address in memory to a control/indicator on my
VI.

Thanks,
Stephen
0 Kudos
Message 3 of 4
(3,256 Views)
....
> If this is all confusing and makes no sense, here is a simple
> explanation of what I am trying to do:
> Copy data from a known address in memory to a control/indicator on my
> VI.

You won't be able to copy the data directly to a control or indicator
since you can't get the address to where they are stored. You can send
in a pointer to the right data type and wire the result to the indicator.

Greg McKaskle
0 Kudos
Message 4 of 4
(3,256 Views)