beautypg.com

Parameterless procedure, Specifying parameterless procedure interface, Input specification – National Instruments AutoCode NI MATRIX User Manual

Page 232: Parameterless procedure -5, Specifying parameterless procedure interface -5, Input specification -5

background image

Chapter 9

Global Scope Signals and Parameterless Procedures

© National Instruments Corporation

9-5

AutoCode Reference

Parameterless Procedure

A parameterless (argument-less) procedure is a procedure that uses global
variable(s) to pass input(s) into and/or output(s) out of the procedure. Each
input and output can be individually selected to be global or not.

Note

A parameterless procedure is purely a performance optimization that requires you to

make design changes in your model to get the correct code. Carefully consider using this
type of procedure, as it requires significant effort to design your model correctly without
the safety net of AutoCode managing the generated variables. National Instruments
recommends that only advanced users of SystemBuild and AutoCode use this feature.

Specifying Parameterless Procedure Interface

Each of the inputs and outputs of a procedure can be specified with a scope.
This scope indicates that the signal is to use a global variable or not.
Unfortunately, it is not enough just to specify the interface. The source of
the procedure’s inputs—that is, the blocks whose output(s) connect to the
procedure’s inputs—must know the exact name(s) of the global variables
so as to pass the data correctly. The goal is to eliminate any extra copies of
the data when a procedure is called, and that requires the use of unsafe
global variables.

An unsafe global variable is a global variable that might have
multiple-writers and might require an implicit execution order to provide
the correct value for a particular usage.

Caution

The Analyzer and AutoCode are unable to detect sequencing flaws in a model that

uses parameterless procedure signals. The result might be non-deterministic behavior of
your model.

Input Specification

The specification of procedure inputs is done within the Procedure
SuperBlock definition. Like basic block outputs, each input channel has an
attribute called

Input Scope

. A Local Scope for an input indicates that

channel will be passed to the procedure within the procedure’s input (U)
structure or passed on the stack (

-nouy

). A Global Scope indicates that the

signal is intended to be a global variable. As such, the exact name of the
global variable must be specified as the procedure’s Input Name for that
signal. You cannot use a Global Scope Input signal without specifying an
input name for that signal.