Asynchronous procedures, Interrupt, Background – National Instruments AutoCode NI MATRIX User Manual

Page 129: Startup, Asynchronous procedures -21, Interrupt -21 background -21 startup -21

Advertising
background image

Chapter 5

Generated Code Architecture

© National Instruments Corporation

5-21

AutoCode Reference

Asynchronous Procedures

Asynchronous Procedures are procedures that are not regularly scheduled
to be executed or directly called from a subsystem or Standard Procedure.
In other words, these procedures require some entity outside of the scope
of the SystemBuild diagram to invoke them. The following rules apply to
asynchronous procedures, but not necessarily to asynchronous subsystems.
For details about asynchronous subsystems, refer to the AutoCode User
Guide
.

These procedures share the following characteristics:

There are no external inputs and no external outputs.

Dynamic blocks, that is, blocks with explicit states, are not supported.

Global variable blocks are the only way to communicate between these
procedures and subsystems.

Interrupt

Some external interrupt event causes an Interrupt Service Routine (ISR) to
call the Interrupt Procedure. You must write all of the mechanisms for your
particular target to achieve this behavior.

Background

This code executes when there is no other activity happening in your
system. Obviously, this implies some kind of policy for the scheduler to
decide when the background procedure should execute. You are required
to implement all of the necessary scheduler mechanisms or use an RTOS.
The scheduler within the standard C and Ada templates executes all of the
background procedures after all of the subsystems execute for each
scheduler minor-cycle.

Startup

This type of procedure performs special initializations. The standard
template-generated code that executes all of the startup procedures before
time = 0.0 but after all of the subsystems have executed their PREINIT
phase.

Advertising