10-05-2021 05:34 AM
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.
10-05-2021 06:53 AM - edited 10-05-2021 07:02 AM
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.
10-06-2021 08:32 AM
Might be better to see if there is a programming interface so you can roll your own drivers.
10-07-2021 02:37 AM
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)
10-07-2021 03:04 AM - edited 10-07-2021 03:08 AM
@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.
10-07-2021 03:33 AM
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.
10-07-2021 03:50 AM - edited 10-07-2021 03:56 AM
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.