Matlab Instrument Control Toolsbox Serial Send/Receive 基本使用
标签:
matlabinstrumentserialsendreceive |
分类: Simulink |
网络上介绍这个模块使用的资料基本没有,本文仅演示最基本的功能,欢迎大家板砖~
1:确保电脑有可用的串口,包括usb转Rs232 的串口,或者VSD虚拟串口
http://s9/mw690/002rIxcqzy6SQYK09Ju88&690Instrument
2:搭建Simulink模型
使用 Instrument Control Toolsbox 里的 三个:
Serial configuration, Serial Receive, Serial Send
模块的使用请参阅help文档,务必首先配置好Serial configuration
http://s10/mw690/002rIxcqzy6SQYZn20pb9&690Instrument
3:配置模块:
关键的配置项:
http://s10/mw690/002rIxcqzy6SQZjU05P39&690Instrument
4:仿真参数设置:请使用fixed-step
http://s15/mw690/002rIxcqzy6SQZqH3Bkbe&690Instrument
5:仿真结果:
主机和串口显示设备互相发送数据与接收数据
http://s15/mw690/002rIxcqzy6SQZvQC7A1e&690Instrument
http://s15/mw690/002rIxcqzy6SQZwrC461e&690Instrument
经验:多看帮助文档多实践~enjoy~
补充:
如果串口数据是按照某种定义好的格式/协议传送的,可以在下面的MATLAB function中实现对数据的解析和输出(可多维输出),也可以使用更复杂的s-function实现
http://s4/mw690/002rIxcqzy6SRa8K3Xt83&690Instrument

加载中…