06-29-2009 10:54 AM
Solved! Go to Solution.
06-29-2009 11:15 AM
The easiest way (from my point of view) is following: compile your VI into DLL, then call this DLL from small "wrapper" command-line application (written in C) and return desired values as you want.
Andrey.
06-29-2009 12:05 PM
06-30-2009 09:07 AM - edited 06-30-2009 09:14 AM
Quite easy.
Let's say - you have VI like this:
Now you should build VI into DLL. Then in build options prototype looks like this:
Now just call DLL from your console application:
A little bit more complicated situation occur if you want to transfer whole command line parameters as string to your SubVI without conversion:
Then prototype looks like this:
Now you need to transfer array of LabVIEW-strings from external application to the DLL something like that:
(you can link lvrt.dll statically or dynamically).
And results:
with best regards,
Andrey.
06-30-2009 02:28 PM - edited 06-30-2009 02:29 PM
Andrey,
Thanks for all your help. The only thing your answer lacked for me was that I am using C#. In this case, you simply have to add some code to handle an unmanaged DLL like this:
using System.Runtime.InteropServices;
public class Win32
{
[DllImport("Drive Letter:\\path to dll\\DLL Name.Dll")]
public static extern double Testing();}
After adding this code to Import the DLL into a class of your choice, you can call the function to run the LabVIEW VI in the library.
Best regards,
Timothy