Live plot utility plots ASCII coded streaming data over tcpip or serial connection.
Demo files are attached for ease of use. Current code should cover a variety of situation. Modify the code to suit your special need.
Data format:
Each line of the streaming data is considered as a sample. The first
column is considered as a label of data. It have to match with a
preset keyword to be considered as a valid sample. The following
columns are numbered 2, 3, 4 .... Data can be extracted from these
columns. For example,
TestPlot 0.001 2.641 231 0
is a sample with keyword TestPlot. The following columns contains 4
numbers that available for plotting.
Usage:
To plot data, issue a command
live_plot(data, conn);
to open up the plot window, where data contains description of data
stream and datasrc contains information about the underlying connection
of data.
data.keyword contains keyword of data to be plotted data.columns
is a vector contain all the columns need to be plot
data.Ts sample time of data, this is used to
recover the real time vector of plot. It is assumed
data comes at a constant frequecy.
data.Twindow set the width of plot window in same unit as Ts.
data.YRange Y direction range. Set to -1 for adaptive.
conn.type Type of connection 'tcpip' or 'serial'
conn.host Remote host name of data, valid for 'tcpip' only.
conn.port Remote tcpip port, or COM port number, in integer.
conn.baud Baudrate of communication, in integer, valid for
'serial' only.
引用格式
Peng Xu (2024). TCPIP/Serial Data Live Plot Utility (https://www.mathworks.com/matlabcentral/fileexchange/46268-tcpip-serial-data-live-plot-utility), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- MATLAB > Graphics > 2-D and 3-D Plots > Surfaces, Volumes, and Polygons > Volume Visualization > Vector Volume Data >
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!