MATLAB: Is the user defined Simulink block updated when I use the SLUPDATE command

latchmasksimulinkslupdatetype

When I run the SLUPDATE command on my Simulink model, the model updates a user-defined block. This should not happen. My block has a mask type of 'Latch'. I find that the block is updated to an S-R flip-flop block.

Best Answer

The SLUPDATE command is working as intended and the observed behavior is as expected. In an older version of Simulink, there was a standard library flip-flop block with the MaskType ‘Latch’. Therefore, SLUPDATE thinks that this block should be replaced with the updated version of that block, the SR-FlipFlop.
To be able to run the model without having their user-defined block updated automatically, the following two options are offered:
1) Before updating, run the SLUPDATE command, with the following qualifier:
slupdate(user_model_name, 'OperatingMode', 'Analyze')
This will show which changes are going to be made.
2) Alternatively, use the Model Advisor (Simulink > Tools > Model Advisor...; select the "Upgrading to the Current Simulink Version" task from the "By Task" grouping).
This will give a more easily viewed list of the blocks that will be changed, together with an explanation as to why the blocks will be changed.