Unrolled interface, Phases and error handling, Referenced percent variables – National Instruments AutoCode NI MATRIX User Manual

Page 120

Advertising
background image

Chapter 5

Generated Code Architecture

AutoCode Reference

5-12

ni.com

Unrolled Interface

There is another form of the procedural interface, the unrolled interface
(

No-UY

). This interface does not use

U

- and

Y

-structures to pass the inputs

and outputs. The input/output signals are passed as separate arguments to
the function.

Inputs—Each input signal is passed by value to the procedure.
Arguments are passed in pin order.

Outputs—Each output is passed by reference. Arguments are passed
in pin order.

Info—The same as described for Info in the

Structure-Based Interface

section.

Phases and Error Handling

The phases and error handling within a Standard Procedure is equivalent to
the implementation within a subsystem.

Referenced Percent Variables

There exists a capability in SystemBuild, called partitioning of parameter
(%var) data. Partitioning allows the same SuperBlock to be customized by
using a different Xmath partition containing different values of the
parameter data. Partitioning is used exclusively with SuperBlocks, so
normally AutoCode is unaffected. However, partitioning does apply to
procedures, and special handling must be done within a procedure. For
example, consider a procedure named

foo

that has %var parameters named

GAIN

for a gain block, as shown in Example 5-1. In the topmost

SuperBlock, there are two references to procedure

foo

, and each reference

specifies a different partition, say A and B. Therefore, when procedure

foo

executes from the first reference, the internal gain parameter,

GAIN

, is

taken from the A partition. Likewise, when the second reference executes,
the parameter

GAIN

is taken from the B partition.

AutoCode supports this capability by:

Creating separate variables for the %vars from each partition.

Having generated code in the procedure indirectly access the
parameter data.

Having the procedure’s Info-struct include %var references.

Having the caller initialize the Info-structure with reference to the
appropriate %var.

Advertising