フィルターのクリア

receiving data from virtual COM in Simulink Desktop Real Time

2 ビュー (過去 30 日間)
Mostafa Hamidi
Mostafa Hamidi 2021 年 7 月 16 日
回答済み: Jan Houska 2021 年 7 月 31 日
Hello,
I'm trying to Receive data Using "Serial Receive" block from Instrument Control toolbox.
I want to run it in real time mode because I want to receive data from a virtual COM (from proteus) but I got an error:
"Level-2 MATLAB S-function 'sserialrb' in 'virtual_world/Serial Receive' specifies 'SetSimViewingDevice(true)' , which prevents an output port from being created for the S-function."
I found a post about it but it wasn't mentioned how to fix this.
Is there any solution for it? and if not, is there any alternative solution that I can use to receive data in real time mode?
Thanks in advance.

回答 (1 件)

Jan Houska
Jan Houska 2021 年 7 月 31 日
Hi Mostafa,
you should be able to use the Packet Input or Stream Input blocks from the Simulink Desktop Real-Time library, and set the driver to Serial Port. Please check the sldrtex_packetio and sldrtex_streamio examples to see how to use the blocks.
Good Luck, Jan

カテゴリ

Help Center および File ExchangeModel Preparation for Real-Time Simulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by