Chapter 2
C Language Reference
©
National Instruments Corporation
2-9
Implementation_Initialize( ) Function
void Implementation_Initialize (RT_FLOAT *BUS_IN
RT_INTEGER, NI, RT_FLOAT BUS_OUT, RT_INTEGER NO,
RT_FLOAT SCHEDULER_FREQ);
In the default version of
sa_utils.c
(simulation comparison), this
function initializes the I/O for the system by loading input data from the
user-furnished MATRIXx
FSAVE
input file. In the version of this routine
that you write to make the generated code work with the target computer,
this routine performs implementation-specific initialization processes for
the real-time system. These might include, but are not limited to, the
following:
•
Initialize the interrupt system of the target computer.
•
Initialize the math coprocessor, if any.
•
Set up shared memory and other hardware-dependent processes.
•
Initialize I/O hardware.
•
Initialize the clock-timer of the target system to request interrupts at
the minor cycle of the control system; that is, the time period required
between interrupts for synchronous operation of the tasks, as
calculated by AutoCode from the block diagrams.
Implementation_Terminate( ) Function
void Implementation_Terminate(void)
In the default version of
sa_utils.c
(simulation comparison), this
function completes the I/O processing for the execution of the system by
writing output data to the output file and closing the file. In the version of
this routine that you write to make the generated code work with the target
computer, this routine might be called on to perform many kinds of
implementation-specific shutdown processes for the real-time system in
addition to data completion tasks. These might include, but are not limited
to, the following:
•
Disable interrupt hardware.
•
Free up shared memory and other resources.
•
De-initialize I/O hardware.