Serial input from COM device via "Stream Input"-block in Simulink Desktop Real-Time External (SLDRT)
이전 댓글 표시
Hi,
in short, I would like to imitate the functionality of the "Serial Receive" block (https://de.mathworks.com/help/instrument/serialreceive.html) with the "Stream Input" block (https://de.mathworks.com/help/sldrt/ref/streaminput.html) and don't know how to do it.
Explanation: As part of my project I am forced to run my code in the Simulink Desktop Real-Time External environment. But since the serial blocks are only available in normal mode but not external mode, I require to have some work around this, where the only alternative seems to be the Stream Input block.
Example:
In normal mode I am using the Serial Configuration and Serial Receive blocks as follows:

So one message contains of a starting byte "A" and an end byte "\n". In between there currently is one single value containing of 4 bytes. With this I can display the following function:

When I now try to imitate that behavior with the stream blocks in external mode I am trying to do this:
with the board settings:
With the same data stream as in the above example, the sinus now looks like this:

Does anyone have an idea of what I am doing wrong? One problem is, that Stream Input does not use a starting byte, but just end bytes (never the less I tried to enter 'A' also into the message terminator array).
Furthermore I would like to receive a message containing 3 values and I do not know how to do that either.
Thank you in advance for every hint.
Best regards,
Max
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 System Configuration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!