What is SetSimViewingDevice?

2 次查看(过去 30 天)
What is SetSimViewingDevice and how can I set it to false in the hope of compiling the serial receive block in Simulink?

采纳的回答

Abhi Sundararaman
Abhi Sundararaman 2017-7-26
Unfortunately, the serial send/receive blocks from the Instrument control toolbox are not supported for code generation. Therefore, even if you could set the "SetSimViewingDevice" parameter to "false", it would not allow code generation. Instead, you would get a different error.
To answer your initial question about "what is setsimviewingdevice": This is a parameter that is used to prevent S-functions from having code generated for them. If you were to write your own S-function, but you wanted this block to be "skipped" in code generation, you would set the value of "SetSimViewingDevice" to "true". The most likely reason you encountered this parameter with respect to the Serial Receive block is because this block is coded as an S-function under the hood, and we set this parameter to be "true" so the compiler does not try to generate code for this (because it would fail otherwise).
So to summarize, changing the value of this parameter would unfortunately still not allow the block to be compiled. The main workaround for this limitation would be to write a custom block for this functionality using your own S-function.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Block and Blockset Authoring 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by