LabVIEW Control Design and Simulation Module

EMI_CB_HandleCustomMenuItem (EMI Function)

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

EMI_CB_HandleCustomMenuItem (EMI Function)

Owning Class: Callbacks

Requires: Control Design and Simulation Module

Prototype

void EMI_CB_HandleCustomMenuItem(char* configParams, unsigned int menuItemIndex, char *modelHasChanged);

Description

Handles custom shortcut menu items for the External Model function that represents an external model. The LabVIEW Control Design and Simulation Module calls this function when a shortcut menu for the External Model function is selected. Use the EMI_AddMenuItem function to add custom shortcut menu items for the External Model function.

Examples

Inputs

Name Description
configParams Specifies any model configuration parameters that the user entered in the Select an External Model Library dialog box to define the model.
menuItemIndex Specifies the index of the selected custom shortcut menu item.

Outputs

Name Description
modelHasChanged Returns a non-zero value if the shortcut menu item modified the model. The External Model function updates to reflect changes to the model.

Examples

void EMI_CB_ModelInterface(emiRef model) {
   EMI_AddMenuItem(model, "First Menu"); /* assigned to index 0 */
   EMI_AddMenuItem(model, "Second Menu"); /* assigned to index 1 */
}

void EMI_CB_HandleCustomMenuItem(char* configParams, unsigned int menuItemIndex, char *modelHasChanged) {
   switch(menuItemIndex) {
      case 0:
         /* handle the first custom shortcut menu item */
         modelHasChanged = 0;
         break;
      case 1:
         /* handle the second custom shortcut menu item */
         modelHasChanged = 1;
         break;
   }
}

Related Topics

EMI_AddMenuItem

Log in to get a better experience