Chapter 11 419
Optimizing Agilent VEE Programs
Using Dynamic Link Libraries
Note You can also call a DLL function from an expression field, provided the
library has been loaded. When used in this way, you must enclose the
parameters in parentheses after the function name, and the function only
sends back its return value. Any parameters passed by reference can only be
retrieved by using the
Call object. For example, you might use the
following expression in a
Formula object:
2 * yourFunc(a,b)
The a and the b would refer to two input pins on the Formula object, and
the return value of
yourFunc would be multiplied by 2 and placed on the
output pin.
3. (Optional) Click
Device ⇒ Delete Library.
While developing the program, you can also select
Delete Lib from
the object menu to delete the library programmatically. Deleting the
library after it has been used in the program reduces load time and
conserves memory.
An Example Using a DLL
In this exercise, you will import a DLL and call a function from the DLL.
The DLL used is included with the VEE product on Windows. (The same
program is designed to work on all platforms.)
Open the
manual49.vee file. It is located under:
<installation directory>
\EXAMPLES\MANUAL\MANUAL49.
Examine this example closely. It should look like Figure 11-8.