Developer Center Resources

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling ActiveX Code from LabVIEW

 

» Calling External Code » Calling ActiveX

 

Introduction

ActiveX is a technology that allows software to expose functionality via an API that can be called from other applications.

 

The following documents detail how to use ActiveX components from LabVIEW as well as how other applications can call LabVIEW using LabVIEW’s ActiveX server (VI Server).

 

LabVIEW Help: Using ActiveX with LabVIEW

White Paper: ActiveX and LabVIEW

 

There are basically two types of ActiveX components – ActiveX Controls and ActiveX Servers.

 

An ActiveX Control is a UI element that can be used in other applications and exposes an API to interact with the control. For example, Windows Media Player and Adobe Acrobat Reader can be embedded in other applications using their ActiveX Control.

 

An ActiveX Server is a non-UI object that exposes an API that can be called from other applications. For example, using Microsoft Office ActiveX Server, an application can start Excel, load an Excel file and draw a graph on the file.

Basic Usage

  • Embed ActiveX Control on Front Panel: ActiveX Controls can be embedded on a LabVIEW Front Panel using the ActiveX Container (Controls Palette » .NET & ActiveX » ActiveX Container).

  • Instantiate an ActiveX Object: ActiveX Objects can be instantiated in LabVIEW using the Automation Open Function (Functions Palette » Connectivity » ActiveX » Automation Open).

  • Call Methods and Access Properties of ActiveX Objects: The ActiveX Container and Automation Open output a Automation Refnum that is a reference to the ActiveX object and can be used in conjunction with Property Nodes and Invoke Nodes to manipulate the object.

  • Handle ActiveX Events: Use the Register for Events function to register a callback VI that will be called when the ActiveX event fires.

  • Close ActiveX Reference: Use the Close Reference function to free up any resources associated with an ActiveX object when you are done using it.

Examples

The following examples install with LabVIEW:
Slideshow VI: labview\examples\comm\actxpp.llb
ActiveX Event Callback for Excel VI: labview\examples\comm\axevent.llb
ActiveX Event Callback for IE VI: labview\examples\comm\axevent.llb
Excel Reports: labview\examples\office\Excel Reports.llb
Word Reports: labview\examples\office\Word Reports.llb
MS Office Graph Reports: labview\examples\office\MSGraph Reports.llb

 

Community Example: Open PDF in LabVIEW using ActiveX
Community Example: Computer System Performance in LabVIEW with ActiveX

 

Jervin Justin
NI TestStand Product Manager