Solution
This error occurs when you have used incompatible versions of VeriStand and the 'VeriStand Model Generation Support' MATLAB add-on.
If you are using VeriStand 2021, this is compatible with version 1.0 of the 'VeriStand Model Generation Support' MATLAB add-on, but not version 1.1.
Either upgrade your version of VeriStand to 2021 R2 and continue using version 1.1 of the add-on. Or, uninstall the add-on and instead install version 1.0.
VeriStand | MathWorks MATLAB® | VeriStand Model Generation Support |
---|
2021 R3 | R2022a/b R2021a/b R2020a/b | 1.2 [EXTERNAL LINK], 1.1*, 1.0* |
2021 R2 | R2022a R2021a/b R2020a/b | 1.1 [EXTERNAL LINK], 1.0* |
2021 | R2021a/b R2020a/b | 1.0 [EXTERNAL LINK] |
*Previous versions of VeriStand Model Generation Support are compatible with newer versions of VeriStand, but may not include the newest features.
Through the MATLAB Add-On Explorer you can only install the latest version of the 'VeriStand Model Generation Support' add-on. If you require an older version, you can get this from the VeriStand GitHub page:
Releases · ni/niveristand-model-generation-support-for-simulink · GitHubSelect the version you require and then download and run the VeriStandModelGenerationSupport.mltbx file.
Another root cause for this behavior is having a NaN in a matrix operation. If the variable array contains a NaN value somewhere in the array, even if it is not referenced at all by the Simulink model, the model will fail to load in VeriStand. The values or size of the array doesn't matter, but it should contain NaN in any spot other than the 0th element. As a workaround, you can swap out these matrix-indexed values for unique workspace variables derived from those matrices