Reputation: 6711
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 instrumentIt 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?
Upvotes: 1
Views: 1866
Reputation: 1537
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.
Upvotes: 3