EMI_GetInput (EMI Function)
- Updated2023-03-14
- 1 minute(s) read
EMI_GetInput (EMI Function)
Owning Class: Inputs
Requires: Control Design and Simulation Module
Prototype
const double* EMI_GetInput(emiRef model, unsigned int index);
Description
Returns a pointer to an input of an external 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. |
| index | Specifies the index of the input for which you want to return a pointer. |
Return Value
Returns a pointer to the input of the model corresponding to the index you specify.
Examples
/* return pointers to the first input and first output of the model */
const double* input = EMI_GetInput(model, 0);
double* output = EMI_GetOutput(model, 0);
/* set the output value to twice the input value */
output[0] = 2 * input[0];