EMI_CB_InitializeModel (EMI Function)
- Updated2023-03-14
- 1 minute(s) read
EMI_CB_InitializeModel (EMI Function)
Owning Class: Callbacks
Requires: Control Design and Simulation Module
Prototype
void EMI_CB_InitializeModel(emiRef model);
Description
Initializes parts, such as the states, limits, and zero-crossings, of an external model. You can use this function to perform initialization tasks such as initializing states, setting discrete states to parameter values, specifying limits for continuous states, and configuring offsets for detecting zero crossings. The LabVIEW Control Design and Simulation Module calls this function immediately before simulating the model.
Inputs
| Name | Description |
|---|---|
| model | Specifies a reference to the external model. Use this reference as an input to other EMI functions. Do not modify model directly. |
Examples
void EMI_CB_InitializeModel(emiRef model) {
double* xc = EMI_GetInitialContinuousStates(model);
const double* p = EMI_GetParam(model, 1);
/* initialize the third continuous state to the value of the fourth element of the second parameter */
xc[2] = p[3];
}