LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call external programs?

Solved!
Go to solution

I have seen people call external programs through LabVIEW and was curious what functions you could use to do this.

I'm pretty sure its using one of the ActiveX functions  or maybe 'open application reference .vi'.

Can anyone tell me (or show me) a quick example of how to open an external program (ie excel,  notepad, etc) programatically

Cory K
Message 1 of 7
(6,424 Views)
Solution
Accepted by topic author Cory_K

HI Cory,

 

Take a look at Help >>> Find Examples >>> Communicating with External Applications >>> ActiveX >>> Excel >>> Write Table to XL.vi

 

To step back and answer your Q in a general fashion.

 

The methods required or possible to interact with external apps depends on the the external app and what mechanisms it supported.

 

SysExec

Used to for programs tha can be invoked from a DOS command line.

 

DCOM

The app had to support this and you work with it doing peeks and pokes.

 

ActiveX

Only available on Windows and the methods and properties all depend on the app.

 

.NET

Newest version of interacting with apps.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 7
(6,418 Views)

Thanks Ben.
I was looking at the example 'Write Table to XL',

and within that, the subVI 'Open Excel'.

 

Where did they get this:

I dont know what constant to type in, or where to get this value. 

Message Edited by Cory K on 12-31-2008 11:01 AM
Cory K
0 Kudos
Message 3 of 7
(6,407 Views)

Cory K wrote:

...

Where did they get this:

...


 

Kudos for going from "I don't know to start" to "Let's stump Ben" with only the second post to this thread.

 

I either copy it from an example or try to browse to it.

 

 

NOTE:

If you plan to work with MS ActiveX objects, I found it very helpful to do a custom install of Office and make sure the help files for VBA are loaded. These will at the least give you an idea of what the methods are and what parameters go with each.

 

 

Ben

 

Message Edited by Ben on 12-31-2008 11:09 AM
Message Edited by Ben on 12-31-2008 11:13 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 7
(6,400 Views)

So If I wanted to open Windows Media Player, for example, I would do this?

 

Message Edited by Cory K on 12-31-2008 11:24 AM
Cory K
Message 5 of 7
(6,390 Views)
You could, but more than likely for Windows Media Player you would actually be working with the ActiveX control on the front panel. Thus, it would reside inside an ActiveX container, and the reference is opened automatically by it being in the container. In fact, there's a pre-existing ActiveX container with the Windows Media Player control embedded in the .NET & ActiveX subpalette of the Control palette.
Message 6 of 7
(6,326 Views)

smercurio_fc wrote:
You could, but more than likely for Windows Media Player you would actually be working with the ActiveX control on the front panel. Thus, it would reside inside an ActiveX container, and the reference is opened automatically by it being in the container. In fact, there's a pre-existing ActiveX container with the Windows Media Player control embedded in the .NET & ActiveX subpalette of the Control palette.
Where is this ActiveX control?
I went to the front panel and added an ActiveX container.
Then I right-clicked, and said Insert ActiveX object, 
but there is no WMP or windows media player or microsoft WMP...etc
Do you know where it is located? 

 Edit *** Nevermind, I just overlooked it. Thanks for your help

Message Edited by Cory K on 01-02-2009 10:48 AM
Cory K
0 Kudos
Message 7 of 7
(6,323 Views)