National-instruments AutoCode NI MATRIX Manuel d'utilisateur

Naviguer en ligne ou télécharger Manuel d'utilisateur pour Matériel National-instruments AutoCode NI MATRIX. National Instruments AutoCode NI MATRIX User Manual Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 250
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs

Résumé du contenu

Page 1 - NI MATRIXx

NI MATRIXxTMAutoCodeTM ReferenceAutoCode ReferenceApril 2007370768C-01

Page 2

ContentsAutoCode Reference x ni.comStates ...

Page 3 - Important Information

© National Instruments Corporation 4-1 AutoCode Reference4Generating Code for Real-Time Operating SystemsThis chapter describes the RTOS configuration

Page 4 - Conventions

Chapter 4 Generating Code for Real-Time Operating SystemsAutoCode Reference 4-2 ni.comConfiguration ItemsThe following is a list of configuration attr

Page 5

Chapter 4 Generating Code for Real-Time Operating Systems© National Instruments Corporation 4-3 AutoCode ReferenceTable Naming ConventionTables are gi

Page 6 - Ada Language Reference

Chapter 4 Generating Code for Real-Time Operating SystemsAutoCode Reference 4-4 ni.comExample 4-1 Processors Table Examplertos.processors = 2Sc

Page 7

Chapter 4 Generating Code for Real-Time Operating Systems© National Instruments Corporation 4-5 AutoCode ReferenceExample 4-3 Subsystem Table Exampler

Page 8 - Chapter 5

Chapter 4 Generating Code for Real-Time Operating SystemsAutoCode Reference 4-6 ni.comExample 4-4 Interrupt Table Examplertos.intrsupblk =Interrupt |

Page 9

Chapter 4 Generating Code for Real-Time Operating Systems© National Instruments Corporation 4-7 AutoCode ReferenceStartup Procedure SuperBlock TableTa

Page 10 - AutoCode Reference x ni.com

Chapter 4 Generating Code for Real-Time Operating SystemsAutoCode Reference 4-8 ni.comExample 4-7 Processor IP Table Examplertos.IPprsrmap =Processor

Page 11 - Vectorized Code Generation

Chapter 4 Generating Code for Real-Time Operating Systems© National Instruments Corporation 4-9 AutoCode Referenceconfiguration file is updated. Also,

Page 12 - AutoCode Reference xii ni.com

© National Instruments Corporation 5-1 AutoCode Reference5Generated Code ArchitectureThis chapter supplies more details about the content and framewor

Page 13 - Appendix A

Contents© National Instruments Corporation xi AutoCode ReferenceDefinitions and Conventions ...

Page 14 - Introduction

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-2 ni.comSignal NamingA signal in the diagram is represented as a variable in the generated c

Page 15 - Language-Specific Information

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-3 AutoCode ReferenceGlobal StorageIn a strict modular programming paradigm,

Page 16 - Using MATRIXx Help

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-4 ni.com• Write-To Variable Block (ALL Addressing mode)—These blocks execute after all other

Page 17 - Related Publications

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-5 AutoCode ReferenceSubsystemsThis section describes the design and operatio

Page 18 - C Language Reference

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-6 ni.comTop-Level SuperBlockThe term Top-Level SuperBlock is often used. This term describes

Page 19 - Stand-Alone Library

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-7 AutoCode ReferenceFigure 5-1 illustrates the interface layers. The layers

Page 20

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-8 ni.comDiscrete Subsystem Interface LayerThis layer comes in two variations to allow for bo

Page 21 - AutoCode Reference 2-4 ni.com

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-9 AutoCode ReferenceThis sample and hold mechanism guarantees deterministic

Page 22 - Target-Specific Utilities

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-10 ni.comProcedure DataProcedure SuperBlocks have inputs, outputs and states independent of

Page 23 - AutoCode Reference 2-6 ni.com

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-11 AutoCode Referencesystem, because ordering of the outputs in a single-rat

Page 24

ContentsAutoCode Reference xii ni.comChapter 7Code OptimizationRead from Variable Blocks ...

Page 25 - AutoCode Reference 2-8 ni.com

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-12 ni.comUnrolled InterfaceThere is another form of the procedural interface, the unrolled i

Page 26

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-13 AutoCode ReferenceNote If you specify a specific partition with the %var

Page 27 - UserCode Blocks

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-14 ni.comEXEC_ERROR: return;}/******* Subsystem 1 *******/void subsys_1(U, Y) struct _Sys

