1

The Instrument Control Toolbox in MATLAB/Simulink contains two blocks that can send data to a device on a serial port:

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?

4

1 回答 1

3

区别之一:

“To Instrument”和“Query Instrument”块是较旧的块,并且被硬编码为仅用于端口 COM1-COM4。对于在不同串行端口上的设备,请尝试“串行发送”和“串行接收”块来实现相同的功能。这些块的块参数对话框应自动填充可用 COM 端口列表以与之通信,以便您可以为您的设备选择正确的端口。

于 2016-02-22T19:30:13.430 回答