How can I collect data from senors data via serial port in MATLAB?

3 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 May 2023
Edited: MathWorks Support Team on 19 May 2023
Data can be collected from serial port into MATLAB by following one of the two steps:
1. Use the "serial" function in base MATLAB i.e., without any specialized toolbox. More information can be found in the documentation below:
Run below command in MATLAB 2017b for documentation:
>> web(fullfile(docroot, 'matlab/ref/serial.html'))
Or for latest release documentation for using the "serial" function, please refer to:
2. Use can make use of the Instrument control toolbox to collect data from serial ports.
Instrument Control Toolbox™ software provides additional serial port functionality. In addition to command-line access, this toolbox has a graphical tool called the Test & Measurement Tool, which allows you to communicate with, configure, and transfer data with your serial device without writing code. The Test & Measurement Tool generates MATLAB code for your serial device that you can later reuse to communicate with your device or to develop UI-based applications. The toolbox includes additional serial I/O utility functions that facilitate object creation and configuration, instrument communication, and so on. With the toolbox you can communicate with GPIB- or VISA-compatible instruments. More details can be found in the documentation pages linked below:

More Answers (0)

Categories

Find more on Instrument Control Toolbox Supported Hardware in Help Center and File Exchange

Products


Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!