EMI_AddVectorParam (EMI Function)
- Updated2023-03-14
- 1 minute(s) read
EMI_AddVectorParam (EMI Function)
Owning Class: Parameters
Requires: Control Design and Simulation Module
Prototype
void EMI_AddVectorParam(emiRef model, char* termName, emiParamSourceType sourceType, double *initValue, long size)
Description
Adds a vector parameter for an external model. You can call this function only from the EMI_CB_ModelInterface function. LabVIEW stores scalar and vector parameters together in the order in which you add them.
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. |
| termName | Specifies the name of the parameter. |
| sourceType | Specifies whether to use a block diagram terminal or the configuration dialog box as the default source of the parameter in the corresponding External Model function. Use the emiParamSourceType data type to specify the source of the parameter. |
| initValue | Specifies the default values of the elements in the parameter array. |
| size | Specifies the number of elements in the parameter array. |
Examples
void EMI_CB_ModelInterface(emiRef model) {
double initVals[3] = {1.0, 2.0, 3.0};
EMI_AddScalarParam(model, "First Param", EMI_ParamSource_ConfigPage, 5.0);
EMI_AddVectorParam(model, "Second Param", EMI_ParamSource_ConfigPage, initVals, 3);
}