LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a c# exe file in labview

Hi, I am trying to learn how to execute a c# exe file in labview. I want to write a program in c# that gets an input and gives an output. And I want to create a exe file out of this and execute in labview with the input coming from labview into the exe file and output coming from the exe file into labview. How can I do that?

 

Govind

0 Kudos
Message 1 of 2
(755 Views)

Not easily.

 

Calling an executable is not the problem and passing it some parameters neither. You can use System Exec in LabVIEW to call another executable and you can pass the input parameters as command line parameters to it. Your exe then has to parse the command line and use those values. But passing it back to the caller is a bit of a problem. The typical process invocation on all computer platforms only allows to pass back a status, which in general is a numeric where 0 means the process terminated successfully and anything else means it had encountered some error.

 

Passing back of values is usually done by writing them into a file whose name was also passed to the executable as a parameter

 

But what you describe is more something for a library function than an executable. You can create a .Net assembly from your C# code and then call it with the LabVIEW .Net interface functions. That allows you a much more convenient way to pass parameters from LabVIEW to your function and return some values back to LabVIEW.

Rolf Kalbermatter
My Blog
Message 2 of 2
(752 Views)