What is SetSimViewingDevice?

6 visualizaciones (últimos 30 días)
Nina Buchanan
Nina Buchanan el 22 de Jul. de 2017
Respondida: Abhi Sundararaman el 26 de Jul. de 2017
What is SetSimViewingDevice and how can I set it to false in the hope of compiling the serial receive block in Simulink?

Respuesta aceptada

Abhi Sundararaman
Abhi Sundararaman el 26 de Jul. de 2017
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.

Más respuestas (0)

Categorías

Más información sobre Block Libraries en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by