LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a Visual Basic Executable from LabVIEW?

Hi All,
 
My LabVIEW application needs to invoke an Executable which was developed using Visual Basic software. My Application requirements  are:
 
1. LabVIEW software passes some input parameters (some variables and arrays)  to this executable.
2. Executable processes these input parameters and passes the output variables to the LabVIEW code.
 
Till now, I had the experience of creating CINs (Code Interface Node) and creating .lsb files to serve this purpose.
 
But my present application needs to call an existing VB executable. This VB executable allows the users to click on some of its UI buttons to perform the tasks. Now I want to hide this UI operation from this executable and make this process happen automatically when invoked by the LabVIEW code.
 
(I have this executable's VB code with me).
 
Please suggest me about how I can implement this.
 
Thanks in advance.
 
-Krishna.
0 Kudos
Message 1 of 12
(4,414 Views)

You can usually call an application the same way you would from a command prompt (Path/app.exe -options.....) but pass this to the "System Exec.vi".

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 12
(4,402 Views)

You can usually call an application the same way you would from a command prompt (Path/app.exe -options.....) but pass this to the "System Exec.vi".

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 12
(4,402 Views)
Sorry for tagging onto an old post but...  How do I pass arguments to a Visual Basic Executable when using the System Exec.vi?  Also, will using the System Exec.vi cause the Visual Basic executable to display on the monitor?  I am looking for a way to call a VB Executable from within labview, pass input parameters to set a piece of hardware and close the VB executable (preferrably without having the VB code display on screen).  Anyone able to point me in the right direction?

Thanks in advance!
0 Kudos
Message 4 of 12
(4,183 Views)
I think you can instead build that VB code into a DLL & call it in LV so that you dont need to worry about it getting displayed on the monitor.
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 5 of 12
(4,178 Views)

Hi jimcbee,

can you do what you want in the windows cmd line? can you show us your command?

Mike

0 Kudos
Message 6 of 12
(4,163 Views)
I havent started work on this problem yet, I am trying to figure out the best angle of approach.  I do not have access to the VB source, only the executable (I did not write the VB code, just inherited it).  It would be best if I could have this executable called from a running labview program so that the user doesnt see it (aside from supplying one or two inputs to the VB executable).  Im sorry I cant be more descriptive but I am in the process of wrapping my head around the problem.  I am not familiar with building VB code into a dll, do I need source code to do this or can it be done on the labview end using the VB executable?

Thank you for the help!


Message Edited by jmcbee on 04-03-2008 08:50 AM
0 Kudos
Message 7 of 12
(4,139 Views)
Hi jmcbee,

does your VB exe allow parameters by command line? Can you control this exe in a batch file?

Also:
When it don't allows command line parameters you have to open that window to simulate user input by LabView...

To build an dll from this VB exe you need the sources as you have to build this dll using VB!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 12
(4,133 Views)
I appreciate your response GerdW.  This is info I was looking for.  I do not know if the VB exe allows parameters by command line or if/how to control it in a batch file.  When you say "When it don't allows command line parameters you have to open that window to simulate user input by LabView..." do you mean that it is necessary to have labview open the exe so that the user can input directly into the VB program?  It is starting to sound like I may need to rewrite the software in LabVIEW...

I appreciate the help!
0 Kudos
Message 9 of 12
(4,129 Views)
Hi jmcbee,

you can fake user input by some Windows functions like moving the mouse or keypresses. This allows you to control other software even when it dont allows command line parameters... But the user may interfere this procedure, it is tricky...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(4,124 Views)