© National Instruments Corporation
As previously stated, the inputs and outputs of the UCB will have the same
data type as specified in the model diagram. Inputs are passed by value
while outputs are passed by reference. In addition, the "shape" of an
argument describes whether it is a scalar value or an array. For information
on how to specify the data type and shape of the inputs and outputs of the
UCB, refer to the SystemBuild User Guide.
Another complexity relates to vectorization with AutoCode code
generation. By design, the variable interface UCB is insulated from
the many possible combinations. The interface to the UCB will remain
constant relative to all of the AutoCode optimization. As a result,
AutoCode performs any needed copying—for example, staging—of inputs
and outputs to make sure the proper arguments are passed to the UCB.
For example, if the UCB expects an array of five inputs, yet scalar code is
generated, AutoCode creates a temporary array for those inputs and passes
that temporary array to the UCB.
Function Prototype
National Instruments recommends that you create a function prototype for
your variable interface UCB functions. This will provide some additional
checking that the compiler can do to ensure that the generated interface
matches what you expected without your implementation of the UCB
function.
The following is a sample prototype for a variable interface UCB function:
void ucb01(
RT_FLOAT
RT_INTEGER
RT_INTEGER
RT_FLOAT
RT_INTEGER
RT_FLOAT
RT_INTEGER
);
change[2],
xpos,
ypos,
*rate,
posdata[3],
*RP,
NRP
2-19
Chapter 2
C Language Reference
/*** inputs ***/
/*** outputs ***/
/*** RP ***/
AutoCode Reference
Need help?
Do you have a question about the AutoCode NI MATRIX and is the answer not in the manual?
Questions and answers