Documentation Center

  • Trial Software
  • Product Updates

Contents

Simulink.BlockDiagram.getChecksum

Return checksum of model

Syntax

[checksum,details] = Simulink.BlockDiagram.getChecksum('model')

Description

[checksum,details] = Simulink.BlockDiagram.getChecksum('model') returns the checksum of the specified model. Simulink® software computes the checksum based on attributes of the model and the blocks the model contains.

One use of this command is to determine why the Accelerator mode in Simulink software regenerates code. For an example, see slAccelDemoWhyRebuildslAccelDemoWhyRebuild.

    Note:   Simulink.BlockDiagram.getChecksum compiles the specified model, if the model is not already in a compiled state.

This command accepts the argument model, which is the full name or handle of the model for which you are returning checksum data.

This command returns the following output:

  • checksum — Array of four 32-bit integers that represents the model's 128-bit checksum.

  • details — Structure of the form

    ContentsChecksum: [1x1 struct]
    InterfaceChecksum: [1x1 struct]
    ContentsChecksumItems: [nx1 struct]
    InterfaceChecksumItems: [mx1 struct]
    • ContentsChecksum — Structure of the following form that represents a checksum that provides information about all blocks in the model.

      Value: [4x1 uint32]
      MarkedUnique: [bool]
      • Value — Array of four 32-bit integers that represents the model's 128-bit checksum.

      • MarkedUnique — True if any blocks in the model have a property that prevents code reuse.

    • InterfaceChecksum — Structure of the following form that represents a checksum that provides information about the model.

      Value: [4x1 uint32]
      MarkedUnique: [bool]
      • Value — Array of four 32-bit integers that represents the model's 128-bit checksum.

      • MarkedUnique — Always true. Present for consistency with ContentsChecksum structure.

    • ContentsChecksumItems and InterfaceChecksumItems — Structure arrays of the following form that contain information that Simulink software uses to compute the checksum for ContentsChecksum and InterfaceChecksum, respectively:

      Handle: [char array]
      Identifier: [char array]
      Value: [type]
      
      • Handle — Object for which Simulink software added an item to the checksum. For a block, the handle is a full block path. For a block port, the handle is the full block path and a string that identifies the port.

      • Identifier — Descriptor of the item Simulink software added to the checksum. If the item is a documented parameter, the identifier is the parameter name.

      • Value — Value of the item Simulink software added to the checksum. If the item is a parameter, Value is the value returned by

        get_param(handle, identifier)

Tip

The structural checksum reflects changes to the model that can affect the simulation results, including:

  • Changing the solver type, for example from Variable-step to Fixed-step

  • Adding or deleting blocks or connections between blocks

  • Changing the values of nontunable block parameters, for example, the Seed parameter of the Random Number block

  • Changing the number of inputs or outputs of blocks, even if the connectivity is vectorized

  • Changing the number of states or the initial states in the model

  • Selecting a different function in the Trigonometric Function block

  • Changing signs used in a Sum block

  • Adding a Target Language Compiler (TLC) file to inline an S-function

Examples of model changes that do not affect the structural checksum include:

  • Changing the position of a block

  • Changing the position of a line

  • Resizing a block

  • Adding, removing, or changing a model annotation

See Also

Was this topic helpful?