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.
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/).
