我使用从串行端口接收一些数据信号Serial Receive
块(当然还有串行配置块)。我用它来移动视频中的标记。它在模拟期间工作,但是当我使用生成 .exe 文件时Simulink Coder
执行期间标记不会移动。看起来它没有从串行接收数据。
*EDIT:*原始数据是int16
但“来源”是建立在Arduino Mega2560
using Target Support Package
所以使用Arduino serial send
阻止它生成源USB COM port
波特率为9600。因为Arduino serial block
只想要uint8
我用了一个byte pack block
before Arduino Serial block
。参数为byte pack block
are:
1)Input port data types = {'int16'}
2)Byte Alignment = 2
在收到我使用的模型中Serial Receive
阻止来自instrument control toolbox
with:
(Serial Configuration Block
:)
Baud Rate = 9600;
Data Bits = 8;
Stop Bits = 1;
Byte Order = LittleEndian;
Flow Control = none;
Time Out = 10;
Header = none;
Terminator = none;
Data size = [2 1];
Data Type = uint8;
Enable blocking mode = flag;
Action when data is unavailable = output last received value;
Block sample time = (same sample time setted in the model built on Arduino)
I have connected this Serial Receive Block to a Byte Unpack block with:
Output dimensions = {[1]};
Output Port Data types = {'int16'} (data type of original signal)
建议?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)