LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call vb.net exe

Hello

 

Can anyone show me comparable code to the following vb.net code?

 

I have an application that is call by many other applications when a failure occurs. I have to start that process and send it a few arguments that the application needs.

 

 

 

Here is the code I use from vb.net

'========================================================================

Dim args As String 'start yellow tag application

Dim myProcess As Process = Nothing

 

args = pStrBNSN & "@" & gStrPartNumber & "@" & gStrBodyNumber & "@" & gStrSerialNumber

 

myProcess = System.Diagnostics.Process.Start(pStrServerPath, args)

 

myProcess.WaitForExit()

 

NOTE: pStrServerPath IS THE ACTUAL PATH WHERE APPLICATION RESIDES

 '========================================================================

 

 

Thanks

 

 

JCollado
0 Kudos
Message 1 of 6
(3,354 Views)

I'm not certain, but I think what you want to look at in LabVIEW is the "System Exec" call under "Connectivity:Libraries& Exectuables" on the diagram pallettes.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 2 of 6
(3,347 Views)

 

Yes  Shortly after posting the questions I found a good sample app.

 

Here is the snippet that is working:

 

Thanks

JCollado
0 Kudos
Message 3 of 6
(3,342 Views)

 

 

It is weird. I had this working fine and then it just stopped working.

 

My vb.net application no longer receives command line arguments from my labview vi. Nothing changed in my labview vi.

 

Not sure why this would happen.

 

JCollado
0 Kudos
Message 4 of 6
(3,319 Views)

JCollado:

 

Are you simply calling the VB.net exe from the command line using system exec? Is there any difference if you use the "cmd /c" prefix on the command? Ordinarily, the system exec VI is like entering a command in the Windows "Run" dialogue. If it's something that would normally be entered in a command prompt window, the "cmd /c" prefix will accomplish that.

 

If nothing changed in the LabVIEW VI, did anything change in your VB exe or the operating environment?

Caleb Harris

National Instruments | http://www.ni.com/support
0 Kudos
Message 5 of 6
(3,305 Views)

 

 

You are right. I did manage to fix this issue by just using it just like the command prompt.

 

I added the parameters right after the path      (path\app.exe parameters "para1@para2"

 

 

Thanks again for your help

JCollado
0 Kudos
Message 6 of 6
(3,299 Views)