slConfigUIGetVal

Return current value for custom target configuration option

Syntax

value = slConfigUIGetVal(hDlg,hSrc,'OptionName')

Input Arguments

hDlg

Handle created in the context of a SelectCallback function and used by the System Target File Callback Interface functions. Pass this variable but do not set it or use it for another purpose.

hSrc

Handle created in the context of a SelectCallback function and used by the System Target File Callback Interface functions. Pass this variable and use it to refresh the Configuration Parameters dialog box. Do not set it or use it for another purpose.

'OptionName'

Quoted name of the TLC variable defined for a custom target configuration option.

Output Arguments

Current value of the specified option. The data type of the return value depends on the data type of the option.

Description

The slConfigUIGetVal function is used in the context of a user-written SelectCallback function, which is triggered when you:

  • Load the model.

  • Update configuration settings in the Configuration Parameters dialog box.

  • Build the model.

You use slConfigUIGetVal to read the current value of a specified target option.

Examples

In the following example, the slConfigUIGetVal function returns the value of the Configuration Parameters > Code Generation > Interface > Advanced parameters > Terminate function required option.

function usertarget_selectcallback(hDlg,hSrc)

  disp(['*** Select callback triggered:',sprintf('\n'), ...
        '  Uncheck and disable "Terminate function required".']);

  disp(['Value of IncludeMdlTerminateFcn was ', ...
        slConfigUIGetVal(hDlg,hSrc,'IncludeMdlTerminateFcn')]);

  slConfigUISetVal(hDlg,hSrc,'IncludeMdlTerminateFcn','off');
  slConfigUISetEnabled(hDlg,hSrc,'IncludeMdlTerminateFcn',false);
  hSrc.refreshDialog;
Introduced in R2006b