11-07-2008 11:09 AM
Is it possible to call a dll library function that returns a pointer using mathscript? I get the following error when I try it.
"Error in function calllib at line 3. You cannot call shared library functions with numeric pointer return types from MathScript."
Partial script is shown below. It loads the library ok. The function 'Pri_Create' returns a pointer to void. Matlab has the function 'libpointer' for declaring a void pointer. Is there anything similar in mathscript?
p = 'c:\pri\lib\include'
loadlibrary('pri', 'pri.h', 'alias', 'BV', 'includepath', p);
s = calllib('BV','Pri_Create');
Appreciate any help...
Dan
11-07-2008
12:39 PM
- last edited on
07-16-2025
06:03 PM
by
Content Cleaner
Hello,
Unfortunately, the MathScript calllib function doesn't support functions that return void pointers. You can find a list of datatypes that this feature supports in the help topic entitled C Data Types in LabVIEW MathScript.
One possible workaround is to write a wrapper function in your DLL that converts the data into a format that MathScript does support. Another possible workaround is to call your function using the Call Library Node in LabVIEW. Which of these would work best depends on how you need to interpret the void pointer.
Jesse
11-07-2008 06:26 PM