Chapter 5
Generated Code Architecture
©
National Instruments Corporation
5-41
The Read from Variable Block optimization also is supported for Local
Variable Blocks. Refer to Chapter 7,
, for more details
on optimization. Also, the sequencing of local variable blocks is similar to
that of global variable blocks explained in the
section.
Sequencer Block
These blocks are used in the model to control the execution order of blocks.
The sequencer block makes sure that all of the blocks to its left are executed
before the blocks to its right are executed. In the generated code there is no
representation of sequencer blocks, but their presence forces AutoCode to
generate code for the blocks that are to its left first, followed by the blocks
that are to its right. Refer to the
Difference Between Local and Global Variable Blocks
Local and Global variable blocks are identical except for their lifetime and
scope.
Scope
Global variable blocks are implemented as global variables and are
visible throughout the system (have system scope). Local variables are
implemented as automatic variables, which are strictly temporary. The
scope of a local variable is local, that is, it is only visible to the procedure
(or subsystem) where it is defined and used.
Lifetime
The value of a global variable block persists until the program is
terminated. On the other hand, the value of a local variable is not
remembered from one invocation of a procedure (or subsystem) to the
subsequent invocation. Local Variable blocks have to be initialized
properly before they can be used.
Continuous Subsystem
For AutoCode purposes, a continuous subsystem is similar to a discrete
subsystem. However, whereas a model can have several discrete
subsystems, a model can only contain one continuous subsystem. This
limitation is required to prevent unexpected results of the execution order.
From a continuous point of view, the continuous subsystem is