Main Content

ssSetOperatingPointCompliance

Specify the behavior of a金宝appS-function when saving and restoring the operating point of a model containing the S-function

Since R2019a

Syntax

void ssSetOperatingPointCompliance(S, setting)

Arguments

S

SimStruct that represents an S-function block.

setting

Define how to treat an S-function simulation state when saving and restoring the model simulation state. Permissible values are:

  • OPERATING_POINT_COMPLIANCE_UNKNOWN(default value)

  • USE_DEFAULT_OPERATING_POINT

  • USE_EMPTY_OPERATING_POINT

  • DISALLOW_OPERATING_POINT

  • USE_CUSTOM_OPERATING_POINT

Description

ssSetOperatingPointComplianceallows you to specify how Simulink®should treat an S-function during a save and restore of the model simulation snapshot (ModelOperatingPoint).

If the S-function does not specify itsOperatingPointCompliance,然后模型假设金宝appOPERATING_POINT_COMPLIANCE_UNKNOWNsetting. This setting instructs Simulink to issue a warning and then switch toUSE_DEFAULT_OPERATING_POINTin lieu of theOPERATING_POINT_COMPLIANCE_UNKNOWN.

If the option is set toOP_COMPLIANCE_DEFAULTand if the S-function does not usePWorks, then Simulink treats the S-function like a built-in block. Simulink saves and restores the same data as the operating point (for example continuous states, non-scratch DWork vectors, and zero crossing signal information), as it would for a built-in block. If S-function has Pworks, not setting compliance results in an error on saving operating point. Use custom compliance,USE_CUSTOM_OPERATING_POINT, to save data in Pworks.

Languages

C, C++

Examples

Use thessSetOperatingPointCompliancefunction to specify the simulation state compliance of an S-function in themdlInitializeSizesmethod. The specification is based on the first character vector parameter value.

static void mdlInitializeSizes(SimStruct* S) { ssSetNumSFcnParams(S, 2); /* two parameters */ if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) return; ssSetSFcnParamTunable(S, 0, false); ssSetSFcnParamTunable(S, 1, false); { boolean_T visibility = 0U; ssSimStateCompliance setting = GetSimSnapParameterSetting(S, &visibility); if (ssGetErrorStatus(S)) return; ssSetOperatingPointCompliance(S, setting); ssSetOperatingPointVisibility(S, visibility); }

Version History

Introduced in R2019a