LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to incorporate dll files into my LabVIEW program

Hello Team,

 

I am new to LabVIEW and want to read my pyrometer via LabVIEW but there is only DLL files available no VIs. Please, how do I go about this?

Many thanks in anticipation of your help.

0 Kudos
Message 1 of 7
(343 Views)

It depends on the type of DLL you have. If it is a .Net assembly DLL you would use the LabVIEW .Net functions to access it. If it is a traditional DLL you would use the LabVIEW Call Library Node. Please note that the latter requires you to understand about C programming a bit. This interface is C based and requires to understand the fundamentals of C to be able to make a fully working binding interface. 

Rolf Kalbermatter
Averna BV
Message 2 of 7
(327 Views)

Might be better to see if there is a programming interface so you can roll your own drivers.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 7
(276 Views)

Help -> Find Examples -> Communicating with external applications (in tree structure) -> Your external type.

A DLL can be of a few types, so depending on which you'll have to use either:
Call library function

.NET (Constructor node + invoke and property nodes)

ActiveX (Automation Open +invoke and property nodes)

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 7
(252 Views)

@Yamaeda wrote:

Help -> Find Examples -> Communicating with external applications (in tree structure) -> Your external type.

A DLL can be of a few types, so depending on which you'll have to use either:
Call library function

.NET (Constructor node + invoke and property nodes)

ActiveX (Automation Open +invoke and property nodes)


I left the ActiveX out intentionally.

 

- They don't necessarily use the DLL extension (but can, the extension is not really something the Windows kernel ever cares about. It's a Windows Shell (basically Windows Explorer) feature only, that was carried over from DOS times.)

 

- They are very legacy technology and near obsolete. While the underlying COM technology is still used in many parts of Windows, ActiveX has been marginalized by Microsoft in favor of .Net and if they saw any chance in totally sacking it from Windows, they would do so in a heartbeat. The tool chain to create them in newer Visual Studio versions is pretty much completely broken. It's still possible to do if you absolutely have to, but the effort needed for that is usually just as much than rewriting your whole ActiveX thing in .Net. And you have to repeat that work with every installation of Visual Studio again.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 5 of 7
(248 Views)

Many thanks, RolfK for your response. Please, how do I know the difference between .Net assembly and the traditional one? It just says dll on the folder name with a .h file inside as well.

0 Kudos
Message 6 of 7
(241 Views)

If there is a .h file alongside it almost certainly is a traditional DLL and you will want to try to use the Call Library Node. Just place one on a diagram, double click on it and then click on the folder button to the right of the Library Name or path control. Select your DLL and then see if you can see the same function names in the Function name drop box that are also mentioned in the .h file. If so you have a traditional DLL and in for learning some basic C knowledge before trying to incorporate the DLL.

 

Yes many will tell you to just use the Import Library Wizard in LabVIEW. While that is a good starting point to create your wrapper VIs, it is only for very trivial DLL interfaces sufficient. The C syntax is not sufficient to describe all aspects of calling functions. It is for instance notoriously unable to specify anything about proper memory management, a very fundamental element of calling C functions. The C programming language relies on the knowledge of the programmer to do the right thing based on experience and reading the according function documentation that hopefully exists. The Library Wizard can't read such prosa text documentation and has to go with what is in the header file, which is totally insufficient for making proper decisions in that respect.

Rolf Kalbermatter
Averna BV
Message 7 of 7
(239 Views)