“串行发送”和“串行发送”之间的区别和“到仪器”块
MATLAB/Simulink 中的仪器控制工具箱包含两个可以将数据发送到串行端口上的设备的模块:
Serial Send
:通过串口发送二进制数据To Instrument
:将模拟数据发送到仪器
看起来To Instrument
块比Serial Send<更通用/代码>。
To Instrument
允许您选择底层接口,其中一个选项是“串行”。
To Instrument
(使用 Interface=Serial 配置时)和 Serial Send
之间有什么区别?是否有任何理由选择其中任何一种来向设备发送 4 字节的数字数据?是否还有其他情况只能其中一种起作用?
The Instrument Control Toolbox in MATLAB/Simulink contains two blocks that can send data to a device on a serial port:
Serial Send
: Send binary data over serial portTo Instrument
: Send simulation data to instrument
It looks like the To Instrument
block is more general-purpose than Serial Send
. To Instrument
allows you to select the underlying interface, with one option being "Serial".
What is the difference between To Instrument
(when configured with Interface=Serial) and Serial Send
? Is there any reason to prefer either one for sending, say, 4 bytes of numeric data to the device? Are there any other situations where only one of them would work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
区别之一:
“To Instrument”和“Query Instrument”块是较旧的块,并且被硬编码为仅用于端口 COM1-COM4。对于使用不同串行端口的设备,请尝试使用“串行发送”和“串行接收”块来实现相同的功能。这些模块的模块参数对话框应自动填充可供通信的可用 COM 端口列表,以便您可以为您的设备选择正确的端口。
One difference:
The "To Instrument" and "Query Instrument" blocks are older blocks and were hardcoded to only be used for ports COM1-COM4. For a device that's on a different serial port, please try the "Serial Send" and "Serial Receive" blocks to achieve the same functionality. The block parameters dialog for these blocks should auto-populate the list of available COM ports to communicate with so that you can select the proper port for your device.