|
External code initiates execution of the generated code by calling entry-point functions generated for the model. The type of function code that the code generator produces for a model depends on the modeling style and periodic rates represented in the model. For more information, see Configure Generated C Function Interface for Model Entry-Point Functions |
2.1 Initialize FunctionsInitialize entry-point functions implement startup behavior. In a model, Initialize Function blocks represent startup behavior explicitly. ADM_Integrated_Logic_initializeInitialization entry point of generated code#include "ADM_Integrated_Logic.h"
void ADM_Integrated_Logic_initialize(void)
2.2 Terminate FunctionsTerminate entry-point functions implement shutdown behavior. In a model, Terminate Function blocks represent shutdown behavior explicitly. No terminate functions represented in model. 2.3 Periodic FunctionsPeriodic entry-point functions implement model behavior that occurs at a fixed sampling rate. For a rate-based model, the code generator produces a periodic entry-point function for each rate used in the model. In a function-call (export-function) model, Function Call Subsystem blocks that specify a sampling rate represent periodic functions. ADM_Integrated_Logic_stepOutput entry point of generated code. Must be called periodically, every 0.002 seconds.#include "ADM_Integrated_Logic.h"
void ADM_Integrated_Logic_step(void)
2.4 Aperiodic FunctionsAperiodic (asynchronous) entry-point functions implement component behavior occurring asynchronously. In a function-call (export-function) model, Function Call Subsystem blocks that do not specify a sampling rate represent aperiodic functions. No aperiodic functions represented in model. |
|
A data code interface maps model data interface elements, such as root-level inports and outports, to storage classes. A storage class specifies the appearance and placement of data elements in the generated code. Storage classes apply direct-access data communication. The list of storage classes available for mapping is determined by the Embedded Coder Dictionary that is associated with the model. You map model interface elements to storage classes in the model code mappings. |
3.1 InportsInputs are variables that are generated in the code based on storage class specifications for model root-level input ports.ADM_Integrated_Logic_U.GV_MCU_RPMInput data for <Root>/GV_MCU_RPMstruct {
...
double GV_MCU_RPM;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_BrakeTorqueCommandInput data for <Root>/GV_BrakeTorqueCommandstruct {
...
double GV_BrakeTorqueCommand;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_IMU_AX_ValInput data for <Root>/GV_IMU_AX_Valstruct {
...
double GV_IMU_AX_Val;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_IMU_AY_ValInput data for <Root>/GV_IMU_AY_Valstruct {
...
double GV_IMU_AY_Val;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_IMU_AZ_ValInput data for <Root>/GV_IMU_AZ_Valstruct {
...
double GV_IMU_AZ_Val;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_IMU_PitchRtValInput data for <Root>/GV_IMU_PitchRtValstruct {
...
double GV_IMU_PitchRtVal;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_Vx_CommandInput data for <Root>/GV_Vx_Commandstruct {
...
double GV_Vx_Command;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_VCU_GearSelStatInput data for <Root>/GV_VCU_GearSelStatstruct {
...
double GV_VCU_GearSelStat;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_MCU_EstTrqInput data for <Root>/GV_MCU_EstTrqstruct {
...
double GV_MCU_EstTrq;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_Vx_LimitInput data for <Root>/GV_Vx_Limitstruct {
...
double GV_Vx_Limit;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_Vx_FbkInput data for <Root>/GV_Vx_Fbkstruct {
...
double GV_Vx_Fbk;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_RWA_RackAngleCommandInput data for <Root>/GV_RWA_RackAngleCommandstruct {
...
double GV_RWA_RackAngleCommand;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_RWS_RackAngleCommandInput data for <Root>/GV_RWS_RackAngleCommandstruct {
...
double GV_RWS_RackAngleCommand;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_Drive_ModeInput data for <Root>/GV_Drive_Modestruct {
...
double GV_Drive_Mode;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_ACU_Fault_FlagInput data for <Root>/GV_ACU_Fault_Flagstruct {
...
double GV_ACU_Fault_Flag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_MCU_Actuator_Fault_FlagInput data for <Root>/GV_MCU_Actuator_Fault_Flagstruct {
...
double GV_MCU_Actuator_Fault_Flag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_IDB_ECU_Fault_FlagInput data for <Root>/GV_IDB_ECU_Fault_Flagstruct {
...
double GV_IDB_ECU_Fault_Flag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_RCU_ECU_Fault_FlagInput data for <Root>/GV_RCU_ECU_Fault_Flagstruct {
...
double GV_RCU_ECU_Fault_Flag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_RWA1_ECU_Fault_FlagInput data for <Root>/GV_RWA1_ECU_Fault_Flagstruct {
...
double GV_RWA1_ECU_Fault_Flag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_RWA2_ECU_Fault_FlagInput data for <Root>/GV_RWA2_ECU_Fault_Flagstruct {
...
double GV_RWA2_ECU_Fault_Flag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_RWA_Actuator_FaultInput data for <Root>/GV_RWA_Actuator_Faultstruct {
...
double GV_RWA_Actuator_Fault;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_ACU_ECU_Fault_FlagInput data for <Root>/GV_ACU_ECU_Fault_Flagstruct {
...
double GV_ACU_ECU_Fault_Flag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_ACU_ECU_Fault_Flag1Input data for <Root>/GV_ACU_ECU_Fault_Flag1struct {
...
double GV_ACU_ECU_Fault_Flag1;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_ACU_ECU_Fault_Flag2Input data for <Root>/GV_ACU_ECU_Fault_Flag2struct {
...
double GV_ACU_ECU_Fault_Flag2;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_ACU_ECU_Fault_Flag3Input data for <Root>/GV_ACU_ECU_Fault_Flag3struct {
...
double GV_ACU_ECU_Fault_Flag3;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_Drive_ACC_CmdInput data for <Root>/GV_Drive_ACC_Cmdstruct {
...
double GV_Drive_ACC_Cmd;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_VCU_AccControlFlagInput data for <Root>/GV_VCU_AccControlFlagstruct {
...
double GV_VCU_AccControlFlag;
...
} ADM_Integrated_Logic_U;
ADM_Integrated_Logic_U.GV_VCU_Acc_LimitInput data for <Root>/GV_VCU_Acc_Limitstruct {
...
double GV_VCU_Acc_Limit;
...
} ADM_Integrated_Logic_U;
3.2 OutportsOutputs are variables that are generated in the code based on storage class specifications for model root-level output ports.ADM_Integrated_Logic_Y.GV_Brake_CommandOutput data for <Root>/GV_Brake_Commandstruct {
...
double GV_Brake_Command;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_Master_Rack_Angle_CmdOutput data for <Root>/GV_Master_Rack_Angle_Cmdstruct {
...
double GV_Master_Rack_Angle_Cmd;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_Hill_Torque_AssistOutput data for <Root>/GV_Hill_Torque_Assiststruct {
...
double GV_Hill_Torque_Assist;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_Motor_Torque_CmdOutput data for <Root>/GV_Motor_Torque_Cmdstruct {
...
double GV_Motor_Torque_Cmd;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Debug_HAC_FLAGOutput data for <Root>/Debug_HAC_FLAGstruct {
...
double Debug_HAC_FLAG;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Debug_HAC_RPM_DecisionOutput data for <Root>/Debug_HAC_RPM_Decisionstruct {
...
double Debug_HAC_RPM_Decision;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Debug_HAC_Pitch_angleOutput data for <Root>/Debug_HAC_Pitch_anglestruct {
...
double Debug_HAC_Pitch_angle;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Debug_HAC_Brake_OutputOutput data for <Root>/Debug_HAC_Brake_Outputstruct {
...
double Debug_HAC_Brake_Output;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Debug_CC_Brake_OutputOutput data for <Root>/Debug_CC_Brake_Outputstruct {
...
double Debug_CC_Brake_Output;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Debug_AccControl_TorqueCmdOutput data for <Root>/Debug_AccControl_TorqueCmdstruct {
...
double Debug_AccControl_TorqueCmd;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_RWS_RackAngleCmd1Output data for <Root>/GV_RWS_RackAngleCmd1struct {
...
double GV_RWS_RackAngleCmd1;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_Speed_LimitOutput data for <Root>/GV_Speed_Limitstruct {
...
double GV_Speed_Limit;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_Gear_Postion_OutOutput data for <Root>/GV_Gear_Postion_Outstruct {
...
double GV_Gear_Postion_Out;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Act_Fault_ExistOutput data for <Root>/Act_Fault_Existstruct {
...
double Act_Fault_Exist;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Target_RWA_OutOutput data for <Root>/Target_RWA_Outstruct {
...
double Target_RWA_Out;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Target_IDB_OutOutput data for <Root>/Target_IDB_Outstruct {
...
double Target_IDB_Out;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.Target_MCU_OutOutput data for <Root>/Target_MCU_Outstruct {
...
double Target_MCU_Out;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_VCU_EstMassOutput data for <Root>/GV_VCU_EstMassstruct {
...
double GV_VCU_EstMass;
...
} ADM_Integrated_Logic_Y;
ADM_Integrated_Logic_Y.GV_VCU_EstMassFlagOutput data for <Root>/GV_VCU_EstMassFlagstruct {
...
double GV_VCU_EstMassFlag;
...
} ADM_Integrated_Logic_Y;
3.3 ParametersParameters are variables in the generated code that represent model parameters and model parameter arguments. The variable is generated based on a storage class specification and flagged to be tunable or not tunable while the model code executes in the target environment.No interface or tunable parameters in the model. 3.4 Internal dataInternal data are variables in the generated code that represent signal data, blocks that have internal states, and data stores. The variable is generated based on a storage class specification and flagged to be measured or not measured while the model code executes in the target environment.No global data stores or data stores with non-auto storage classes in the model. |