When I execute the RootInportDataTypeError.mdl whose Inport block's datatype is set to 'auto', by first loading the RootInportDataTypeError.mat file, I receive the following error:
Invalid data type for root level inport 'RootInportDateTypeError/In1'. The model is configured to load its root level inports from the workspace. These external inputs must have data type 'double'. This data type does not agree with the data type, 'boolean', that is being set for this root level inport. Loading external inputs from the workspace is turned off by going to the Simulation menu and selecting Configuration Parameters. On the Data Import/Export page, locate the Load from workspace group and uncheck the Input checkbox.
Since in the simulation environment, the root inport must be a double, the Constant block should inherit the double type from the root inport (rather than incorrectly inheriting the boolean type from the OUTPUT of the comparison block). This would allow the system engineer to use the model without concern for typing issues while the software engineer can use the exact same model with mpt parameters to generate code with the desired signal typing.
Best Answer