beautypg.com

Error procedure( ) procedure – National Instruments AutoCode NI MATRIX User Manual

Page 69

background image

Chapter 3

Ada Language Reference

© National Instruments Corporation

3-7

AutoCode Reference

The

sa_utils.a

or

sa_utils.ada

file contains comments about each of

the routines as they are used for comparing simulation with generated code
results.

Enable( ), Disable( ), and Background( ) Procedures

Enable, disable, and background routines are not needed when the
application scheduler is written in terms of the Ada tasking model. They are
furnished as null stubs in the

sa_utils.a

or

sa_utils.ada

file. If you

have a system that requires intervention in this area, place the required code
in these procedures.

Error Procedure( ) Procedure

procedure Error(NTSK: in RT_INTEGER;

ERR_NUM: in RT_INTEGER)

Error( )

reports conditions detected by the generated code during

execution; not all reported conditions are errors. These functions can be
invoked for deactivating all necessary functions and then passing an alarm
to the external environment or for initiating recovery action. You can
choose either to return from an error function or to halt the machine.

The

RT_INTEGER

variable

ERR_NUM

is passed if an error occurs in running

the generated code. The following conditions are trapped. Not all of them
necessarily indicate that an error has occurred. The following messages
may be generated during the execution of the generated code:

Stop Block encountered in task

n

This is not necessarily an error. This refers to a SystemBuild Stop
Simulation Block, encountered in the execution of the generated code.

Math Error encountered in task

n

Check your model for possible overflows, divisions by zero, and so on.

User code error encountered in task

n

External_Output( )

Post external outputs.

Signal_Remote_Dispatch( )

Multiprocessor implementations only; signal secondary
processors that a dispatch table is available.

Table 3-4. Target-Specific Utility Routines (Continued)

Routine

Function