User`s guide
Optimizing Agilent VEE Programs Chapter 12
VEE User’s Guide 451
• You need to provide error checking within your compiled
function, since VEE cannot trap errors in an external
routine.
• You must de- allocate any memory you allocated in your
external routine.
• When passing data to an external routine, make sure you
configure the Call object input terminals to the type and
shape of data that the routine requires.
• System I/O resources may become locked, so your external
routine should be able to handle this type of event.
• If your external routine accepts arrays, it must have a valid
pointer for the type of data it will examine. Also, the routine
must check the size of the array. If the routine changes the
size, you need to pass the new size back to the VEE program.
• The compiled function must use the return() statement as its
last statement, not exit(). If the compiled function exits, then
so will VEE, since a compiled function is linked to VEE.
• If you overwrite the bounds of an array, the result depends
upon the language you are using. In Pascal, which performs
bounds checking, a run- time error will result, stopping VEE.
In languages like C, where there is no bounds checking, the
result will be unpredictable, but may cause intermittent data
corruption or cause VEE to crash.
Guidelines in Using Compiled Functions
When you use compiled functions in a VEE program, follow
these guidelines:
• Call and configure a Compiled Function just as you would
call a UserFunction. You can either select the desired
function using Select Function from the Call object menu, or
you can type in the name. In either case, provided VEE
recognizes the function, the input and output terminals of the
Call Function object are configured automatically. The
necessary information is supplied by the definition file. (VEE
will recognize it if the library has already been imported.)