Chapter 11 425
Optimizing Agilent VEE Programs
Compiled Function using C (UNIX)
Figure 11-10. Program Calling a Compiled Function
Notice the following about the program:
size of the
array
One variable in the C function (and correspondingly, one
data input terminal in the Call object) is used to
indicate the size of the array. The arraySize variable
is used to prevent data from being written beyond the
end of the array.
the Call
Function
object
Since array has been passed by reference, VEE
automatically creates both an input and output pin on
the Call Function object.
The arraySize variable has been passed by value, so
VEE only creates an input terminal. However, the
function’s return value is used to return the size of the
output array to VEE. This technique is useful when you
need to return an array that has fewer elements than the
input array.