06-15-2019 01:46 PM
Hello
I have a very simple LabVIEW 2017 dll that does a little bit of high speed rs232 i/o and returns a string. I want to call this dll from a Delphi 5 program. Can this be done?
Thanks in advance
Anatoly
06-16-2019 02:45 PM
Yes it can be done of course! How depends a bit on how you defined the DLL interface when building the DLL in LabVIEW.
06-17-2019 05:17 AM
Hi Anatoly,
It is possible as Rolf already stated. You can choose two different DLL calling conventions when building a DLL from LabVIEW. Winapi and C. This information together with the generated header file is required to load and call the library.
I don't know Delphi, other than that my customer is able to call my LabVIEW dlls from it. You would have to search the Delphi forums to find examples on how to call a DLL from Delphi. Calling a LabVIEW DLL works the same as a DLL built in C. Easiest would be to find a simple system32.dll api call. If that works try a LabVIEW DLL using simple integer arguments (e.g. addition/multiplication), after that build towards to the end goal trying to understand how the various data type are exchanged.
The data types string and array require passing a pointer to a predefined buffer, which is then used by the DLL to return the answer. The predefined buffer needs to be >= to the size of the string to be returned.