LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use pointer to read float value

Hi
I'm working with LV's "call library function"-vi to communicate with an external positioning stage. To read the actual position the corresponding function returns a pointer instead of the needed value. (LV returns a integer number which is suppoed to be a pointer to a float value (position))

My question: how can I read (from LabView) the actual float value if I have it's pointer (integer)?
0 Kudos
Message 1 of 3
(3,058 Views)
> I'm working with LV's "call library function"-vi to communicate with
> an external positioning stage. To read the actual position the
> corresponding function returns a pointer instead of the needed value.
> (LV returns a integer number which is suppoed to be a pointer to a
> float value (position))
>
> My question: how can I read (from LabView) the actual float value if I
> have it's pointer (integer)?

Without the function prototype and information about how you have
configured the DLL node, all I can do is make some guesses.

I'm assuming that the prototype is something like
int GetPosition(float *x, float *y);

If you configure the LV DLL dialog to pass the first and second
parameters by Point to Value instead of by Value, it will allocate some
storag
e for the DLL to write into, it will pass in whatever value you
wire to the left, the DLL can overwrite it, and return to you the float
value.

Be sure if you post again to be very specific about the types and
include more information about the DLL you are calling.

Greg McKaskle
0 Kudos
Message 2 of 3
(3,058 Views)
thanks for the answer, I'll try to be a little more specific:

The function I call is indeed of the form (only one position value):
BOOL TellPosition(float *pfPosition)

(The DLL I'm using is from the manufacturer and contains all C functions needed to communicate with the positioning stage)

According to the manual the function is supposed to return a pointer (pfPosition) to the float value, where the position is written.

I'm using a DLL node with one input/output argument. (the input argument is not connected) I set the argument type to numeric (Int32). If I pass a "pointer to value" I get a integer number in the range of 1E9. If I pass a "value" the vi produces an error.

I assume that the number I get is a pointer to the actual float value I'm
interested in (which should be a number between 1-25). So the question is how can I read this float value from LV if I know its pointer.

your help is highly appreciated...
0 Kudos
Message 3 of 3
(3,058 Views)