Wednesday 21 December 2016

C# Class Libraries in LabVIEW Applications

labview projects
Knowing how to incorporate C# libraries into a LabVIEW based project can be an extremely helpful apparatus. There are many reasons why you would need to incorporate C# dll's into a LabVIEW extend however the two that surface frequently for me is reusing legacy code that was at first written in C# and composing a C# wrapper when needing to utilize an outsider driver or library.
Some of the time it's less demanding to compose the wrapper in C# and afterward actualize the library specifically in LabVIEW. While interfacing specifically to an outsider driver/library, the LabVIEW code to finish a moderately straightforward assignment can be extremely chaotic and bulky to peruse; subsequently the C# wrapper with basic usage in LabVIEW is my favored technique.
Adding a frame application to your answer permits you to test the library in the environment that it was composed. By testing the dll in C#, you can get prompt input to your dll improvement. On the off chance that there are issues with the dll when you move to LabVIEW, you realize that the usefulness is working so the issue is more than likely in the LabVIEW execution.
A typical bug in LabVIEW is that the callback vi stays held for execution even once the references are shut, the occasion has been unregistered and the application has been halted.
An approach to get around this is to incorporate a summon hub once every one of the references have been shut. Right tap on the conjure hub and select the accompanying: Select Class >> .NET >> Browse >> mscorlib (4.0.0.0) >> System >> GC >>
When this technique is put on the square chart, the callback occasion vi will never again be saved for execution.
In synopsis, this is an extremely straightforward usage of making a C# Class Library, testing it utilizing a C# Form Application and afterward utilizing the Class Library as a part of a LabVIEW extend.

No comments:

Post a Comment