Why do I receive an error when using the Demux block with Exported Global outputs in Simulink?

3 次查看(过去 30 天)
I have a model 'test_error.mdl' with a Demux and the storage class setting of the outputs are 'Exported Global'. When I try to run the model, I receive the following error:
The signal attribute {StorageClass = 'ExportedGlobal'} specified on the line originating from the output port 1 of 'test_error/Demux' is invalid because the individual signals contained in this line are mapped to different memory locations. The StorageClass for this line must be set to 'Auto'.

采纳的回答

MathWorks Support Team
The error message you observe is due to expected behavior. In order to specify a storage class other than "Auto" on the outputs of the Demux block, each of the outputs must have unique memory locations. Whereas, by default, the outputs of the demux block are elements of one contiguous block of memory. The attached workarounds allow the use of the 'ExportedGlobal' class by forcing the outputs of the Demux block to be stored in separate non-contiguous memory locations.
Workaround 1. You can use the 'Signal Conversion' block as shown in 'test_workaround.mdl'.
Workaround 2. Change the storage class of the input signal of the Demux block to 'Exported Global' i.e. to have a single memory location as shown in 'test_workaround2.mdl'.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

标签

尚未输入任何标签。

产品


版本

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by