Return checksum of nonvirtual subsystem
[checksum,details] = Simulink.SubSystem.getChecksum(subsys)
[checksum,details] = Simulink.SubSystem.getChecksum(subsys) returns the checksum of the specified nonvirtual subsystem. Simulink® software computes the checksum based on the subsystem parameter settings and the blocks the subsystem contains.
One use of this command is to determine why code generated for a subsystem is not being reused. For an example, see Determine Why Subsystem Code Is Not Reused in the Simulink Coder™ documentation.
Note: Simulink.SubSystem.getChecksum compiles the model that contains the specified subsystem, if the model is not already in a compiled state. If you need to get the checksum for multiple subsystems and want to avoid multiple compiles, use the command , model(, , , 'compile') to place the model in a compiled state before using Simulink.SubSystem.getChecksum.
This command accepts the argument subsys, which is the full name or handle of the nonvirtual subsystem block for which you are returning checksum data.
This command returns the following output:
checksum — Structure of the form
Value: [4x1 uint32] MarkedUnique: [bool]
Value — Array of four 32-bit integers that represents the subsystem's 128-bit checksum.
MarkedUnique — True if the subsystem or the blocks it contains have properties that would prevent the code generated for the subsystem from being reused; otherwise, false.
details — Structure of the form
ContentsChecksum: [1x1 struct] InterfaceChecksum: [1x1 struct] ContentsChecksumItems: [nx1 struct] InterfaceChecksumItems: [mx1 struct]
ContentsChecksum — Structure of the same form as checksum, representing a checksum that provides information about all blocks in the system.
InterfaceChecksum — Structure of the same form as checksum, representing a checksum that provides information about the subsystem's block parameters and connections.
ContentsChecksumItems and InterfaceChecksumItems — Structure arrays of the following form 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
For information about the kinds of changes that affect the structural checksum, see the Simulink.BlockDiagram.getChecksum documentation.