Chapter 2
C Language Reference
2-26
ni.com
data-typed variables reflecting each subsystem input signal and type.
The outputs to the subsystem are provided by the argument
Y
, a pointer
to a structure named
_Subsys_
number_out
. This structure has mixed
data-typed variables reflecting each subsystem output signal and type.
The following overall steps need to be taken to invoke the subsystem
function:
1.
Create an object of type
_Subsys_1_in
(see generated subsystem
code) and copy in the inputs to the subsystem. A pointer to this object
will be passed as argument
U
to the subsystem.
2.
Create an object of type
_Subsys_1_out
where the outputs of the
subsystem will be stored. A pointer to this object will be passed as
argument
Y
to the subsystem.
3.
Invoke the procedure using pointers to the objects created in steps 1
and 2.
C Fixed-Point Arithmetic
Fixed-point calculations provide significant advantages over floating-point
arithmetic. These include:
•
Faster execution on most processors
•
8-bit, 16-bit, and 32-bit representations of fixed-point numbers
•
Ability to interface to inexpensive processors that do not support
floating-point arithmetic
This section describes the implementation of fixed-point arithmetic in
AutoCode/C.
Note
The
SystemBuild User Guide
has a fixed-point arithmetic chapter that explains the
basics of fixed-point arithmetic and the use of fixed-point arithmetic in SystemBuild
models.
Fixed-Point AutoCode/C Implementation
SystemBuild lets you represent vectors as fixed-point signals to which
fixed-point arithmetic will be applied. Refer to the
SystemBuild User
Guide
. Fixed-point signals and numbers are represented in AutoCode/C
as integer data types. An associated radix position—that is, the integer
marking the point that divides the integer and fractional part of the