LabVIEW Control Design and Simulation Module

EMI_AddScalarParam (EMI Function)

  • Updated2023-03-14
  • 1 minute(s) read

EMI_AddScalarParam (EMI Function)

Owning Class: Parameters

Requires: Control Design and Simulation Module

Prototype

void EMI_AddScalarParam(emiRef model, const char* termName, emiParamSourceType sourceType, double initValue);

Description

Adds a scalar 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.

Examples

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 value of the parameter.

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);
}

Related Topics

EMI_AddVectorParam
EMI_CB_ModelInterface
emiParamSourceType

Log in to get a better experience