My problem is converting the c++ builder code to the dll...Because some lines (declarations) needs to be added above the code but I couldnt figure out where I need to put those...I think I need to ask a question like how can i make dll with builder to use in labview.
Make it simpler: Go to a C Builder forum and ask how to create a DLL to be called from other C programs through LoadLibrary() and GetProcAddress().
Most LabVIEW programmers do not create DLLs and those that do use normally Visual C since it mostly just works. So asking here is not likely giving you much detailed feedback.
On the other hand chances that some C Builder users know LabVIEW are pretty minimalistic. So you have to go where C Builder expertise is, namely some C Builder forum, and ask a question they can understand. -> See above first sentence.
Try some of these C++ Builder forums as Rolf suggested: http://www.google.com/search?q=C%2B%2B+builder+forum&ie=utf-8&oe=utf-8&aq=t&rls=com.frontmotion:en-U...
I am trying to use a dll in my labview that I created following online steps for a simple code. However, although I can see the function name correct, it does not calculate a value for return. These are pictures for my labview window. Representations are double, display formats are floating and parameters are 8 bit double.
Do you have an idea why the return value is : NaN
Look in the LabVIEW Example Finder for the Call DLL.vi. It's a good way to learn how to setup conventions and parameters when using a CLFN.
There's also a good manual in LabVIEW Help called "Calling Code Written in Text-based Languages" (in the Fundamentals section).
Also, read this: http://www.ni.com/pdf/manuals/370109a.pdf
BTW, we can't help you very much unless you post your VIs and C++ code so we can look at how you setup your interface node.
Look at the prototype of your CLN setup:
double _BoxProperties(double Length, double Height, double Width);
And the one of your DLL function:
void BoxProperties(double L, double H, double W, double& A)
Forget about the prefixed underscore as that is the default name decoration for cdecl functions. Do you think there is a difference in the number of parameters and or return values??
And if you fix the Call Library Node configuration, make sure to configure the additional 4th parameter to be passed by reference (Pointer to Value).
" make sure to configure the additional 4th parameter to be passed by reference (Pointer to Value)."
I didnt understand this. I have 4 parameter one of them is return value, other 3 are inputs. which one is the Additional 4th parameter..Do i need to add one more or change one of those to pointer to value?
Your DLL function does not return anything (void). Probably (I didn't go through the DLL) it intends to put the results into the memory location pointed to by A. You need to make sure the CLFN parameters match the ones in your DLL or else it will crash, or worse, NOT crash and subtly corrupt memory.