LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec in .NET

First, there is no good reason to create a replacement for the System Exec.vi using .NET processes.  Heck, since that VI is locked, as so many others, I don't know what's under the hood, it might be .NET?  However, I have very little experience with .NET and this became a challenge to myself to get it working while learning a little bit about using .NET.

I am sharing this VI so others without .NET experience might use it as a reference and so those with more .NET experience can tell me what I did wrong or could do better.

Thanks for any feedback or suggestions for improvement.

 

James

Tech Advisor - Automation
LabVIEW 5.0 - 2020
0 Kudos
Message 1 of 6
(2,937 Views)

I'm fairly certain that System Exec is not implemented using .NET (on Windows). My reasoning is that adding this VI to your block diagram does not add any .NET assembly dependencies to your project or in the assembly listing.

0 Kudos
Message 2 of 6
(2,849 Views)

It's more likely a call to kernel32, I've seen some people try to use standard output and input to communicate with other applications.

 

What is it you are trying to achieve with System Exec or .NET?

0 Kudos
Message 3 of 6
(2,825 Views)

Close, but since LabVIEW is multiplatform, even calling Kernel 32 isn't something that can be done for all situations since Kernel32 doesn't mean anything to Linux, or Mac OS.  That's why it appears NI made a wrapper and are calling it which is a binary that does even more magic.  Any time I see a password protected VI from NI I generally realize that it is probably just a single call library function.  In this case it is calling the SystemExec_Wrapper function which is an internal call to the LabVIEW binary.

0 Kudos
Message 4 of 6
(2,799 Views)

OK, I apologize for not making my intent clear.

"First, there is no good reason to create a replacement for the System Exec.vi using .NET processes."

"I am sharing this VI so others without .NET experience might use it as a reference and so those with more .NET experience can tell me what I did wrong or could do better."

 

I was simply looking for feedback on my use of .NET processes and now wish I could delete the thread.

 

Tech Advisor - Automation
LabVIEW 5.0 - 2020
0 Kudos
Message 5 of 6
(2,788 Views)

The NI knight is correct, System Exec as a .NET wrapper does not work when you consider non-Windows.

 

As for usage of System Exec, what do you plan to use it for? I've seen outdated applications require console input and provide output through console, with the intention to be used in other applications. This is what DLLs should actually be used for. In most cases I've seen System Exec is a workaround to a more fundamental issue

0 Kudos
Message 6 of 6
(2,783 Views)