Calling ucbs, Table 3-5. ucb calling arguments and data types, Calling ucbs -12 – National Instruments AutoCode NI MATRIX User Manual

Page 74

Advertising
background image

Chapter 3

Ada Language Reference

AutoCode Reference

3-12

ni.com

Calling UCBs

Every one of the following arguments will be passed for each call to the
UCB in the following order:

INFO, T, U, NU, X, XD, NX, Y, NY, R_P, I_P

Within the UCB, the elements of all the array variables (

U

,

X

,

XD

,

Y

,

R_P

,

I_P

) must be accessed as in the following example:

U(U'first), U(U'first+1), ... U(U'first+NU-1)

X(X'first), X(X'first+1), ... X(X'first+NX-1)

Make sure to access the elements in the above manner as all the arrays are
passed as array slices. The sizes of

R_P

and

I_P

must be entered in the

UCB block form to ensure that proper storage is allocated in the caller.
Also, the initial conditions for states have to be specified in the form.
Table 3-5 lists the type and purpose of UCB arguments used in the fixed
calling method.

Table 3-5. UCB Calling Arguments and Data Types

Argument

Data Type

Description

INFO:in out

RT_STATUS_RECORD

A structure representing operation requests and
status.

T:in

RT_DURATION

Elapsed time.

U:in

RT_REAL_ARRAY

An array (of size NU) of inputs to the UCB.

NU:in

RT_INTEGER

The number of inputs to the UCB.

X:in out

RT_REAL_ARRAY

An array (of size NX) of state variables of the UCB.

XD:in out

RT_REAL_ARRAY

An array (of size NX). Defines the next discrete
states of X for discrete subsystems, and the derivative
of X for the continuous subsystems.

NX:in

RT_INTEGER

The number of states (and next states).

Y:in out

RT_REAL_ARRAY

An array (of size NX). Defines the next discrete
states of X for discrete subsystems, and the derivative
of X for the continuous subsystems.

NY:in

RT_REAL_ARRAY

The number of outputs from the UCB.

R_P:in out

RT_REAL_ARRAY

An array of real parameters.

NRP:in out

RT_INTEGER

The number of real parameters.

Advertising