Have you ever been thinking that some task could be done quicker or better in C/C++/C#? But then due to project requirements or other constraints, you had to code it all again in LabVIEW. Don’t waste your time again! If there is anything what can be done easier in other programming language – just do it and then use the code as a shared library in LabVIEW.
DLLs are sections of code that are linked to the main program at run time (dynamically linked). This has several advantages. The first is space. If many applications share a certain algorithm, you can compile it once as a DLL, and then use the same code in all the applications. DLLs also provide a way for code to be distributed in a fashion that easily allows higher level programs to access the code. A good example of this are hardware drivers, in which the interface between the application software and the hardware is often through a DLL.
Knowing how to include C# libraries into a LabVIEW project can be a very useful tool. There are many reasons why you would want to include C# DLL’s into a LabVIEW project but the two that come up most often for me is reusing legacy code that was initially written in C# and writing a C# wrapper when wanting to use a third party driver or library. Sometimes it’s easier to write the wrapper in C# and then implement the library directly in LabVIEW. When interfacing directly to a third party driver/library, the LabVIEW code to accomplish a relatively simple task can be very messy and cumbersome to read; hence the C# wrapper with simple implementation in LabVIEW being my preferred method.
Thank you for reading my blog post, for an more in depth guide to using DLL in LabVIEW checkout this link. If you are interested in making a project using this tool but don’t have the right supplies, you can purchase a copy of LabVIEW 2014 home edition and everything you will need to run LINX 3.0 and start making! Please comment below with any questions or comments you may have.