To download NI software, including the products shown below, visit ni.com/downloads.
Overview
LabVIEW can interact with other programming language through ActiveX, DLLs, network protocols (TCP, UDP...), File Mappings... For each item, a few examples show how it is done.
Description
If you are looking for an elegant and efficient way to access LabVIEW VI Server from an unmanaged language like C# or VB.NET, you should not forget about LabVIEW assemblys because they offer a better integration with those unmanaged languages.
Create your assembly that encapsulates the VI Server functions you need from LabVIEW, import the built assembly in you C# project, and start using the VI Server as if it was a native component!
Requirements
Software:
Steps to Implement or Execute Code
Add VI Server functions to this library (for example, Open VI Reference, RunVI, Front Panel Open, Front Panel Center...)
Connect the terminals to the connector pane for further mapping.
NationalInstruments.LabVIEW.Interop.dll located in <Program Files>/National Instruments/Shared/LabVIEW Run-Time/<20xx>/.
myAssemblyName.dll which is the LabVIEW assembly you just built.Include the namespaces from these aforementioned assemblys in your code ("using ...;" at the top of your code).
Start writing your .NET code. You can now call the functions that were exported in your assembly. They will be seen as methods owned by a class named after your LV project library (dummy).
Make sure you build a 32-bit application (x86 processor architecture for most Windows machines). Make sure the LabVIEW Run-Time Engine (same version as the one which build the assembly) is installed on the machine running the Visual Studio project.
**This document has been updated to meet the current required format for the NI Code Exchange.**
Description-Separate-2Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Hi ,
Thanks for you info.But i find some issues about it.if I set some delay in Vi.some problems will come.