MATLAB/Simulink 串行发送
我正在使用 Simulink 与串行设备进行通信。我正在尝试使用 Serial Send
块将值发送到设备。如果我尝试使用“传统”源(例如 Constant
块)发送数据,则会收到以下错误。
无法为“串行发送”块分配连续采样时间。
如何发送非连续信号?
I am using Simulink to communicate with a serial device. I am trying to use the Serial Send
block to send a value to the device. If I try to use a 'traditional' source (such as the Constant
block) to send data, I get the following error.
The block 'Serial Send' cannot be assigned a continuous sample time.
How can I send a non-continuous signal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须将信号转换为 discreate。首先将数据放入量化器,然后从量化器输出连接“零阶保持”,现在将数据发送到串行发送
You have to convert signal to discreate. First put your data to Quantizer than output from Quantizer connect "Zero-Order hold " now you send data to serial send
根据 MATLAB 邮件列表上的讨论(来源):
更新:
另外,您可能想尝试使用
To Instrument
< /a> 块而不是串行发送
阻止。我从未使用过,但我看到的主要区别是To Instrument
块设计用于发送“模拟数据”,这可能与Constant
更兼容堵塞。不过,也许您无法使用To Instrument
块是有原因的。Per a discussion on the MATLAB mailing list (source):
Update:
Also, you may want to try using the
To Instrument
block instead of theSerial Send
block. I've never used either, but the main difference I see is that theTo Instrument
block is designed for sending "simulation data", which might be more compatible with theConstant
block. Maybe there's a reason that you can't use theTo Instrument
block, though.