LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call LabVIEW dll from Delphi

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

0 Kudos
Message 1 of 3
(2,812 Views)

Yes it can be done of course! How depends a bit on how you defined the DLL interface when building the DLL in LabVIEW.

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

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.

Regards,
André (CLA, CLED)
0 Kudos
Message 3 of 3
(2,776 Views)