LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass a value from a dll to labview

Hello everybody!
I have to pass a value from a dll to labview.
I can pass a value but it's wrong:
I have to mesure a voltage from a device which is build by my society. When I use my CVI software, the function I use return a good value (verify whith a multymeter).
I use this CVI code to build my dll and I want to have this value under labview. there is no problem to pass value from labview to function of my dll but in the other way it's wrong...

can you help me please.
I am sorry for my english.
0 Kudos
Message 1 of 5
(2,780 Views)
/*draven*/ wrote:

> Hello everybody!
> I have to pass a value from a dll to labview.
> I can pass a value but it's wrong:
> I have to mesure a voltage from a device which is build by my society.
> When I use my CVI software, the function I use return a good value
> (verify whith a multymeter).
> I use this CVI code to build my dll and I want to have this value
> under labview. there is no problem to pass value from labview to
> function of my dll but in the other way it's wrong...

Are you defining that value as a pointer to your datatype? That is the
only way you can pass data back from a function to its caller in the
parameter list.
Then you have to make sure to configure the CLN to use the right numeric
datatype and select to pass that value by reference (as
a pointer) so
LabVIEW creates a pointer to the actual data storage location to be
passed to the DLL so that the DLL can fill in that location.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 5
(2,780 Views)
rolfk wrote:
'Are you defining that value as a pointer to your datatype? That is the
only way you can pass data back from a function to its caller in the
parameter list.'
I think i have do this beceause latter I have notuhig value but in using a pointer to the parameter of the fonction it's good.

what is the CLN?
I try to 'pass the value by reférence'...
0 Kudos
Message 3 of 5
(2,780 Views)
/*draven*/ wrote:

> rolfk wrote:
> 'Are you defining that value as a pointer to your datatype? That is
> the
> only way you can pass data back from a function to its caller in the
> parameter list.'
> I think i have do this beceause latter I have notuhig value but in
> using a pointer to the parameter of the fonction it's good.
>
> what is the CLN?

CLN = Call Library Node

> I try to 'pass the value by reférence'...

That should do the trick. Make sure you have slected the right data
type, configured the correct calling convention and all that and then it
will work.

If still having problems, showing us parts of your C source code you
created in LabWindows CVI and maybe the VI you try to use with that DLL
will certainly help greatly to come
up with more than some wild guesses
into the blue.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 5
(2,780 Views)
Hi,

I joined a sample program. You'll find a CVI DLL example (created with CVI 7.0) with only one function exported and then an example of use under LabVIEW 7.0.

Vincent RUAULT
0 Kudos
Message 5 of 5
(2,780 Views)