Chapter 5 Generated Code Architecture© National Instruments Corporation 5-11 AutoCode Referencesystem, because ordering of the outputs in a single-rate system ismaintained. In a multi-rate system, duplicates can be safely eliminatedbecause of the sample and hold mechanism. The code to perform both ofthese activities represent a copy from one variable to another.Error HandlingThe error handling within a subsystem is very simple. When an error isdetected, the code goes to (or throws an exception) some error handlingcode. The purpose of the error handler is to cope with the error as best itcan. The error handler is completely defined in the template and you canchange the default behavior quite easily. There is only a limited set ofrun-time errors that are checked for, but some blocks generate special errorhandling when the -e option is specified for code generation.Standard ProceduresA Standard Procedure SuperBlock represents a reusable, reentrant functionwithin the generated code. A Standard Procedure is internally structuredalmost exactly like a subsystem, except for reusability and reentrancy.Structure-Based InterfaceThis form of the interface to the Standard Procedure is conceptually thesame as that of the subsystem. The inputs, outputs and other data arepackaged into structures that are passed by pointer as actual arguments tothe function. The caller is tasked with creating instances of the structuresneeded for the interface. The following briefly describes the type ofstructures required for this interface.• Input—Also called the U-structure and contains the inputs of theprocedure. The inputs are in the order specified in the proceduredefinition’s external inputs.• Output—Also called the Y-structure and contains the outputs ofthe procedure. The outputs are in the pin-order specified by theconnections of basic blocks to the external output pins of the proceduredefinition.• Info—Provides additional information that is used by the procedure tomaintain reusability and reentrancy. Data includes the R_P and I_Pdata for the blocks within the procedure. State data for the blockswithin the procedure appear within this structure as well. The input,output and info structures of nested procedure SuperBlocks appear aswell. Also, %vars used in the procedure are passed by pointer tosupport the partitioning capability of SuperBlocks.