LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to define datatype and call function that use inline casting from frontpanel

Hello ;

I have the following question and would appreciate some quick help.
I have some c code that I am compiling in labwindows 5.x into a DLL for
use in labview. The code uses inline casting like in the following
function header:

float dbrent(float ax, float bx, float cx, float (*f)(float),
float (*df)(float), float tol, float *xmin)
{
}
-----------------
for example "float (*df)(float)" is given as one of the function parameters.

I have written a front panel so to test the code and to have the code appear
to labview later on as an instrument so that it can generate Vi's to call the DLL
automatically instead of having to labour over it...

The problem is that if I replace "float (*df)(float)" with a float on the function
panel, the code will not run from it complaining that the definition in the function
header and fron panel don't match. I don't know how to define this in labwindows fronpanel.
just entering the string "float (*df)(float)" appears to work except that labview import
function now seems to generate code with slightly wrong parameters ?

ANy suggestions ?

Aku
0 Kudos
Message 1 of 2
(2,976 Views)
Hello Aku,

First, you said that using the float (*df)(float) worked, but LabVIEW seemed to be generating code with incorrect parameters. What exactly where you getting back in LabVIEW as the parameter info compared to what you were inputting?

Also, I just wanted to know if it was possible to restructure your functions. Instead of passing a file pointer as a parameter, just pass the value returned by that function. Right before you call this function, you can call the other function that you were going to pass in as a pointer, store the value in a variable, and then pass in the variable.


Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 2
(2,919 Views)