Page 28

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-15 AutoCode Reference foo_2_u.foo_1 = U->t_l_1; foo(&foo_2_

Page 29

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-16 ni.commixed data-typed variables reflecting each procedure output signal and type.The sta

Page 30 - Implementing Handwritten UCBs

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-17 AutoCode ReferenceThe parameter arrays RP (real parameters) and IP (integ

Page 31

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-18 ni.comExtended Procedure Information StructureThe -epi option specifies that additional e

Page 32 - File Name: usr_dsp.c

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-19 AutoCode ReferenceNotice the relative numbering within a task/procedure t

Page 33

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-20 ni.comhowever, is to create additional space when declaring a variable of the info struct

Page 34 - Function Name: usr_dsp

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-21 AutoCode ReferenceAsynchronous ProceduresAsynchronous Procedures are proc

Page 35 - Interface Ordering

Contents© National Instruments Corporation xiii AutoCode ReferenceVariable Block Aliasing...

Page 36 - Function Prototype

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-22 ni.comChanging %var Values During StartupA special feature of the Startup allows the valu

Page 37 - Procedure SuperBlocks

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-23 AutoCode ReferenceThe BlockScript block allows you to specify conditions

Page 38

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-24 ni.comIn Example 5-5, alpha, beta, and gamma are the variables to be used as representati

Page 39

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-25 AutoCode ReferenceInit, Output, and State PhasesA subsystem has phases be

Page 40 - Generate Reusable Procedure

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-26 ni.comDefault PhaseIf you do not specify a phase and/or all code is not contained within

Page 41 - Function

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-27 AutoCode ReferenceLocal Variables and PhasesA local variable cannot be us

Page 42

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-28 ni.com new_total = y;endif;Example 5-8 Generated Code from Example 5-7void subsys_1(U, Y

Page 43 - C Fixed-Point Arithmetic

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-29 AutoCode ReferenceContinuous SemanticsThe state data within a continuous

Page 44

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-30 ni.comIn Example 5-9, a hard-subscript, i, is used to access both inputs and outputs. The

Page 45 - Fixed-Point Data Types

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-31 AutoCode ReferenceExample 5-11 Local Variables Used to Allow Loops in Sca

Page 46

© National Instruments Corporation 1-1 AutoCode Reference1IntroductionThis manual provides reference material for using AutoCode to write production q

Page 47 - User Types

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-32 ni.com• FOR Loop—Can generate either a rolled or unrolled loop depending upon the range o

Page 48 - Stand-Alone Files

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-33 AutoCode ReferenceParametersParameters represent data that can be used to

Page 49 - Macro Interface

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-34 ni.comExample 5-14 BlockScript Block Example with Updating of a ParameterInputs: u;Output

Page 50 - Function Interface

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-35 AutoCode Reference else { total = U->bsb_1; } Y->bsb_22_1 = t

Page 51

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-36 ni.com for i = 1:y.size do y(i) = 0.0; endif;endif;Example 5-17 Generated Code for B

Page 52 - Conversion Macros

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-37 AutoCode ReferenceUserCode BlockThe purpose of the UserCode Block (UCB) i

Page 53 - 8-bit number with a shift of

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-38 ni.comParameterized UCB CalloutA UCB can be defined with %var parameterized data for the

Page 54 - i ALIGN so wo p (n, rp)

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-39 AutoCode ReferenceSoftware ConstructsThese blocks provide the software co

Page 55 - Arithmetic Macros

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-40 ni.comBREAK BlockThe WHILE construct indefinitely iterates unless a BREAK Block is execut

Page 56

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-41 AutoCode ReferenceThe Read from Variable Block optimization also is suppo

Page 57

Chapter 1 IntroductionAutoCode Reference 1-2 ni.com• Chapter 8, AutoCode Sim Cdelay Scheduler, discusses the Sim Cdelay low-latency scheduler.• Chapte

Page 58

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-42 ni.comrepresentative of a sequence of equations. These equations are sensitive (that is,

Page 59 - 32-Bit Multiplication

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-43 AutoCode Reference• Algebraic loops are not supported.• AutoCode only per

Page 60 - 32-Bit by 16-Bit Division

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-44 ni.comDistributed Memory ArchitectureAutoCode also supports a multiprocessor architecture

Page 61 - Fixed-Point Relational Macros

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-45 AutoCode Reference3. Copy a block of local data into shared data:UPDATE_M

Page 62 - Some Relevant Issues

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-46 ni.com• SLONG stands for signed long. •ULONG stands for unsigned long. The naming convent

Page 63

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-47 AutoCode ReferenceUPDATE_MBUFF_WITH_MBUFUSHORT(x, y, convert_macro_name)U

Page 64 - Supplied Templates

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-48 ni.comExample 5-21 shows template code to generate the required structure and pointer. Al

Page 65

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-49 AutoCode Reference/**** declare pointer to shared variables ****/volatile

Page 66 - (or sa_utils.ada), the

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-50 ni.comShared Memory Callout OptionAutoCode supports a shared memory callout for all acces

Page 67 - Data Types

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-51 AutoCode Reference proc2_4_2 = Read_Shared_Varblk_Float(&isi_varblk

Page 68

Chapter 1 Introduction© National Instruments Corporation 1-3 AutoCode ReferenceStructure and Content of the Generated CodeThis reference includes deta

Page 69 - Error Procedure( ) Procedure

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-52 ni.comThe formal argument represents the global reference number for which the variable b

Page 70 - AutoCode Reference 3-8 ni.com

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-53 AutoCode ReferenceThe formal argument represents the global reference num

Page 71

Chapter 5 Generated Code ArchitectureAutoCode Reference 5-54 ni.comThe first formal argument represents which processor the access is taking place on.

Page 72 - External_Input ( ) Procedure

Chapter 5 Generated Code Architecture© National Instruments Corporation 5-55 AutoCode ReferenceThe following code uses the Enter_Shared_Varblk... synt

Page 73

© National Instruments Corporation 6-1 AutoCode Reference6Vectorized Code GenerationThis chapter discusses various ways to generate vectorized code. T

Page 74 - Calling UCBs

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-2 ni.comScalar Gain Block ExampleExample 6-1 shows the scalar code generated for a gain block

Page 75

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-3 AutoCode ReferencewhereY(i) is the ith outputU(i) is the ith inputGainParam

Page 76

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-4 ni.com if (SUBSYS_PREINIT[1]) { iinfo[0] = 0; iinfo[1] = 1; iin

Page 77

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-5 AutoCode Referenceaddition to issues with the standard block library, all g

Page 78 - Ada Fixed-Point Arithmetic

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-6 ni.comFigure 6-1. Poorly Connected Gain BlockExample 6-3 Generated Code for Poorly Connect

Page 79 - Instantiated Functions

Chapter 1 IntroductionAutoCode Reference 1-4 ni.comRelated PublicationsNational Instruments provides a complete library of publications to support its

Page 80 - Package Dependencies

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-7 AutoCode Reference /* ---------------------------- Gain Block */

Page 81

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-8 ni.comVector Labels and NamesThe SuperBlock Editor lets you give a name to a range of signa

Page 82

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-9 AutoCode ReferenceFigure 6-2. Example Model DiagramExample 6-4 Maximal Vec

Page 83 - Compilation Example

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-10 ni.com static struct _Subsys_1_states *X; static struct _Subsys_1_states *XD;

Page 84

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-11 AutoCode Reference } SUBSYS_PREINIT[1] = FALSE; re

Page 85 - Fixed-Point Type Declarations

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-12 ni.comExample 6-5 Mixed Vectorized Code Generation (for Figure 6-2)/******* System Ext I/O

Page 86

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-13 AutoCode Reference RT_FLOAT Brake; RT_FLOAT Gear; RT_FLOAT

Page 87

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-14 ni.com k = k + 1; } } k = 1; for (i=1; i<=5; i++) {

Page 88 - Operator Instantiations

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-15 AutoCode ReferenceNote The examples within this section assume maximal vec

Page 89

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-16 ni.com 1.2, 2.3, 3.4, 4.5, 5.6,

Page 90 - Sample Package

© National Instruments Corporation 2-1 AutoCode Reference2C Language ReferenceThis chapter discusses files used to interface AutoCode and the generate

Page 91

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-17 AutoCode ReferenceThe interesting part is that of the last gain block (gai

Page 92

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-18 ni.comFigure 6-4. Example of a Split VectorExample 6-7 Generated Code for Split Vector (f

Page 93 - Conversion Functions

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-19 AutoCode ReferenceThe two producer gain blocks (top, bottom) vectorize as

Page 94 - Explicit Rounding Conversion

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-20 ni.comExample 6-8 Generated Code (for Figure 6-5) /***** Output Update. *****/ /

Page 95

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-21 AutoCode ReferenceYou should notice two things in the code shown in Exampl

Page 96

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-22 ni.comFigure 6-6. Copy-Back ExampleExample 6-9 Generated Code (for Figure 6-6)void subsys

Page 97 - Known Ada Compiler Problems

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-23 AutoCode ReferenceEliminating Copy-BackThere are many design ways to elimi

Page 98 - No-Op Conversion Function

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-24 ni.comFigure 6-7. Vectorized Procedure InterfaceExample 6-10 Generated Code (for Figure 6

Page 99

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-25 AutoCode Reference top[-1+i] = R_P[-1+i]*U->gain_1[-1+i];

Page 100 - Operating Systems

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-26 ni.com INIT := TRUE; X := ptr_of(ss_1_states(0)’address); XD := pt

Page 101 - Table Syntax

Chapter 2 C Language ReferenceAutoCode Reference 2-2 ni.comStand-Alone LibraryThis section describes the system-specific and target-specific stand-alo

Page 102

Chapter 6 Vectorized Code Generation© National Instruments Corporation 6-27 AutoCode Reference------ Swap state pointers. ------ XTMP := X;

Page 103 - Subsystem Table

Chapter 6 Vectorized Code GenerationAutoCode Reference 6-28 ni.comMatrix OutputsWhen you provide matricized output labeling for a block, AutoCode gene

Page 104

© National Instruments Corporation 7-1 AutoCode Reference7Code OptimizationThis chapter explains the details of generating production quality code for

Page 105 - AutoCode Reference 4-6 ni.com

Chapter 7 Code OptimizationAutoCode Reference 7-2 ni.com static RT_INTEGER iinfo[4]; /***** Local Block Outputs. *****/ RT_FLOAT new_11_1; R

Page 106 - Processor IP Name Table

Chapter 7 Code Optimization© National Instruments Corporation 7-3 AutoCode ReferenceExample 7-2 Code Generated with Variable Block Optimization Turned

Page 107 - Using the Configuration File

Chapter 7 Code OptimizationAutoCode Reference 7-4 ni.com iinfo[1] = 0; } return; EXEC_ERROR: ERROR_FLAG[1] = iinfo[0]; iinfo[0]=0;}}AutoCode pe

Page 108

Chapter 7 Code Optimization© National Instruments Corporation 7-5 AutoCode ReferenceWrite to the same variable block. Due to the cyclic nature of loop

Page 109 - Generated Code Architecture

Chapter 7 Code OptimizationAutoCode Reference 7-6 ni.com static const RT_FLOAT _R_P[8] = {-1.0, 1.0, 1.5, 2.0, -1.0, 1.0, 1.25,1.4}; /***

Page 110 - Selection of a Signal Name

Chapter 7 Code Optimization© National Instruments Corporation 7-7 AutoCode Referencethe buffer _R_P and the initialization code are optimized away. In

Page 111 - Global Storage

Chapter 7 Code OptimizationAutoCode Reference 7-8 ni.comMerging INIT SectionsMost of the dynamic blocks have explicit initialization, output update an

Page 112 - -vbco option is not used

SupportWorldwide Technical Support and Product Informationni.comNational Instruments Corporate Headquarters11500 North Mopac Expressway Austin, Texas

Page 113 - Subsystems

Chapter 2 C Language Reference© National Instruments Corporation 2-3 AutoCode Reference• The principal file is sa_utils.c, the stand-alone utilities f

Page 114 - Interface Layers

Chapter 7 Code Optimization© National Instruments Corporation 7-9 AutoCode Reference /* ---------------------------- Time Delay */ /* {proc..22}

Page 115 - Sys_ExtIn and Sys_ExtOut, to

Chapter 7 Code OptimizationAutoCode Reference 7-10 ni.com X->proc_22_S1 = 0.0; X->proc_24_S1 = 0.0; XD->proc_22_S1 = 0.0; XD-

Page 116 - Sample and Hold

Chapter 7 Code Optimization© National Instruments Corporation 7-11 AutoCode ReferenceIn Example 7-5, both time delay blocks have separate INIT section

Page 117 - State Data

Chapter 7 Code OptimizationAutoCode Reference 7-12 ni.comExample 7-7 shows code generated without the reuse option, and Example 7-8 shows code generat

Page 118 - Copy Back and Duplicates

Chapter 7 Code Optimization© National Instruments Corporation 7-13 AutoCode Reference}Y->model_5_1 = X->model_5_S1;/* --------------------------

Page 119 - Standard Procedures

Chapter 7 Code OptimizationAutoCode Reference 7-14 ni.comAll of the blocks can accept constants as inputs. If any input is available during code gener

Page 120 - Referenced Percent Variables

Chapter 7 Code Optimization© National Instruments Corporation 7-15 AutoCode Reference/* {const..4} */Y->const_4_1 = 2.0*const_2_1;...Example 7-10

Page 121

Chapter 7 Code OptimizationAutoCode Reference 7-16 ni.cominput of the gain block and the expression 2.0 * const_2 is evaluated to 4 as the value of co

Page 122

Chapter 7 Code Optimization© National Instruments Corporation 7-17 AutoCode Referenceconstant block is optimized away, including the output variable.

Page 123 - U, Y, S, and I

Chapter 7 Code OptimizationAutoCode Reference 7-18 ni.comIf you have decided on the MatrixRightDivide block, the tips for optimizing the inputs are mu

Page 124

Chapter 2 C Language ReferenceAutoCode Reference 2-4 ni.comData TypesSeveral of the target-specific utilities are involved with data types (in the sa_

Page 125

Chapter 7 Code Optimization© National Instruments Corporation 7-19 AutoCode Reference SummaryAll of the optimizations discussed so far can be used at

Page 126 - Caller Identification

© National Instruments Corporation 8-1 AutoCode Reference8AutoCode Sim Cdelay SchedulerThis chapter discusses the Sim Cdelay low-latency scheduler.Int

Page 127 - Compatibility Issues

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-2 ni.comreal-time hardware. It assumes the reader is familiar with the concepts of AutoCod

Page 128 - Macro Procedure

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-3 AutoCode ReferenceStandard AutoCode SchedulerTo illustrate the behavior

Page 129 - Asynchronous Procedures

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-4 ni.comFigure 8-1. Model with Enabled and Triggered TasksUnder the default AutoCode sche

Page 130 - BlockScript Block

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-5 AutoCode ReferenceScheduler Pipeline section that these latencies are ca

Page 131 - Inputs and Outputs

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-6 ni.comtriggers/enables have gone high are queued for execution. Then, in stage D, ATR ta

Page 132 - Local Variables

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-7 AutoCode Referencequeue tasks stage for that scheduler invocation has al

Page 133

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-8 ni.comNow the inherent problem in the standard scheduler is clear. From launch to output

Page 134 - Default Phase

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-9 AutoCode ReferenceSim Cdelay SchedulerAs stated at the outset, the goal

Page 135 - Discrete Semantics

Chapter 2 C Language Reference© National Instruments Corporation 2-5 AutoCode Referenceto. For example, RT_INTEGER can be redefined as long int if ari

Page 136

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-10 ni.comtriggers arriving too quickly can prevent a task from ever posting any output.You

Page 137 - Loops and Scalar Code

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-11 AutoCode ReferenceFigure 8-6. New STD for ATR Triggered TasksFigure 8-

Page 138

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-12 ni.comThese transition diagrams, together with the diagrams in Chapter 4, Managing and

Page 139 - Types of Loops

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-13 AutoCode ReferenceDataStore Priority ProblemAs mentioned, you must find

Page 140

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-14 ni.comfor tsk <- low_prio_tsk..high_prio_tsk do { /* loop from low to high

Page 141 - Parameters

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-15 AutoCode ReferenceFigure 8-8. Latencies Present in the AutoCode Schedu

Page 142

Chapter 8 AutoCode Sim Cdelay SchedulerAutoCode Reference 8-16 ni.comAt the template level, the default Sim with Cdelay ATR triggered task behavior of

Page 143 - Dead Code Elimination

Chapter 8 AutoCode Sim Cdelay Scheduler© National Instruments Corporation 8-17 AutoCode Referencethat repeated until no new tasks where queued for exe

Page 144 - Special Directives

© National Instruments Corporation 9-1 AutoCode Reference9Global Scope Signals and Parameterless ProceduresThis chapter discusses global scope signals

Page 145 - UserCode Block

Chapter 9 Global Scope Signals and Parameterless ProceduresAutoCode Reference 9-2 ni.comThese new features address the following two uses:• Data Monit

Page 146 - Parameterized UCB Callout

Chapter 2 C Language ReferenceAutoCode Reference 2-6 ni.comThe sa_utils.c file contains comments about each of the routines as they are used for compa

Page 147 - Software Constructs

Chapter 9 Global Scope Signals and Parameterless Procedures© National Instruments Corporation 9-3 AutoCode Referencememory address, and that string is

Page 148 - Local Variable Block

Chapter 9 Global Scope Signals and Parameterless ProceduresAutoCode Reference 9-4 ni.comLimitationsThis section identifies some of the limitations of

Page 149 - Continuous Subsystem

Chapter 9 Global Scope Signals and Parameterless Procedures© National Instruments Corporation 9-5 AutoCode ReferenceParameterless ProcedureA parameter

Page 150 - Limitations

Chapter 9 Global Scope Signals and Parameterless ProceduresAutoCode Reference 9-6 ni.comNote NI suggests that you adopt a naming convention for all of

Page 151 - Shared Memory Architecture

Chapter 9 Global Scope Signals and Parameterless Procedures© National Instruments Corporation 9-7 AutoCode ReferenceCondition Block Code GenerationThe

Page 152 - Callout Naming Convention

Chapter 9 Global Scope Signals and Parameterless ProceduresAutoCode Reference 9-8 ni.comNote You must write template code to customize the declaration

Page 153 - Definitions and Conventions

Chapter 9 Global Scope Signals and Parameterless Procedures© National Instruments Corporation 9-9 AutoCode ReferenceConnection to External OutputIf a

Page 154 - From Shared Memory

Chapter 9 Global Scope Signals and Parameterless ProceduresAutoCode Reference 9-10 ni.comAnalyzer and AutoCode WarningsThe Analyzer reports questionab

Page 155 - option is not used

© National Instruments Corporation A-1 AutoCode ReferenceATechnical Support and Professional ServicesVisit the following sections of the National Inst

Page 156 - @offset = offset plus 1@@

© National Instruments Corporation I-1 AutoCode ReferenceIndexAadd and subtract macros, 2-40argumentsUCB-Ada fixed calling, 3-12UCB-C fixed calling, 2

Page 157

Chapter 2 C Language Reference© National Instruments Corporation 2-7 AutoCode ReferenceTwo error functions are provided, fatalerr( ) and error( ). The

Page 158 - ) data types

IndexAutoCode Reference I-2 ni.comcompile_ada_sa.sh compilation script, 3-11compile_c_sa.sh compilation script, 2-11compiling, 2-1condition block. See

Page 159 - Callout Pairs

Index© National Instruments Corporation I-3 AutoCode Reference_.a extension (Ada), 3-3compile_ada_sa.sh, 3-11compile_c_sa.sh, 2-11sa_defn.a, 3-4sa_def

Page 160 - syntax to call

IndexAutoCode Reference I-4 ni.combitwise functions, 3-26comparing to sim results, 3-35compilation example, 3-21compiler problems, 3-35conversion func

Page 161 - options

Index© National Instruments Corporation I-5 AutoCode ReferenceOlvarblk option, 7-4Onorestart option, 7-5propagating constants (Opc option), 7-13removi

Page 162

IndexAutoCode Reference I-6 ni.comdistributed memory architecture, 5-44mapping command options, 5-45shared memoryarchitecture, 5-43callouts, 5-44optim

Page 163

Index© National Instruments Corporation I-7 AutoCode ReferenceLlocal variable blocks, 5-40, 5-41local variables, 5-27Mmacro interface, 2-27files neede

Page 164

IndexAutoCode Reference I-8 ni.comRR_P, 5-9UCB fixed call argument, Ada, 3-12rapid prototyping, 1-2real-time codegenerating, 3-16real-time file, 3-16r

Page 165 - Scalar Gain Block Example

Index© National Instruments Corporation I-9 AutoCode Referencesa_fxdiv_long.c file, 2-32, 2-34sa_fxdiv_short.c file, 2-34sa_fxlimit.h file, 2-32, 2-33

Page 166 - Vectorized Gain Block Example

IndexAutoCode Reference I-10 ni.comshared memorycallouts, 5-50fixed-point calloutsAda, 5-47C, 5-46shared variable block support, 5-47simulation, stand

Page 167 - Array Subscripts

Index© National Instruments Corporation I-11 AutoCode Referencetemplate code for variable block structures, 5-48timing overflow, 2-8training and certi

Page 168 - Block Inputs

Chapter 2 C Language ReferenceAutoCode Reference 2-8 ni.comthe comments there and adjust the limits accordingly, then recompile and relink the sa_util

Page 169 - AutoCode Reference 6-6 ni.com

IndexAutoCode Reference I-12 ni.comXX (UCB fixed call argument)Ada, 3-12C, 2-13XD (UCB fixed call argument)Ada, 3-12C, 2-13XINPUT array, 2-10Xmath {ma

Page 170 - Vectorization Modes

Chapter 2 C Language Reference© National Instruments Corporation 2-9 AutoCode ReferenceImplementation_Initialize( ) Functionvoid Implementation_Initia

Page 171 - Vector Labels and Names

Chapter 2 C Language ReferenceAutoCode Reference 2-10 ni.comExternal_Input ( ) FunctionRT_INTEGER External_Input(void) External_Input( ) is for use in

Page 172

Chapter 2 C Language Reference© National Instruments Corporation 2-11 AutoCode ReferenceLinking Handwritten UCBs with AutoCode ApplicationsTo write co

Page 173

Chapter 2 C Language ReferenceAutoCode Reference 2-12 ni.comFigure 2-1. Example UserCode Function File (sa_user.c)The $ucb directive is recognized an

Page 174

Important InformationWarrantyThe media on which you receive National Instruments software are warranted not to fail to execute programming instructio

Page 175

Chapter 2 C Language Reference© National Instruments Corporation 2-13 AutoCode ReferenceImplementing Handwritten UCBsArguments are passed for each cal

Page 176

Chapter 2 C Language ReferenceAutoCode Reference 2-14 ni.comThe operations within UCBs are controlled by the argument INFO, a pointer to a structure o

Page 177 - Vectorization Features

Chapter 2 C Language Reference© National Instruments Corporation 2-15 AutoCode ReferenceFigure 2-2. Linking Handwritten UCBs with AutoCode Applicatio

Page 178

Chapter 2 C Language ReferenceAutoCode Reference 2-16 ni.comLinking Handwritten UCBs (for AutoCode) with SystemBuildAfter you have written a UCB to cr

Page 179

Chapter 2 C Language Reference© National Instruments Corporation 2-17 AutoCode ReferenceFigure 2-3. Linking Handwritten UCBs with the SystemBuild Sim

Page 180 - Split Vector

Chapter 2 C Language ReferenceAutoCode Reference 2-18 ni.comapplications, make sure you adapt the same algorithm in the body of a function using the A

Page 181

Chapter 2 C Language Reference© National Instruments Corporation 2-19 AutoCode ReferenceAs previously stated, the inputs and outputs of the UCB will h

Page 182

Chapter 2 C Language ReferenceAutoCode Reference 2-20 ni.comLinking a Variable Interface UCB with the SimulatorUnlike the fixed interface which provid

Page 183

Chapter 2 C Language Reference© National Instruments Corporation 2-21 AutoCode Referenceproc_ucb_hook. Refer to the Template Programming Language User

Page 184 - Copy-Back

Chapter 2 C Language ReferenceAutoCode Reference 2-22 ni.comLinking Procedures with Real-Time Applications or SimulatorGenerate reusable procedures fr

Page 185

ConventionsThe following conventions are used in this manual:<> Angle brackets that contain numbers separated by an ellipsis represent a range o

Page 186 - Other Copy-Back Scenarios

Chapter 2 C Language Reference© National Instruments Corporation 2-23 AutoCode Reference3. Create an object of type _procedure name_s where the states

Page 187

Chapter 2 C Language ReferenceAutoCode Reference 2-24 ni.compoint to the appropriate global variables. A pointer to this object will be passed as argu

Page 188

Chapter 2 C Language Reference© National Instruments Corporation 2-25 AutoCode Referenceproperly. Refer to the SystemBuild User Guide for an explanati

Page 189

Chapter 2 C Language ReferenceAutoCode Reference 2-26 ni.comdata-typed variables reflecting each subsystem input signal and type. The outputs to the s

Page 190

Chapter 2 C Language Reference© National Instruments Corporation 2-27 AutoCode Referencenumber—for each integer item and the sign are managed by the c

Page 191 - Matrix Outputs

Chapter 2 C Language ReferenceAutoCode Reference 2-28 ni.comlanguage and replace the supplied macros (or functions) with your (assembly) functions so

Page 192 - Code Optimization

Chapter 2 C Language Reference© National Instruments Corporation 2-29 AutoCode ReferenceA typical fixed-point type looks like the following:RT_USHORT0

Page 193 - AutoCode Reference 7-2 ni.com

Chapter 2 C Language ReferenceAutoCode Reference 2-30 ni.com RT_SSHORT05 SS5; RT_SSHORT SS0; RT_SSHORT05 SS5_1;};struct _Sys_ExtIn { RT_USHORT13 US13;

Page 194

Chapter 2 C Language Reference© National Instruments Corporation 2-31 AutoCode ReferenceThe UTs appear as typedef statements in the generated C code.

Page 195 - AutoCode Reference 7-4 ni.com

Chapter 2 C Language ReferenceAutoCode Reference 2-32 ni.comMacro InterfaceThe macro interface files are:sa_types.h Updated to include fixed-point typ

Page 196 - Restart Capability

© National Instruments Corporation v AutoCode ReferenceContentsChapter 1IntroductionManual Organization ...

Page 197 - AutoCode Reference 7-6 ni.com

Chapter 2 C Language Reference© National Instruments Corporation 2-33 AutoCode Referencesa_fx_externs.c Contains definitions for extern variables such

Page 198

Chapter 2 C Language ReferenceAutoCode Reference 2-34 ni.comsa_fxsub_byte.c Contains fixed-point subtraction functions for byte data type.sa_fxsub_sho

Page 199 - Merging INIT Sections

Chapter 2 C Language Reference© National Instruments Corporation 2-35 AutoCode ReferenceFixed-Point Conversion and Arithmetic MacrosAlthough this sect

Page 200

Chapter 2 C Language ReferenceAutoCode Reference 2-36 ni.comFigures 2-6 through 2-8 show how the conversion macros are named. Notice that macro names

Page 201

Chapter 2 C Language Reference© National Instruments Corporation 2-37 AutoCode ReferenceFigure 2-7. AutoCode/C Conversion Macros for Fixed-to-Integer

Page 202 - -Oreuse 1

Chapter 2 C Language ReferenceAutoCode Reference 2-38 ni.comArithmetic MacrosThe arithmetic macros perform addition, subtraction, multiplication, and

Page 203

Chapter 2 C Language Reference© National Instruments Corporation 2-39 AutoCode ReferenceTable 2-7 shows permissible operand and result sizes for the a

Page 204 - Constant Propagation

Chapter 2 C Language ReferenceAutoCode Reference 2-40 ni.comImplementation of the Addition and Subtraction MacrosAutoCode has two implementations of t

Page 205

Chapter 2 C Language Reference© National Instruments Corporation 2-41 AutoCode ReferenceAlign the radix positions of n1 and n2 to the radix position o

Page 206

Chapter 2 C Language ReferenceAutoCode Reference 2-42 ni.com0^1111111 (n2' = (127,r7), decimal value = .9921875)___________0^0000000 (n3 = (0,r7)

Page 207 - Optimizing with Matrix Blocks

ContentsAutoCode Reference vi ni.comLinking Procedures with Real-Time Applications or Simulator ... 2-22Invoking Generated Procedures

Page 208

Chapter 2 C Language Reference© National Instruments Corporation 2-43 AutoCode Referencethe maximum possible value representable in 32 bits—is returne

Page 209

Chapter 2 C Language ReferenceAutoCode Reference 2-44 ni.comin terms of speed, but is needed to compute an accurate result. By changing this behavior,

Page 210

Chapter 2 C Language Reference© National Instruments Corporation 2-45 AutoCode ReferenceFor example, the macro to check an 8-bit unsigned number and a

Page 211 - AutoCode Sim Cdelay Scheduler

© National Instruments Corporation 3-1 AutoCode Reference3Ada Language ReferenceThis chapter discusses files used to interface AutoCode and the genera

Page 212 - Task Posting Policies

Chapter 3 Ada Language ReferenceAutoCode Reference 3-2 ni.com Supplied Templatesada_rt.tpl TemplateThe ada_rt.tpl template is the default when generat

Page 213 - Standard AutoCode Scheduler

Chapter 3 Ada Language Reference© National Instruments Corporation 3-3 AutoCode ReferenceStand-Alone LibraryThis section describes the system-specific

Page 214 - AutoCode Reference 8-4 ni.com

Chapter 3 Ada Language ReferenceAutoCode Reference 3-4 ni.com• The principal file is sa_utils.a (or sa_utils.ada), the stand-alone utilities file. Whe

Page 215 - Scheduler Pipeline

Chapter 3 Ada Language Reference© National Instruments Corporation 3-5 AutoCode Referencefloating-point MATH_LIB. The sa_time.a/.ada file provides the

Page 216 - AutoCode Reference 8-6 ni.com

Chapter 3 Ada Language ReferenceAutoCode Reference 3-6 ni.comTarget-Specific UtilitiesThe target-specific utilities in the sa_utils.a or sa_utils.ada

Page 217

Chapter 3 Ada Language Reference© National Instruments Corporation 3-7 AutoCode ReferenceThe sa_utils.a or sa_utils.ada file contains comments about e

Page 218 - AutoCode Reference 8-8 ni.com

Contents© National Instruments Corporation vii AutoCode ReferenceExternal_Input ( ) Procedure...

Page 219 - Sim Cdelay Scheduler

Chapter 3 Ada Language ReferenceAutoCode Reference 3-8 ni.comRefer to the Chapter 14, UserCode Blocks, of the SystemBuild User Guide or the source lis

Page 220

Chapter 3 Ada Language Reference© National Instruments Corporation 3-9 AutoCode ReferenceBy default, several error conditions are trapped in the proce

Page 221

Chapter 3 Ada Language ReferenceAutoCode Reference 3-10 ni.comThese messages indicate that the sizes of the time vector and input array have exceeded

Page 222 - Implementation Details

Chapter 3 Ada Language Reference© National Instruments Corporation 3-11 AutoCode ReferenceExternal_Input( ) is much the same; it returns an input vect

Page 223 - DataStore Priority Problem

Chapter 3 Ada Language ReferenceAutoCode Reference 3-12 ni.comCalling UCBsEvery one of the following arguments will be passed for each call to the UCB

Page 224

Chapter 3 Ada Language Reference© National Instruments Corporation 3-13 AutoCode ReferenceThe operations within UCBs are controlled by the INFO argume

Page 225

Chapter 3 Ada Language ReferenceAutoCode Reference 3-14 ni.comProcedure SuperBlocksThis section describes how to generate and link Procedure SuperBloc

Page 226

Chapter 3 Ada Language Reference© National Instruments Corporation 3-15 AutoCode Reference------------------------------------------------------------

Page 227

Chapter 3 Ada Language ReferenceAutoCode Reference 3-16 ni.comAda Fixed-Point ArithmeticThis section describes the implementation of fixed-point arith

Page 228 - Parameterless Procedures

Chapter 3 Ada Language Reference© National Instruments Corporation 3-17 AutoCode ReferenceFixed-Point Data TypesFixed-point type declarations exist in

Page 229 - Data Monitoring/Injection

ContentsAutoCode Reference viii ni.comChapter 4Generating Code for Real-Time Operating SystemsReal-Time Operating System Configuration File...

Page 230

Chapter 3 Ada Language ReferenceAutoCode Reference 3-18 ni.comPackage DependenciesThe fixed-point AutoCode/Ada architecture forces a dependency among

Page 231 - AutoCode Reference 9-4 ni.com

Chapter 3 Ada Language Reference© National Instruments Corporation 3-19 AutoCode ReferenceGenerated Code with Fixed-Point VariablesFixed-point arithme

Page 232 - Parameterless Procedure

Chapter 3 Ada Language ReferenceAutoCode Reference 3-20 ni.comSystem-Level Parameters to Generate User TypesTable 3-6 describes new system-level param

Page 233 - Global Output Connection

Chapter 3 Ada Language Reference© National Instruments Corporation 3-21 AutoCode Referencefrequently overflowing, a different data type should be sele

Page 234

Chapter 3 Ada Language ReferenceAutoCode Reference 3-22 ni.com1. Build a model—Use the SuperBlock Editor to construct a model that uses fixed-point ty

Page 235 - SystemBuild Simulator

Chapter 3 Ada Language Reference© National Instruments Corporation 3-23 AutoCode Reference4. Compile the generated files—Two source files are generate

Page 236 - Explicit Sequencing

Chapter 3 Ada Language ReferenceAutoCode Reference 3-24 ni.comTable 3-9. Generic Function SummaryFunction Name PurposeFIXED_ADDAddition of two fixed-

Page 237 - Command Options

Chapter 3 Ada Language Reference© National Instruments Corporation 3-25 AutoCode ReferenceLONGINTCASTFixed-point value to RT_LONG_INTEGER conversion.L

Page 238 - Professional Services

Chapter 3 Ada Language ReferenceAutoCode Reference 3-26 ni.comBit-Wise FunctionsA restricted set of bit-wise operations have been defined for certain

Page 239

Chapter 3 Ada Language Reference© National Instruments Corporation 3-27 AutoCode ReferenceConversion Function InstantiationsThe RT_FIXED_OPERATORS pac

Page 240 - AutoCode Reference I-2 ni.com

Contents© National Instruments Corporation ix AutoCode ReferenceSystem External Interface Layer ...

Page 241

Chapter 3 Ada Language ReferenceAutoCode Reference 3-28 ni.comSample PackageExample 3-3 shows a generated RT_FIXED_OPERATORS package.Example 3-3 Gener

Page 242 - AutoCode Reference I-4 ni.com

Chapter 3 Ada Language Reference© National Instruments Corporation 3-29 AutoCode Referencefunction “>=” is new SA_FIXED_GENERICS.GREATEREQUAL(SA_FI

Page 243

Chapter 3 Ada Language ReferenceAutoCode Reference 3-30 ni.comThe selection of the intermediate type is performed by the code generator. The selection

Page 244 - AutoCode Reference I-6 ni.com

Chapter 3 Ada Language Reference© National Instruments Corporation 3-31 AutoCode ReferenceMultiplication and Division FunctionsThe predefined multipli

Page 245

Chapter 3 Ada Language ReferenceAutoCode Reference 3-32 ni.comno chance of overflow. To support these issues there are three types of conversion funct

Page 246 - AutoCode Reference I-8 ni.com

Chapter 3 Ada Language Reference© National Instruments Corporation 3-33 AutoCode ReferenceFor these types of conversions, the language-defined convers

Page 247

Chapter 3 Ada Language ReferenceAutoCode Reference 3-34 ni.comThe data in the sp_fxp parameters represent the operators and conversion used in the cur

Page 248

Chapter 3 Ada Language Reference© National Instruments Corporation 3-35 AutoCode ReferenceKnown Ada Compiler ProblemsThe architecture of AutoCode/Ada

Page 249

Chapter 3 Ada Language ReferenceAutoCode Reference 3-36 ni.com• Floating-Point Textual Representation—The values generated from a stand-alone simulati

Page 250

Chapter 3 Ada Language Reference© National Instruments Corporation 3-37 AutoCode ReferenceExample 3-6 Example Code Causing Ambiguous Selection of Over

Commentaires sur ces manuels

Pas de commentaire