National-instruments AutoCode NI MATRIX Instrukcja Użytkownika

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Sprzęt komputerowy National-instruments AutoCode NI MATRIX. National Instruments AutoCode NI MATRIX User Manual Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 250
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów

Podsumowanie treści

Strona 1 - NI MATRIXx

NI MATRIXxTMAutoCodeTM ReferenceAutoCode ReferenceApril 2007370768C-01

Strona 2

ContentsAutoCode Reference x ni.comStates ...

Strona 3 - Important Information

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

Strona 4 - Conventions

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

Strona 5

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

Strona 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

Strona 7

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

Strona 8 - Chapter 5

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

Strona 9

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

Strona 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

Strona 11 - Vectorized Code Generation

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

Strona 12 - AutoCode Reference xii ni.com

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

Strona 13 - Appendix A

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

Strona 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

Strona 15 - Language-Specific Information

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

Strona 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

Strona 17 - Related Publications

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

Strona 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

Strona 19 - Stand-Alone Library

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

Strona 20

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

Strona 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

Strona 22 - Target-Specific Utilities

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

Strona 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

Strona 24

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

Strona 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

Strona 26

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

Strona 27 - UserCode Blocks

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

Strona 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_

Strona 29

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

Strona 30 - Implementing Handwritten UCBs

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

Strona 31

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

Strona 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

Strona 33

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

Strona 34 - Function Name: usr_dsp

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

Strona 35 - Interface Ordering

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

Strona 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

Strona 37 - Procedure SuperBlocks

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

Strona 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

Strona 39

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

Strona 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

Strona 41 - Function

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

Strona 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

Strona 43 - C Fixed-Point Arithmetic

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

Strona 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

Strona 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

Strona 46

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

Strona 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

Strona 48 - Stand-Alone Files

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

Strona 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

Strona 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

Strona 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

Strona 52 - Conversion Macros

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

Strona 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

Strona 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

Strona 55 - Arithmetic Macros

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

Strona 56

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

Strona 57

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

Strona 58

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

Strona 59 - 32-Bit Multiplication

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

Strona 60 - 32-Bit by 16-Bit Division

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

Strona 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

Strona 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

Strona 63

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

Strona 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

Strona 65

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

Strona 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

Strona 67 - Data Types

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

Strona 68

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

Strona 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

Strona 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

Strona 71

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

Strona 72 - External_Input ( ) Procedure

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

Strona 73

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

Strona 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

Strona 75

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

Strona 76

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

Strona 77

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

Strona 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

Strona 79 - Instantiated Functions

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

Strona 80 - Package Dependencies

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

Strona 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

Strona 82

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

Strona 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;

Strona 84

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

Strona 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

Strona 86

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

Strona 87

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

Strona 88 - Operator Instantiations

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

Strona 89

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

Strona 90 - Sample Package

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

Strona 91

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

Strona 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

Strona 93 - Conversion Functions

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

Strona 94 - Explicit Rounding Conversion

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

Strona 95

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

Strona 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

Strona 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

Strona 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

Strona 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];

Strona 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

Strona 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

Strona 102

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

Strona 103 - Subsystem Table

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

Strona 104

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

Strona 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

Strona 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

Strona 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

Strona 108

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

Strona 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}; /***

Strona 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

Strona 111 - Global Storage

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

Strona 112 - -vbco option is not used

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

Strona 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

Strona 114 - Interface Layers

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

Strona 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-

Strona 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

Strona 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

Strona 118 - Copy Back and Duplicates

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

Strona 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

Strona 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

Strona 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

Strona 122

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

Strona 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

Strona 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_

Strona 125

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

Strona 126 - Caller Identification

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

Strona 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

Strona 128 - Macro Procedure

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

Strona 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

Strona 130 - BlockScript Block

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

Strona 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

Strona 132 - Local Variables

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

Strona 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

Strona 134 - Default Phase

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

Strona 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

Strona 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

Strona 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-

Strona 138

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

Strona 139 - Types of Loops

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

Strona 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

Strona 141 - Parameters

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

Strona 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

Strona 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

Strona 144 - Special Directives

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

Strona 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

Strona 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

Strona 147 - Software Constructs

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

Strona 148 - Local Variable Block

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

Strona 149 - Continuous Subsystem

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

Strona 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

Strona 151 - Shared Memory Architecture

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

Strona 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

Strona 153 - Definitions and Conventions

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

Strona 154 - From Shared Memory

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

Strona 155 - option is not used

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

Strona 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

Strona 157

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

Strona 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

Strona 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

Strona 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

Strona 161 - options

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

Strona 162

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

Strona 163

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

Strona 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

Strona 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

Strona 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

Strona 167 - Array Subscripts

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

Strona 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

Strona 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

Strona 170 - Vectorization Modes

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

Strona 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

Strona 172

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

Strona 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

Strona 174

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

Strona 175

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

Strona 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

Strona 177 - Vectorization Features

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

Strona 178

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

Strona 179

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

Strona 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

Strona 181

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

Strona 182

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

Strona 183

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

Strona 184 - Copy-Back

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

Strona 185

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

Strona 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

Strona 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

Strona 188

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 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;

Strona 194

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

Strona 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

Strona 196 - Restart Capability

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

Strona 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

Strona 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

Strona 199 - Merging INIT Sections

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

Strona 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

Strona 201

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

Strona 202 - -Oreuse 1

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

Strona 203

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

Strona 204 - Constant Propagation

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

Strona 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

Strona 206

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

Strona 207 - Optimizing with Matrix Blocks

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

Strona 208

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

Strona 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,

Strona 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

Strona 211 - AutoCode Sim Cdelay Scheduler

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

Strona 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

Strona 213 - Standard AutoCode Scheduler

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

Strona 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

Strona 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

Strona 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

Strona 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

Strona 218 - AutoCode Reference 8-8 ni.com

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

Strona 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

Strona 220

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

Strona 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

Strona 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

Strona 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

Strona 224

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

Strona 225

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

Strona 226

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

Strona 227

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

Strona 228 - Parameterless Procedures

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

Strona 229 - Data Monitoring/Injection

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

Strona 230

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

Strona 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

Strona 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

Strona 233 - Global Output Connection

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

Strona 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

Strona 235 - SystemBuild Simulator

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

Strona 236 - Explicit Sequencing

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

Strona 237 - Command Options

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

Strona 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

Strona 239

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

Strona 240 - AutoCode Reference I-2 ni.com

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

Strona 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

Strona 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

Strona 243

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

Strona 244 - AutoCode Reference I-6 ni.com

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

Strona 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

Strona 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

Strona 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

Strona 248

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

Strona 249

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

Strona 250

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

Komentarze do niniejszej Instrukcji

Brak uwag