Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Oct 29, 2007


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Using LabWindows/CVI as an ActiveX Automation Controller to Control Automation Servers

8 Ratings | 2.75 out of 5
Print | PDF
ActiveX Automation is a technology based on the Component Object Model that allows you to reuse code written in any language with a defined interface. You then can make that code accessible to other applications. ActiveX Automation applications interact in a client/server model, where the Automation server exposes objects that can be controlled by the Automation client, which also is known as the Automation controller. Automation objects can have methods, which are functions that perform an action on the object, such as saving or printing. Also, the Automation objects can have properties, which are functions that set or return information about the state of an object, such as its width, height, or state.

For example, you can use Microsoft Excel as the Automation server and invoke methods and get/set properties of its objects from a LabWindows/CVI application (the Automation client/controller application). Excel exposes objects such as workbooks, worksheets, charts, and ranges of cells through Automation. From the LabWindows/CVI program, you can manipulate only the objects that Excel exposes to other applications. This means that Excel determines what it exposes and what values and variables must be passed to each method or property.

To use the objects that an Automation server exposes in a LabWindows/CVI program, LabWindows/CVI provides a Wizard. Go to Tools»Create ActiveX Automation Controller and browse the server's exposed objects to create a LabWindows/CVI instrument driver (a set of C functions) that wrap the methods or properties of the object. By calling the functions in the generated instrument driver from within a LabWindows/CVI program, you can invoke the methods and set or get the properties of the server objects.

The LabWindows/CVI Integrated Development Environment (CVI IDE) application also is an Automation server. This means that you can control the LabWindows/CVI IDE from within other Automation controllers. For example, you can move files in and out of LabWindows/CVI projects, compile a file, or build a project from within another application.



8 Ratings | 2.75 out of 5
Print | PDF

Reader Comments | Submit a comment »

Event Handling?
No mention of handling events from an automation server. In COM parlance the server fires an event by calling a method on an outgoing interface. The event is handled by a COM client (e.g. LabWindows/CVI automation controller) which implements the method. The usual technique uses connection points and the client advises the server of any events that it is interested in handling.
- Tom Wilson,Nokia UK Ltd. ext-tom.wilson@nokia.com - Jan 08, 2004

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).